Skip to contentSkip to conversation

run-postinsts: Use opkg/dpkg to configure when possible

PATCH New Jussi Kukkonen 1 participant 2 messages Nov 4, 2016

lore
Share & tools
lore
#0 lore raw

cover run-postinsts: Use opkg/dpkg to configure when possible

run-postinst has not been using package managers to configure the
packages: the code was there all along but a bug prevented it from being used.

I was hesitating sending this a bit as it felt quite difficult to test comprehensively and the change is not completely trivial: as an example the order of postinsts will likely change as it's now handled by the package manager instead of OE. I can still run more tests if anyone has good ideas...

Cheers,
Jussi

The following changes since commit c3d2df883a9d6d5036277114339673656d89a728:

oeqa/selftest/kernel.py: Add new file destined for kernel related tests (2016-11-01 10:05:46 +0000)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib jku/10478
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=jku/10478

Jussi Kukkonen (1):
run-postinsts: Use opkg/dpkg to configure when possible

 .../recipes-devtools/run-postinsts/run-postinsts/run-postinsts | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 run-postinsts: Use opkg/dpkg to configure when possible

Currently run-postinsts script has code to run postinst scripts via opkg/dpkg configure but that code is never used. The advantage of using package managers instead of just executing the scripts is to keep the package manager DB updated.

Fix the script so that the package managers are used when appropriate. Also use $localstatedir for the opkg runtime file location.

Fixes [YOCTO #10478].

---
 .../recipes-devtools/run-postinsts/run-postinsts/run-postinsts | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts +6 -4
index 04ba394..10f2118 100755
@@ -16,23 +16,25 @@ pm_installed=false
 for pm in $backend_list; do
 	pi_dir="#SYSCONFDIR#/$pm-postinsts"
 
-	[ -d $pi_dir ] && break
+	if [ ! -d $pi_dir ]; then
+		continue
+	fi
 
+	# found the package manager, it has postinsts
 	case $pm in
 		"deb")
 			if [ -s "#LOCALSTATEDIR#/lib/dpkg/status" ]; then
 				pm_installed=true
-				break
 			fi
 			;;
 
 		"ipk")
-			if [ -s "/var/lib/opkg/status" ]; then
+			if [ -s "#LOCALSTATEDIR#/lib/opkg/status" ]; then
 				pm_installed=true
-				break
 			fi
 			;;
 	esac
+	break
 done
 
 remove_rcsd_link () {
Signature · 1 line
2.1.4