Skip to contentSkip to conversation

Upgrade RPM to RPM 5.4.0

PATCH New Mark Hatle 1 participant 4 messages Jan 28, 2011

lore
Share & tools
lore

Mark Hatle

author
#0 lore raw

cover Upgrade RPM to RPM 5.4.0

Upgrade RPM to RPM 5.4.0. Include additional changes to the packaging and rootfs creation as necessary for the new version.

Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: mhatle/rpm
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=mhatle/rpm

Thanks,
Mark Hatle <[email protected]>
---

Mark Hatle (2):
rpm: Uprev to RPM 5.4.0
rootfs_rpm: Setup the platform configuration

Qing He (1):
rpm: suggested change

 meta/classes/package.bbclass                       |    2 +-
 meta/classes/package_rpm.bbclass                   |    5 +-
 meta/classes/rootfs_rpm.bbclass                    |   25 +-
 meta/conf/distro/include/as-needed.inc             |    3 +-
 .../rpm/rpm/header-include-fix.patch               |   24 ++
 meta/recipes-devtools/rpm/rpm/rpm-autogen.patch    |   54 +++
 meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch |   18 +
 meta/recipes-devtools/rpm/rpm/rpm2cpio             |   51 +++
 meta/recipes-devtools/rpm/rpm_5.1.10.bb            |  168 --------
 meta/recipes-devtools/rpm/rpm_5.4.0.bb             |  433 ++++++++++++++++++++
 10 files changed, 603 insertions(+), 180 deletions(-)
 create mode 100644 meta/recipes-devtools/rpm/rpm/header-include-fix.patch
 create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-autogen.patch
 create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch
 create mode 100755 meta/recipes-devtools/rpm/rpm/rpm2cpio
 delete mode 100644 meta/recipes-devtools/rpm/rpm_5.1.10.bb
 create mode 100644 meta/recipes-devtools/rpm/rpm_5.4.0.bb
Signature · 1 line
1.7.3.4
author
#1 lore raw

PATCH 1/3 rpm: Uprev to RPM 5.4.0

Update RPM to the latest release, RPM 5.4.0.

---
 meta/classes/package.bbclass                       |    2 +-
 meta/classes/package_rpm.bbclass                   |    5 +-
 meta/classes/rootfs_rpm.bbclass                    |   17 +-
 meta/conf/distro/include/as-needed.inc             |    3 +-
 meta/recipes-devtools/rpm/rpm/rpm-autogen.patch    |   54 +++
 meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch |   18 +
 meta/recipes-devtools/rpm/rpm/rpm2cpio             |   51 +++
 meta/recipes-devtools/rpm/rpm_5.1.10.bb            |  168 --------
 meta/recipes-devtools/rpm/rpm_5.4.0.bb             |  432 ++++++++++++++++++++
 9 files changed, 571 insertions(+), 179 deletions(-)
 create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-autogen.patch
 create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch
 create mode 100755 meta/recipes-devtools/rpm/rpm/rpm2cpio
 delete mode 100644 meta/recipes-devtools/rpm/rpm_5.1.10.bb
 create mode 100644 meta/recipes-devtools/rpm/rpm_5.4.0.bb
meta/classes/package.bbclass +1 -1
index 1b950bb..7e1f3f0 100644
@@ -559,7 +559,7 @@ if [ x"$D" = "x" ]; then
 fi
 }
 
-RPMDEPS = "${STAGING_LIBDIR_NATIVE}/rpm/rpmdeps"
+RPMDEPS = "${STAGING_LIBDIR_NATIVE}/rpm/bin/rpmdeps"
 
 # Collect perfile run-time dependency metadata
 # Output:
