Skip to contentSkip to conversation

package_rpm.bbclass: fix incremental rpm generation

PATCH Applied Robert Yang 2 participants 3 messages Jun 21, 2012 – Jun 22, 2012

lore
Share & tools
lore
#0 lore raw

cover package_rpm.bbclass: fix incremental rpm generation

The following changes since commit e0a70547069fe7e8a2d6bdaffc985fb172d46c31:

perl: Allow perl to cross build and native build in a directory named "t" (2012-06-18 17:33:04 +0100)

are available in the git repository at:
git://git.pokylinux.org/poky-contrib robert/rpm_inc
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/rpm_inc

Robert Yang (1):
package_rpm.bbclass: fix incremental rpm generation

 meta/classes/package_rpm.bbclass |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)
#1 lore raw

PATCH 1/1 package_rpm.bbclass: fix incremental rpm generation

Fixes:
* Remove the "echo '# Remove manifest padding....' > remove.manifest, The remove.manifest would be used via "rpm -e remove.manifest", there would be error since there is no pkg called: Remove, manifest or padding

* The incremental.manifest can't be null when used by rpm, so check it before use.

* The rpm needs:

	--root "${target_rootfs}/install"
  when use:
	-D "_dbpath ${target_rootfs}/install"

Otherwise it would use the ${target_rootfs} as the root, and use the ${target_rootfs}/var/lib/rpm as the dbpath, this is OK in a fresh installation, but there would be errors when increment rpm generation.

[YOCTO #2617]

---
 meta/classes/package_rpm.bbclass |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)
meta/classes/package_rpm.bbclass +13 -3
index d5406c2..5559a46 100644
@@ -182,14 +182,15 @@ rpm_update_pkg () {
         # been run by now, so don't have to run them(preun, postun, etc.) when
         # erase the pkg
         if [ -s ${target_rootfs}/install/remove.manifest ]; then
-            echo "# Remove manifest padding...." >> ${target_rootfs}/install/remove.manifest
             rpm_common_comand --noscripts --nodeps \
                 -e `cat ${target_rootfs}/install/remove.manifest`
         fi
 
         # Attempt to install the incremental pkgs
-        rpm_common_comand --nodeps --replacefiles --replacepkgs \
-            -Uvh ${target_rootfs}/install/incremental.manifest
+        if [ -s ${target_rootfs}/install/incremental.manifest ]; then
+            rpm_common_comand --nodeps --replacefiles --replacepkgs \
+               -Uvh ${target_rootfs}/install/incremental.manifest
+        fi
     else
         # Attempt to install
         rpm_common_comand --replacepkgs -Uhv $manifest
@@ -314,6 +315,7 @@ package_install_internal_rpm () {
 		echo "# Install manifest padding" >> ${target_rootfs}/install/install.manifest
 		${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
 			--predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
+			--root "${target_rootfs}/install" \
 			-D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}-base_archs.macro`" \
 			-D "__dbi_txn create nofsync" \
 			-U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
@@ -343,6 +345,7 @@ package_install_internal_rpm () {
 			echo "Attempting $pkg_name..." >> "${WORKDIR}/temp/log.do_${task}_attemptonly.${PID}"
 			${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
 				--predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
+				--root "${target_rootfs}/install" \
 				-D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}.macro`" \
 				-D "__dbi_txn create nofsync private" \
 				-U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
@@ -363,6 +366,7 @@ package_install_internal_rpm () {
 		# Dump the full set of recommends...
 		${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
 			--predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
+			--root "${target_rootfs}/install" \
 			-D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}.macro`" \
 			-D "__dbi_txn create nofsync private" \
 			-qa --qf "[%{RECOMMENDS}\n]" | sort -u > ${target_rootfs}/install/recommend
@@ -392,6 +396,7 @@ package_install_internal_rpm () {
 			echo "Attempting $pkg_name..." >> "${WORKDIR}/temp/log.do_{task}_recommend.${PID}"
 			${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
 				--predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
+				--root "${target_rootfs}/install" \
 				-D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}.macro`" \
 				-D "__dbi_txn create nofsync private" \
 				-U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
@@ -406,6 +411,7 @@ package_install_internal_rpm () {
 	# Now that we have a solution, pull out a list of what to install...
 	echo "Manifest: ${target_rootfs}/install/install.manifest"
 	${RPM} -D "_dbpath ${target_rootfs}/install" -qa --qf "%{packageorigin}\n" \
+		--root "${target_rootfs}/install" \
 		-D "__dbi_txn create nofsync private" \
 		> ${target_rootfs}/install/install_solution.manifest
 
@@ -419,6 +425,7 @@ package_install_internal_rpm () {
 		# an actual package install!
 		${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
 			--predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
+			--root "${target_rootfs}/install" \
 			-D "_dbpath ${target_rootfs}/install" -D "`cat ${confbase}-ml_archs.macro`" \
 			-D "__dbi_txn create nofsync" \
 			-U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
@@ -427,6 +434,7 @@ package_install_internal_rpm () {
 		# Now that we have a solution, pull out a list of what to install...
 		echo "Manifest: ${target_rootfs}/install/install_multilib.manifest"
 		${RPM} -D "_dbpath ${target_rootfs}/install" -qa --qf "%{packageorigin}\n" \
+			--root "${target_rootfs}/install" \
 			-D "__dbi_txn create nofsync private" \
 			> ${target_rootfs}/install/install_multilib_solution.manifest
 
@@ -513,6 +521,7 @@ EOF
 
 			${RPM} --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
 				--predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
+				--root "${target_rootfs}/install" \
 				-D "_dbpath ${target_rootfs}/initial" -D "`cat ${confbase}.macro`" \
 				-D "__dbi_txn create nofsync" \
 				-U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
@@ -520,6 +529,7 @@ EOF
 
 			${RPM} -D "_dbpath ${target_rootfs}/initial" -qa --qf "%{packageorigin}\n" \
 				-D "__dbi_txn create nofsync private" \
+				--root "${target_rootfs}/install" \
 				> ${target_rootfs}/install/initial_solution.manifest
 
 			rpm_update_pkg ${target_rootfs}/install/initial_solution.manifest
Signature · 1 line
1.7.1
Applied
#2 lore raw
In reply to Robert Yang
Quoted 8 lines · Robert Yang

The following changes since commit e0a70547069fe7e8a2d6bdaffc985fb172d46c31:

perl: Allow perl to cross build and native build in a directory named "t" (2012-06-18 17:33:04 +0100)

are available in the git repository at:
git://git.pokylinux.org/poky-contrib robert/rpm_inc
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/rpm_inc

Quoted 7 lines

Robert Yang (1):
package_rpm.bbclass: fix incremental rpm generation

  meta/classes/package_rpm.bbclass |   16 +++++++++++++---
  1 files changed, 13 insertions(+), 3 deletions(-)

Merged into OE-Core

Thanks
Sau!

Quoted 5 lines

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core