summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDexuan Cui <dexuan.cui@intel.com>2011-09-19 16:00:38 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-09-21 13:42:49 +0100
commit23773a899be5dcb0e08762b408791c01c48d22cf (patch)
treee4cda2f85a28d705a049abd73d46b6412aedc9c3
parentf45ef8d9fa0277a919b69e95442fd44db741db0a (diff)
downloadpoky-23773a899be5dcb0e08762b408791c01c48d22cf.tar.gz
deb packages support: switch from /var/dpkg to /var/lib/dpkg
[YOCTO #1086] The pach was backported from OE: http://git.openembedded.net/cgit.cgi/openembedded/commit/?id=41e0fbf792037f249d1b8d283b3de81718887c9f (From OE-Core rev: d1e6f49a6473df3c626100ba01b27485f735c33b) Signed-off-by: Dexuan Cui <dexuan.cui@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/package_deb.bbclass10
-rw-r--r--meta/classes/populate_sdk_deb.bbclass4
-rw-r--r--meta/classes/rootfs_deb.bbclass20
-rw-r--r--meta/recipes-devtools/apt/apt-native_0.7.14.bb2
-rw-r--r--meta/recipes-devtools/apt/apt_0.7.14.bb2
-rw-r--r--meta/recipes-devtools/apt/files/apt.conf4
-rwxr-xr-xmeta/recipes-devtools/dpkg/run-postinsts/run-postinsts2
-rw-r--r--meta/recipes-devtools/dpkg/run-postinsts/run-postinsts.awk2
-rw-r--r--meta/recipes-devtools/dpkg/run-postinsts_1.0.bb2
-rw-r--r--meta/recipes-devtools/update-alternatives/update-alternatives-dpkg.inc6
10 files changed, 27 insertions, 27 deletions
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index 5a32047322..6733e64534 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -135,11 +135,11 @@ package_install_internal_deb () {
135 135
136 export APT_CONFIG="${STAGING_ETCDIR_NATIVE}/apt/apt-${task}.conf" 136 export APT_CONFIG="${STAGING_ETCDIR_NATIVE}/apt/apt-${task}.conf"
137 137
138 mkdir -p ${target_rootfs}/var/dpkg/info 138 mkdir -p ${target_rootfs}/var/lib/dpkg/info
139 mkdir -p ${target_rootfs}/var/dpkg/updates 139 mkdir -p ${target_rootfs}/var/lib/dpkg/updates
140 140
141 > ${target_rootfs}/var/dpkg/status 141 > ${target_rootfs}/var/lib/dpkg/status
142 > ${target_rootfs}/var/dpkg/available 142 > ${target_rootfs}/var/lib/dpkg/available
143 143
144 apt-get update 144 apt-get update
145 145
@@ -179,7 +179,7 @@ package_install_internal_deb () {
179 done 179 done
180 180
181 # Mark all packages installed 181 # Mark all packages installed
182 sed -i -e "s/Status: install ok unpacked/Status: install ok installed/;" ${target_rootfs}/var/dpkg/status 182 sed -i -e "s/Status: install ok unpacked/Status: install ok installed/;" ${target_rootfs}/var/lib/dpkg/status
183} 183}
184 184
185deb_log_check() { 185deb_log_check() {
diff --git a/meta/classes/populate_sdk_deb.bbclass b/meta/classes/populate_sdk_deb.bbclass
index 2cff69e827..be7b5520c4 100644
--- a/meta/classes/populate_sdk_deb.bbclass
+++ b/meta/classes/populate_sdk_deb.bbclass
@@ -52,8 +52,8 @@ fakeroot populate_sdk_deb () {
52 populate_sdk_post_deb ${SDK_OUTPUT}/${SDKPATHNATIVE} 52 populate_sdk_post_deb ${SDK_OUTPUT}/${SDKPATHNATIVE}
53 53
54 #move remainings 54 #move remainings
55 install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}/var/dpkg 55 install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}/var/lib/dpkg
56 mv ${SDK_OUTPUT}/var/dpkg/* ${SDK_OUTPUT}/${SDKPATHNATIVE}/var/dpkg 56 mv ${SDK_OUTPUT}/var/lib/dpkg/* ${SDK_OUTPUT}/${SDKPATHNATIVE}/var/lib/dpkg
57 rm -rf ${SDK_OUTPUT}/var 57 rm -rf ${SDK_OUTPUT}/var
58 58
59 populate_sdk_log_check populate_sdk 59 populate_sdk_log_check populate_sdk
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
index e03e80bdb0..bab8e1e8c7 100644
--- a/meta/classes/rootfs_deb.bbclass
+++ b/meta/classes/rootfs_deb.bbclass
@@ -13,7 +13,7 @@ opkglibdir = "${localstatedir}/lib/opkg"
13fakeroot rootfs_deb_do_rootfs () { 13fakeroot rootfs_deb_do_rootfs () {
14 set +e 14 set +e
15 15
16 mkdir -p ${IMAGE_ROOTFS}/var/dpkg/alternatives 16 mkdir -p ${IMAGE_ROOTFS}/var/lib/dpkg/alternatives
17 17
18 # update index 18 # update index
19 package_update_index_deb 19 package_update_index_deb
@@ -36,15 +36,15 @@ fakeroot rootfs_deb_do_rootfs () {
36 export OPKG_OFFLINE_ROOT=${IMAGE_ROOTFS} 36 export OPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
37 37
38 _flag () { 38 _flag () {
39 sed -i -e "/^Package: $2\$/{n; s/Status: install ok .*/Status: install ok $1/;}" ${IMAGE_ROOTFS}/var/dpkg/status 39 sed -i -e "/^Package: $2\$/{n; s/Status: install ok .*/Status: install ok $1/;}" ${IMAGE_ROOTFS}/var/lib/dpkg/status
40 } 40 }
41 _getflag () { 41 _getflag () {
42 cat ${IMAGE_ROOTFS}/var/dpkg/status | sed -n -e "/^Package: $2\$/{n; s/Status: install ok .*/$1/; p}" 42 cat ${IMAGE_ROOTFS}/var/lib/dpkg/status | sed -n -e "/^Package: $2\$/{n; s/Status: install ok .*/$1/; p}"
43 } 43 }
44 44
45 # Attempt to run preinsts 45 # Attempt to run preinsts
46 # Mark packages with preinst failures as unpacked 46 # Mark packages with preinst failures as unpacked
47 for i in ${IMAGE_ROOTFS}/var/dpkg/info/*.preinst; do 47 for i in ${IMAGE_ROOTFS}/var/lib/dpkg/info/*.preinst; do
48 if [ -f $i ] && ! sh $i; then 48 if [ -f $i ] && ! sh $i; then
49 _flag unpacked `basename $i .preinst` 49 _flag unpacked `basename $i .preinst`
50 fi 50 fi
@@ -52,7 +52,7 @@ fakeroot rootfs_deb_do_rootfs () {
52 52
53 # Attempt to run postinsts 53 # Attempt to run postinsts
54 # Mark packages with postinst failures as unpacked 54 # Mark packages with postinst failures as unpacked
55 for i in ${IMAGE_ROOTFS}/var/dpkg/info/*.postinst; do 55 for i in ${IMAGE_ROOTFS}/var/lib/dpkg/info/*.postinst; do
56 if [ -f $i ] && ! sh $i configure; then 56 if [ -f $i ] && ! sh $i configure; then
57 _flag unpacked `basename $i .postinst` 57 _flag unpacked `basename $i .postinst`
58 fi 58 fi
@@ -65,12 +65,12 @@ fakeroot rootfs_deb_do_rootfs () {
65 65
66 # Hacks to allow opkg's update-alternatives and opkg to coexist for now 66 # Hacks to allow opkg's update-alternatives and opkg to coexist for now
67 mkdir -p ${IMAGE_ROOTFS}${opkglibdir} 67 mkdir -p ${IMAGE_ROOTFS}${opkglibdir}
68 if [ -e ${IMAGE_ROOTFS}/var/dpkg/alternatives ]; then 68 if [ -e ${IMAGE_ROOTFS}/var/lib/dpkg/alternatives ]; then
69 rmdir ${IMAGE_ROOTFS}/var/dpkg/alternatives 69 rmdir ${IMAGE_ROOTFS}/var/lib/dpkg/alternatives
70 fi 70 fi
71 ln -s ${opkglibdir}/alternatives ${IMAGE_ROOTFS}/var/dpkg/alternatives 71 ln -s ${opkglibdir}/alternatives ${IMAGE_ROOTFS}/var/lib/dpkg/alternatives
72 ln -s /var/dpkg/info ${IMAGE_ROOTFS}${opkglibdir}/info 72 ln -s /var/lib/dpkg/info ${IMAGE_ROOTFS}${opkglibdir}/info
73 ln -s /var/dpkg/status ${IMAGE_ROOTFS}${opkglibdir}/status 73 ln -s /var/lib/dpkg/status ${IMAGE_ROOTFS}${opkglibdir}/status
74 74
75 ${ROOTFS_POSTPROCESS_COMMAND} 75 ${ROOTFS_POSTPROCESS_COMMAND}
76 76
diff --git a/meta/recipes-devtools/apt/apt-native_0.7.14.bb b/meta/recipes-devtools/apt/apt-native_0.7.14.bb
index b1bd55b2cf..c82d606ebe 100644
--- a/meta/recipes-devtools/apt/apt-native_0.7.14.bb
+++ b/meta/recipes-devtools/apt/apt-native_0.7.14.bb
@@ -1,6 +1,6 @@
1require apt-native.inc 1require apt-native.inc
2 2
3PR = "r4" 3PR = "r5"
4 4
5SRC_URI += "file://nodoc.patch \ 5SRC_URI += "file://nodoc.patch \
6 file://noconfigure.patch \ 6 file://noconfigure.patch \
diff --git a/meta/recipes-devtools/apt/apt_0.7.14.bb b/meta/recipes-devtools/apt/apt_0.7.14.bb
index 1335c16495..93eebe9502 100644
--- a/meta/recipes-devtools/apt/apt_0.7.14.bb
+++ b/meta/recipes-devtools/apt/apt_0.7.14.bb
@@ -3,7 +3,7 @@ RDEPENDS_${PN} = "dpkg"
3LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=0636e73ff0215e8d672dc4c32c317bb3" 3LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=0636e73ff0215e8d672dc4c32c317bb3"
4require apt.inc 4require apt.inc
5 5
6PR = "r7" 6PR = "r8"
7 7
8SRC_URI += "file://nodoc.patch \ 8SRC_URI += "file://nodoc.patch \
9 file://includes-fix.patch " 9 file://includes-fix.patch "
diff --git a/meta/recipes-devtools/apt/files/apt.conf b/meta/recipes-devtools/apt/files/apt.conf
index 5732137ccb..ab7a5db492 100644
--- a/meta/recipes-devtools/apt/files/apt.conf
+++ b/meta/recipes-devtools/apt/files/apt.conf
@@ -3,7 +3,7 @@ Dir "${STAGING_DIR_NATIVE}/"
3 State "var/lib/apt/" 3 State "var/lib/apt/"
4 { 4 {
5 Lists "lists/"; 5 Lists "lists/";
6 status "#ROOTFS#/var/dpkg/status"; 6 status "#ROOTFS#/var/lib/dpkg/status";
7 }; 7 };
8 Cache "var/cache/apt/" 8 Cache "var/cache/apt/"
9 { 9 {
@@ -39,5 +39,5 @@ APT
39 }; 39 };
40}; 40};
41 41
42DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/dpkg";"--force-all";"--no-debsig"}; 42DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-debsig"};
43}; 43};
diff --git a/meta/recipes-devtools/dpkg/run-postinsts/run-postinsts b/meta/recipes-devtools/dpkg/run-postinsts/run-postinsts
index f632d1c7d3..584a92ebfd 100755
--- a/meta/recipes-devtools/dpkg/run-postinsts/run-postinsts
+++ b/meta/recipes-devtools/dpkg/run-postinsts/run-postinsts
@@ -5,7 +5,7 @@
5# Author: Richard Purdie <rpurdie@openedhand.com> 5# Author: Richard Purdie <rpurdie@openedhand.com>
6# 6#
7 7
8PKGSYSTEM=/var/dpkg 8PKGSYSTEM=/var/lib/dpkg
9 9
10if [ ! -e $PKGSYSTEM/status ]; then 10if [ ! -e $PKGSYSTEM/status ]; then
11 if [ -e /usr/lib/opkg/status ]; then 11 if [ -e /usr/lib/opkg/status ]; then
diff --git a/meta/recipes-devtools/dpkg/run-postinsts/run-postinsts.awk b/meta/recipes-devtools/dpkg/run-postinsts/run-postinsts.awk
index 09a1400cf4..d92200b4f0 100644
--- a/meta/recipes-devtools/dpkg/run-postinsts/run-postinsts.awk
+++ b/meta/recipes-devtools/dpkg/run-postinsts/run-postinsts.awk
@@ -9,7 +9,7 @@
9BEGIN { 9BEGIN {
10 rc=system("test -d /usr/dpkg/info/") 10 rc=system("test -d /usr/dpkg/info/")
11 if (rc==0) 11 if (rc==0)
12 pkgdir="/var/dpkg/info" 12 pkgdir="/var/lib/dpkg/info"
13 else 13 else
14 pkgdir="/usr/lib/opkg/info" 14 pkgdir="/usr/lib/opkg/info"
15 package="" 15 package=""
diff --git a/meta/recipes-devtools/dpkg/run-postinsts_1.0.bb b/meta/recipes-devtools/dpkg/run-postinsts_1.0.bb
index f15243b60a..f8f3368729 100644
--- a/meta/recipes-devtools/dpkg/run-postinsts_1.0.bb
+++ b/meta/recipes-devtools/dpkg/run-postinsts_1.0.bb
@@ -1,6 +1,6 @@
1DESCRIPTION = "Run postinstall scripts on device using awk" 1DESCRIPTION = "Run postinstall scripts on device using awk"
2SECTION = "devel" 2SECTION = "devel"
3PR = "r6" 3PR = "r7"
4LICENSE = "MIT" 4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \ 5LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
6 file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" 6 file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
diff --git a/meta/recipes-devtools/update-alternatives/update-alternatives-dpkg.inc b/meta/recipes-devtools/update-alternatives/update-alternatives-dpkg.inc
index f7f9ae979d..c881ae0219 100644
--- a/meta/recipes-devtools/update-alternatives/update-alternatives-dpkg.inc
+++ b/meta/recipes-devtools/update-alternatives/update-alternatives-dpkg.inc
@@ -8,7 +8,7 @@ SECTION = "base"
8SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.bz2" 8SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.bz2"
9S = "${WORKDIR}/dpkg-${PV}" 9S = "${WORKDIR}/dpkg-${PV}"
10PACKAGE_ARCH = "all" 10PACKAGE_ARCH = "all"
11INC_PR = "r2" 11INC_PR = "r3"
12 12
13inherit gettext 13inherit gettext
14 14
@@ -20,7 +20,7 @@ do_patch () {
20 s/^.*$/$D=$ENV{"D"} || ""\;/; 20 s/^.*$/$D=$ENV{"D"} || ""\;/;
21 p; 21 p;
22 x; 22 x;
23 s,^\$admindir=.*staging.*$,$admindir="$D${localstatedir}/dpkg"\;,; 23 s,^\$admindir=.*staging.*$,$admindir="$D${localstatedir}/lib/dpkg"\;,;
24 }; 24 };
25 s,^\$altdir=.*$,$altdir="$D${sysconfdir}/alternatives"\;,; 25 s,^\$altdir=.*$,$altdir="$D${sysconfdir}/alternatives"\;,;
26 p;' > ${S}/scripts/update-alternatives 26 p;' > ${S}/scripts/update-alternatives
@@ -28,7 +28,7 @@ do_patch () {
28 28
29do_install () { 29do_install () {
30 install -d ${D}${sbindir} \ 30 install -d ${D}${sbindir} \
31 ${D}${localstatedir}/dpkg/alternatives \ 31 ${D}${localstatedir}/lib/dpkg/alternatives \
32 ${D}${sysconfdir}/alternatives 32 ${D}${sysconfdir}/alternatives
33 33
34 install -m 0755 scripts/update-alternatives ${D}${sbindir}/update-alternatives 34 install -m 0755 scripts/update-alternatives ${D}${sbindir}/update-alternatives