meta/classes/package_rpm.bbclass +3 -2
index fbe0626..7c2cdb0 100644
@@ -46,8 +46,7 @@ package_update_index_rpm () {
 				-D "_dbpath $pkgdir/solvedb" --justdb \
 				--noaid --nodeps --noorder --noscripts --notriggers --noparentdirs --nolinktos --stats \
 				--ignoresize --nosignature --nodigest \
-				-D "_dbi_tags_3 Packages:Name:Basenames:Providename:Nvra" \
-				-D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync" \
+				-D "__dbi_txn create nofsync" \
 				$pkgdir/solvedb/manifest
 			echo $pkgdir/solvedb >> ${DEPLOY_DIR_RPM}/solvedb.conf
 		fi
@@ -530,6 +529,8 @@ python do_package_rpm () {
 	cmd = cmd + " --define '_use_internal_dependency_generator 0'"
 	cmd = cmd + " --define '__find_requires " + outdepends + "'"
 	cmd = cmd + " --define '__find_provides " + outprovides + "'"
+	cmd = cmd + " --define '_unpackaged_files_terminate_build 0'"
+	cmd = cmd + " --define 'debug_package %{nil}'"
 	cmd = cmd + " -bb " + outspecfile
 
 	# Build the spec file!
meta/classes/rootfs_rpm.bbclass +10 -7
index 8646eec..6be7886 100644
@@ -79,7 +79,7 @@ fakeroot rootfs_rpm_do_rootfs () {
 	# Generate an install solution by doing a --justdb install, then recreate it with
 	# an actual package install!
 	${RPM} -D "_dbpath ${IMAGE_ROOTFS}/install" -D "`cat ${DEPLOY_DIR_RPM}/solvedb.macro`" \
-		-D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync" \
+		-D "__dbi_txn create nofsync" \
 		-U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
 		${IMAGE_ROOTFS}/install/install.manifest
 
@@ -94,7 +94,7 @@ fakeroot rootfs_rpm_do_rootfs () {
 			fi
 			echo "Attempting $pkg_name..." >> "${WORKDIR}/temp/log.do_rootfs_attemptonly.${PID}"
 			${RPM} -D "_dbpath ${IMAGE_ROOTFS}/install" -D "`cat ${DEPLOY_DIR_RPM}/solvedb.macro`" \
-				-D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync private" \
+				-D "__dbi_txn create nofsync private" \
 				-U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
 			$pkg_name >> "${WORKDIR}/temp/log.do_rootfs_attemptonly.${PID}" || true
 		done
@@ -112,6 +112,7 @@ fakeroot rootfs_rpm_do_rootfs () {
 	 while [ $loop -eq 1 ]; do
 		# Dump the full set of recommends...
 		${RPM} -D "_dbpath ${IMAGE_ROOTFS}/install" -D "`cat ${DEPLOY_DIR_RPM}/solvedb.macro`" \
+			-D "__dbi_txn create nofsync private" \
 			-qa --qf "[%{RECOMMENDS}\n]" | sort -u > ${IMAGE_ROOTFS}/install/recommend
 		# Did we add more to the list?
 		grep -v -x -F -f ${IMAGE_ROOTFS}/install/recommend.list ${IMAGE_ROOTFS}/install/recommend > ${IMAGE_ROOTFS}/install/recommend.new || true
@@ -129,7 +130,7 @@ fakeroot rootfs_rpm_do_rootfs () {
 			fi
 			echo "Attempting $pkg_name..." >> "${WORKDIR}/temp/log.do_rootfs_recommend.${PID}"
 			${RPM} -D "_dbpath ${IMAGE_ROOTFS}/install" -D "`cat ${DEPLOY_DIR_RPM}/solvedb.macro`" \
-				-D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync private" \
+				-D "__dbi_txn create nofsync private" \
 				-U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
 				$pkg_name >> "${WORKDIR}/temp/log.do_rootfs_recommend.${PID}" 2>&1 || true
 		done
@@ -142,12 +143,13 @@ fakeroot rootfs_rpm_do_rootfs () {
 	# Now that we have a solution, pull out a list of what to install...
 	echo "Manifest: ${IMAGE_ROOTFS}/install/install.manifest"
 	${RPM} -D "_dbpath ${IMAGE_ROOTFS}/install" -qa --yaml \
+		-D "__dbi_txn create nofsync private" \
 		| grep -i 'Packageorigin' | cut -d : -f 2 > ${IMAGE_ROOTFS}/install/install_solution.manifest
 
 	# Attempt install
 	${RPM} --root ${IMAGE_ROOTFS} -D "_dbpath ${rpmlibdir}" \
 		--noscripts --notriggers --noparentdirs --nolinktos \
-		-D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync private" \
+		-D "__dbi_txn create nofsync private" \
 		-Uhv ${IMAGE_ROOTFS}/install/install_solution.manifest
 
 	export D=${IMAGE_ROOTFS}
@@ -159,6 +161,7 @@ fakeroot rootfs_rpm_do_rootfs () {
 
 	mkdir -p ${IMAGE_ROOTFS}/etc/rpm-postinsts/
 	${RPM} --root ${IMAGE_ROOTFS} -D '_dbpath ${rpmlibdir}' -qa \
+		-D "__dbi_txn create nofsync private" \
 		--qf 'Name: %{NAME}\n%|POSTIN?{postinstall scriptlet%|POSTINPROG?{ (using %{POSTINPROG})}|:\n%{POSTIN}\n}:{%|POSTINPROG?{postinstall program: %{POSTINPROG}\n}|}|' \
 		> ${IMAGE_ROOTFS}/etc/rpm-postinsts/combined
 	awk -f ${AWKPOSTINSTSCRIPT} < ${IMAGE_ROOTFS}/etc/rpm-postinsts/combined
@@ -246,7 +249,7 @@ resolve_package() {
 	pkg="$1"
 	pkg_name=""
 	for solve in `cat ${DEPLOY_DIR_RPM}/solvedb.conf`; do
-		pkg_name=$(${RPM} -D "_dbpath $solve" -D "_dbi_tags_3 Packages:Name:Basenames:Providename:Nvra" -D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync" -q --yaml $pkg | grep -i 'Packageorigin' | cut -d : -f 2)
+		pkg_name=$(${RPM} -D "_dbpath $solve" -D "__dbi_txn create nofsync" -q --yaml $pkg | grep -i 'Packageorigin' | cut -d : -f 2)
 		if [ -n "$pkg_name" ]; then
 			break;
 		fi
@@ -260,7 +263,7 @@ install_all_locales() {
 	# Generate list of installed packages...
 	INSTALLED_PACKAGES=$( \
 		${RPM} --root ${IMAGE_ROOTFS} -D "_dbpath ${rpmlibdir}" \
-		-D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync private" \
+		-D "__dbi_txn create nofsync private" \
 		-qa --qf "[%{NAME}\n]" | egrep -v -- "(-locale-|-dev$|-doc$|^kernel|^glibc|^ttf|^task|^perl|^python)" \
 	)
 
@@ -271,8 +274,8 @@ install_all_locales() {
 			pkg_name=$(resolve_package $pkg-locale-$lang)
 			if [ -n "$pkg_name" ]; then
 				${RPM} --root ${IMAGE_ROOTFS} -D "_dbpath ${rpmlibdir}" \
+					-D "__dbi_txn create nofsync private" \
 					--noscripts --notriggers --noparentdirs --nolinktos \
-					-D "__dbi_cdb create mp_mmapsize=128Mb mp_size=1Mb nofsync private" \
 					-Uhv $pkg_name || true
 			fi
 		done
meta/conf/distro/include/as-needed.inc +2 -1
index e962619..9d2056e 100644
@@ -11,5 +11,6 @@ ASNEEDED_pn-pciutils = ""
 ASNEEDED_pn-puzzles = ""
 ASNEEDED_pn-dialer = ""
 ASNEEDED_pn-pulseaudio = ""
+ASNEEDED_pn-rpm = ""
 
-TARGET_LDFLAGS += "${ASNEEDED}"
\ No newline at end of file
+TARGET_LDFLAGS += "${ASNEEDED}"
meta/recipes-devtools/rpm/rpm/rpm-autogen.patch new file +54 -0

54 lines not on this page · raw message

meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch new file +18 -0
new file mode 100644
index 0000000..829399c
@@ -0,0 +1,18 @@
+During installation, the libtool relink attempts to link to -lrpm...
+The problem is that it hasn't been installed yet!  So small change causes
+the libtool to instead use the build version.
+
+Signed-off-by: Mark Hatle <[email protected]>
+
+--- rpm-5.4.0/lib/Makefile.am.orig
++++ rpm-5.4.0/lib/Makefile.am
+@@ -90,6 +90,9 @@
+ libsql_la_SOURCES	= libsql.c
+ libsql_la_LIBADD	= librpm.la $(RPMDB_LDADD_COMMON)
+ 
++# pkglib libraries needs to have usrlib libraries already installed!
++install-pkglibLTLIBRARIES: install-usrlibLTLIBRARIES
++
+ install-data-hook:
+ if !ENABLE_BUILD_LAFILES
+ 	-for l in $(usrlib_LTLIBRARIES); do \
meta/recipes-devtools/rpm/rpm/rpm2cpio new file +51 -0

51 lines not on this page · raw message

meta/recipes-devtools/rpm/rpm_5.1.10.bb deleted +0 -168

168 lines not on this page · raw message

meta/recipes-devtools/rpm/rpm_5.4.0.bb new file +432 -0

432 lines not on this page · raw message

Signature · 1 line
1.7.3.4
author
#2 lore raw

PATCH 2/3 rootfs_rpm: Setup the platform configuration

In reply to Mark Hatle

The RPM platform configuration file lists all of the supported architectures, while RPM itself doesn't use this information, other tools may use it to determine compatibility. The first item is the default architecture for a system, while the following items specify alternative compatible architectures.

---
 meta/classes/rootfs_rpm.bbclass |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
meta/classes/rootfs_rpm.bbclass +7 -1
index 6be7886..4a4ec0e 100644
@@ -39,7 +39,13 @@ fakeroot rootfs_rpm_do_rootfs () {
 
 	# Setup base system configuration
 	mkdir -p ${IMAGE_ROOTFS}/etc/rpm/
-	echo "${TARGET_ARCH}-linux" >${IMAGE_ROOTFS}/etc/rpm/platform
+
+	# Default arch is the top..
+	echo "${TARGET_ARCH}-unknown-linux" >${IMAGE_ROOTFS}/etc/rpm/platform
+	# Add the rest in sort order..
+	for each in ${PACKAGE_ARCHS} ; do
+		echo "$each""-unknown-linux" >>${IMAGE_ROOTFS}/etc/rpm/platform
+	done
 
 	# Tell RPM that the "/" directory exist and is available
 	mkdir -p ${IMAGE_ROOTFS}/etc/rpm/sysinfo
Signature · 1 line
1.7.3.4
author
#3 lore raw

PATCH 3/3 rpm: suggested change

In reply to Mark Hatle

From: Qing He <[email protected]>

---
 .../rpm/rpm/header-include-fix.patch               |   24 ++++++++++++++++++++
 meta/recipes-devtools/rpm/rpm_5.4.0.bb             |    1 +
 2 files changed, 25 insertions(+), 0 deletions(-)
 create mode 100644 meta/recipes-devtools/rpm/rpm/header-include-fix.patch
meta/recipes-devtools/rpm/rpm/header-include-fix.patch new file +24 -0
new file mode 100644
index 0000000..92c534e
@@ -0,0 +1,24 @@
+diff --git a/rpmdb/rpmdb.h b/rpmdb/rpmdb.h
+index 0e1bdd7..8b522bb 100644
+--- a/rpmdb/rpmdb.h
++++ b/rpmdb/rpmdb.h
+@@ -9,6 +9,7 @@
+ 
+ #include <assert.h>
+ #include <mire.h>
++#include <errno.h>
+ 
+ #include <rpmtypes.h>
+ #include <rpmtag.h>	/* XXX Header typedef */
+diff --git a/rpmdb/rpmtag.h b/rpmdb/rpmtag.h
+index 8af6480..2166b4c 100644
+--- a/rpmdb/rpmtag.h
++++ b/rpmdb/rpmtag.h
+@@ -7,6 +7,7 @@
+ 
+ #include <rpmiotypes.h>
+ #include <rpmsw.h>
++#include <stdint.h>
+ 
+ #ifdef __cplusplus
+ extern "C" {
meta/recipes-devtools/rpm/rpm_5.4.0.bb +1 -0
index 541fb60..0f3425f 100644
@@ -52,6 +52,7 @@ SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.0-0.20101229.src.rpm \
 	   file://perfile_rpmdeps.sh \
 	   file://rpm-autogen.patch \
 	   file://rpm-libsql-fix.patch \
+           file://header-include-fix.patch \
 	  "
 
 #           file://hdraddorappend.patch \
Signature · 1 line
1.7.3.4