summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/apt/apt-1.0.9.9/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
diff options
context:
space:
mode:
authorRoy Li <rongqing.li@windriver.com>2015-05-27 15:58:49 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-29 10:17:15 +0100
commit2efd475a98602758c98290263d17a8ac55d32a39 (patch)
treea3f825d1e1024afa8631c0ce2a7142a7fcc687bd /meta/recipes-devtools/apt/apt-1.0.9.9/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
parent320d766fe405c686b5339897f6f5a1baaed4c61d (diff)
downloadpoky-2efd475a98602758c98290263d17a8ac55d32a39.tar.gz
apt: upgrade to 1.0.9.9
1. Upgrade to fix the several CVEs: CVE-2014-0488, CVE-2014-0490 2. Remove apt-0.9.9.4-CVE-2014-0478.patch, which was backport. 3. Romve no-ko-translation.patch, apt-1.0.9.9 has ko translation 4. Update use-host.patch no-curl.patch db_linking_hack.patch and noconfigure.patch 5. Not build the test cases since it requires gtest 6. install libapt-private.so.* to libdir, otherwise this file is not installed into sysroot for native, and apt-get will use host's, and lead to fail 7. Revert apt commit[a2a75ff45]"always run 'dpkg --configure -a' at the end of our dpkg callings" for native package, otherwise the postscript for these installed packages will be run, and fail since the rootfs dir is not considered 8. Add lzma dependency by PACKAGECONFIG for target, and add xz dependency for native 9. Support to compile apt-native on centos6 (From OE-Core rev: 7dd4a53a99277b46696dea5558fa321a2267af0a) Signed-off-by: Roy Li <rongqing.li@windriver.com> Acked-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/apt/apt-1.0.9.9/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch')
-rw-r--r--meta/recipes-devtools/apt/apt-1.0.9.9/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch378
1 files changed, 378 insertions, 0 deletions
diff --git a/meta/recipes-devtools/apt/apt-1.0.9.9/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch b/meta/recipes-devtools/apt/apt-1.0.9.9/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
new file mode 100644
index 0000000000..d33069b73a
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt-1.0.9.9/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
@@ -0,0 +1,378 @@
1From 106797f1c66fa578dad21fd9380bf9d576573dfd Mon Sep 17 00:00:00 2001
2From: Roy Li <rongqing.li@windriver.com>
3Date: Fri, 22 May 2015 08:05:15 +0800
4Subject: [PATCH] Revert "always run 'dpkg --configure -a' at the end of our
5 dpkg callings"
6
7Upstream-Status: Inappropriate [embedded specific]
8
9This reverts commit a2a75ff4516f7609f4c55b42270abb8d08943c60, which
10always run 'dpkg --configure -a' at the end of our dpkg callings,
11but it does not work for cross-compile, since the rootfs dir can not
12be passed into dpkg, and lead to the below similar error:
13 -------
14 |mkdir: cannot create directory '/usr/lib/opkg': Permission denied
15 -------
16
17Signed-off-by: Roy Li <rongqing.li@windriver.com>
18---
19 apt-pkg/deb/dpkgpm.cc | 9 +--
20 test/integration/framework | 25 ++++----
21 test/integration/test-apt-progress-fd | 67 +++++++++----------
22 test/integration/test-apt-progress-fd-deb822 | 18 ++----
23 test/integration/test-apt-progress-fd-error | 2 +-
24 ...est-bug-769609-triggers-still-pending-after-run | 75 ----------------------
25 .../test-no-fds-leaked-to-maintainer-scripts | 6 +-
26 7 files changed, 56 insertions(+), 146 deletions(-)
27 delete mode 100755 test/integration/test-bug-769609-triggers-still-pending-after-run
28
29diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
30index b187efb..f269764 100644
31--- a/apt-pkg/deb/dpkgpm.cc
32+++ b/apt-pkg/deb/dpkgpm.cc
33@@ -1049,12 +1049,6 @@ void pkgDPkgPM::BuildPackagesProgressMap()
34 PackagesTotal++;
35 }
36 }
37- /* one extra: We don't want the progress bar to reach 100%, especially not
38- if we call dpkg --configure --pending and process a bunch of triggers
39- while showing 100%. Also, spindown takes a while, so never reaching 100%
40- is way more correct than reaching 100% while still doing stuff even if
41- doing it this way is slightly bending the rules */
42- ++PackagesTotal;
43 }
44 /*}}}*/
45 #if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR < 13)
46@@ -1294,8 +1288,9 @@ bool pkgDPkgPM::GoNoABIBreak(APT::Progress::PackageManager *progress)
47
48 // support subpressing of triggers processing for special
49 // cases like d-i that runs the triggers handling manually
50+ bool const SmartConf = (_config->Find("PackageManager::Configure", "all") != "all");
51 bool const TriggersPending = _config->FindB("DPkg::TriggersPending", false);
52- if (_config->FindB("DPkg::ConfigurePending", true) == true)
53+ if (_config->FindB("DPkg::ConfigurePending", SmartConf) == true)
54 List.push_back(Item(Item::ConfigurePending, PkgIterator()));
55
56 // for the progress
57diff --git a/test/integration/framework b/test/integration/framework
58index 70ad381..00672ad 100644
59--- a/test/integration/framework
60+++ b/test/integration/framework
61@@ -1178,13 +1178,10 @@ testnopackage() {
62 fi
63 }
64
65-testdpkgstatus() {
66- local STATE="$1"
67- local NR="$2"
68- shift 2
69- msgtest "Test that $NR package(s) are in state $STATE with" "dpkg -l $*"
70- local PKGS="$(dpkg -l "$@" 2>/dev/null | grep "^${STATE}" | wc -l)"
71- if [ "$PKGS" != $NR ]; then
72+testdpkginstalled() {
73+ msgtest "Test for correctly installed package(s) with" "dpkg -l $*"
74+ local PKGS="$(dpkg -l "$@" 2>/dev/null | grep '^i' | wc -l)"
75+ if [ "$PKGS" != $# ]; then
76 echo >&2 $PKGS
77 dpkg -l "$@" | grep '^[a-z]' >&2
78 msgfail
79@@ -1193,12 +1190,16 @@ testdpkgstatus() {
80 fi
81 }
82
83-testdpkginstalled() {
84- testdpkgstatus 'ii' "$#" "$@"
85-}
86-
87 testdpkgnotinstalled() {
88- testdpkgstatus 'ii' '0' "$@"
89+ msgtest "Test for correctly not-installed package(s) with" "dpkg -l $*"
90+ local PKGS="$(dpkg -l "$@" 2> /dev/null | grep '^i' | wc -l)"
91+ if [ "$PKGS" != 0 ]; then
92+ echo
93+ dpkg -l "$@" | grep '^[a-z]' >&2
94+ msgfail
95+ else
96+ msgpass
97+ fi
98 }
99
100 testmarkedauto() {
101diff --git a/test/integration/test-apt-progress-fd b/test/integration/test-apt-progress-fd
102index 68cc043..d72e7e7 100755
103--- a/test/integration/test-apt-progress-fd
104+++ b/test/integration/test-apt-progress-fd
105@@ -19,14 +19,13 @@ testequal "dlstatus:1:0:Retrieving file 1 of 1
106 dlstatus:1:0:Retrieving file 1 of 1
107 pmstatus:dpkg-exec:0:Running dpkg
108 pmstatus:testing:0:Installing testing (amd64)
109-pmstatus:testing:16.6667:Preparing testing (amd64)
110-pmstatus:testing:33.3333:Unpacking testing (amd64)
111-pmstatus:testing:50:Preparing to configure testing (amd64)
112-pmstatus:dpkg-exec:50:Running dpkg
113-pmstatus:testing:50:Configuring testing (amd64)
114-pmstatus:testing:66.6667:Configuring testing (amd64)
115-pmstatus:testing:83.3333:Installed testing (amd64)
116-pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
117+pmstatus:testing:20:Preparing testing (amd64)
118+pmstatus:testing:40:Unpacking testing (amd64)
119+pmstatus:testing:60:Preparing to configure testing (amd64)
120+pmstatus:dpkg-exec:60:Running dpkg
121+pmstatus:testing:60:Configuring testing (amd64)
122+pmstatus:testing:80:Configuring testing (amd64)
123+pmstatus:testing:100:Installed testing (amd64)" cat apt-progress.log
124
125 # upgrade
126 exec 3> apt-progress.log
127@@ -35,14 +34,13 @@ testequal "dlstatus:1:0:Retrieving file 1 of 1
128 dlstatus:1:0:Retrieving file 1 of 1
129 pmstatus:dpkg-exec:0:Running dpkg
130 pmstatus:testing:0:Installing testing (amd64)
131-pmstatus:testing:16.6667:Preparing testing (amd64)
132-pmstatus:testing:33.3333:Unpacking testing (amd64)
133-pmstatus:testing:50:Preparing to configure testing (amd64)
134-pmstatus:dpkg-exec:50:Running dpkg
135-pmstatus:testing:50:Configuring testing (amd64)
136-pmstatus:testing:66.6667:Configuring testing (amd64)
137-pmstatus:testing:83.3333:Installed testing (amd64)
138-pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
139+pmstatus:testing:20:Preparing testing (amd64)
140+pmstatus:testing:40:Unpacking testing (amd64)
141+pmstatus:testing:60:Preparing to configure testing (amd64)
142+pmstatus:dpkg-exec:60:Running dpkg
143+pmstatus:testing:60:Configuring testing (amd64)
144+pmstatus:testing:80:Configuring testing (amd64)
145+pmstatus:testing:100:Installed testing (amd64)" cat apt-progress.log
146
147 # reinstall
148 exec 3> apt-progress.log
149@@ -51,24 +49,22 @@ testequal "dlstatus:1:0:Retrieving file 1 of 1
150 dlstatus:1:0:Retrieving file 1 of 1
151 pmstatus:dpkg-exec:0:Running dpkg
152 pmstatus:testing:0:Installing testing (amd64)
153-pmstatus:testing:16.6667:Preparing testing (amd64)
154-pmstatus:testing:33.3333:Unpacking testing (amd64)
155-pmstatus:testing:50:Preparing to configure testing (amd64)
156-pmstatus:dpkg-exec:50:Running dpkg
157-pmstatus:testing:50:Configuring testing (amd64)
158-pmstatus:testing:66.6667:Configuring testing (amd64)
159-pmstatus:testing:83.3333:Installed testing (amd64)
160-pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
161+pmstatus:testing:20:Preparing testing (amd64)
162+pmstatus:testing:40:Unpacking testing (amd64)
163+pmstatus:testing:60:Preparing to configure testing (amd64)
164+pmstatus:dpkg-exec:60:Running dpkg
165+pmstatus:testing:60:Configuring testing (amd64)
166+pmstatus:testing:80:Configuring testing (amd64)
167+pmstatus:testing:100:Installed testing (amd64)" cat apt-progress.log
168
169 # and remove
170 exec 3> apt-progress.log
171 testsuccess aptget remove testing -y -o APT::Status-Fd=3
172 testequal "pmstatus:dpkg-exec:0:Running dpkg
173 pmstatus:testing:0:Removing testing (amd64)
174-pmstatus:testing:25:Preparing for removal of testing (amd64)
175-pmstatus:testing:50:Removing testing (amd64)
176-pmstatus:testing:75:Removed testing (amd64)
177-pmstatus:dpkg-exec:75:Running dpkg" cat apt-progress.log
178+pmstatus:testing:33.3333:Preparing for removal of testing (amd64)
179+pmstatus:testing:66.6667:Removing testing (amd64)
180+pmstatus:testing:100:Removed testing (amd64)" cat apt-progress.log
181
182 # install non-native and ensure we get proper progress info
183 exec 3> apt-progress.log
184@@ -79,13 +75,12 @@ testequal "dlstatus:1:0:Retrieving file 1 of 1
185 dlstatus:1:0:Retrieving file 1 of 1
186 pmstatus:dpkg-exec:0:Running dpkg
187 pmstatus:testing2:0:Installing testing2 (i386)
188-pmstatus:testing2:16.6667:Preparing testing2 (i386)
189-pmstatus:testing2:33.3333:Unpacking testing2 (i386)
190-pmstatus:testing2:50:Preparing to configure testing2 (i386)
191-pmstatus:dpkg-exec:50:Running dpkg
192-pmstatus:testing2:50:Configuring testing2 (i386)
193-pmstatus:testing2:66.6667:Configuring testing2 (i386)
194-pmstatus:testing2:83.3333:Installed testing2 (i386)
195-pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
196+pmstatus:testing2:20:Preparing testing2 (i386)
197+pmstatus:testing2:40:Unpacking testing2 (i386)
198+pmstatus:testing2:60:Preparing to configure testing2 (i386)
199+pmstatus:dpkg-exec:60:Running dpkg
200+pmstatus:testing2:60:Configuring testing2 (i386)
201+pmstatus:testing2:80:Configuring testing2 (i386)
202+pmstatus:testing2:100:Installed testing2 (i386)" cat apt-progress.log
203
204 rm -f apt-progress*.log
205diff --git a/test/integration/test-apt-progress-fd-deb822 b/test/integration/test-apt-progress-fd-deb822
206index badc985..9d22794 100755
207--- a/test/integration/test-apt-progress-fd-deb822
208+++ b/test/integration/test-apt-progress-fd-deb822
209@@ -27,41 +27,37 @@ Message: Installing testing (amd64)
210
211 Status: progress
212 Package: testing:amd64
213-Percent: 16.6667
214+Percent: 20
215 Message: Preparing testing (amd64)
216
217 Status: progress
218 Package: testing:amd64
219-Percent: 33.3333
220+Percent: 40
221 Message: Unpacking testing (amd64)
222
223 Status: progress
224 Package: testing:amd64
225-Percent: 50
226+Percent: 60
227 Message: Preparing to configure testing (amd64)
228
229 Status: progress
230-Percent: 50
231+Percent: 60
232 Message: Running dpkg
233
234 Status: progress
235 Package: testing:amd64
236-Percent: 50
237+Percent: 60
238 Message: Configuring testing (amd64)
239
240 Status: progress
241 Package: testing:amd64
242-Percent: 66.6667
243+Percent: 80
244 Message: Configuring testing (amd64)
245
246 Status: progress
247 Package: testing:amd64
248-Percent: 83.3333
249+Percent: 100
250 Message: Installed testing (amd64)
251-
252-Status: progress
253-Percent: 83.3333
254-Message: Running dpkg
255 " cat apt-progress.log
256
257
258diff --git a/test/integration/test-apt-progress-fd-error b/test/integration/test-apt-progress-fd-error
259index 6323007..a47095b 100755
260--- a/test/integration/test-apt-progress-fd-error
261+++ b/test/integration/test-apt-progress-fd-error
262@@ -18,7 +18,7 @@ setupaptarchive
263 exec 3> apt-progress.log
264 testfailure aptget install foo1 foo2 -y -o APT::Status-Fd=3
265 msgtest "Ensure correct error message"
266-if grep -q "aptarchive/pool/foo2_0.8.15_amd64.deb:36.3636:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1 0.8.15" apt-progress.log; then
267+if grep -q "aptarchive/pool/foo2_0.8.15_amd64.deb:40:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1 0.8.15" apt-progress.log; then
268 msgpass
269 else
270 cat apt-progress.log
271diff --git a/test/integration/test-bug-769609-triggers-still-pending-after-run b/test/integration/test-bug-769609-triggers-still-pending-after-run
272deleted file mode 100755
273index 146fa76..0000000
274--- a/test/integration/test-bug-769609-triggers-still-pending-after-run
275+++ /dev/null
276@@ -1,75 +0,0 @@
277-#!/bin/sh
278-set -e
279-
280-TESTDIR=$(readlink -f $(dirname $0))
281-. $TESTDIR/framework
282-
283-setupenvironment
284-configarchitecture 'amd64'
285-
286-msgtest 'Check if installed dpkg supports' 'noawait trigger'
287-if dpkg-checkbuilddeps -d 'dpkg (>= 1.16.1)' /dev/null; then
288- msgpass
289-else
290- msgskip 'dpkg version too old'
291- exit 0
292-fi
293-configdpkgnoopchroot
294-
295-buildtriggerpackages() {
296- local TYPE="$1"
297- setupsimplenativepackage "triggerable-$TYPE" 'all' '1.0' 'unstable' "Depends: trigdepends-$TYPE"
298- BUILDDIR="incoming/triggerable-${TYPE}-1.0"
299- cat >${BUILDDIR}/debian/postinst <<EOF
300-#!/bin/sh
301-if [ "\$1" = 'triggered' ]; then
302- ls -l /proc/self/fd/
303-fi
304-EOF
305- echo "$TYPE /usr/share/doc" > ${BUILDDIR}/debian/triggers
306- buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
307- rm -rf "$BUILDDIR"
308- buildsimplenativepackage "trigdepends-$TYPE" 'all' '1.0' 'unstable'
309-}
310-
311-#buildtriggerpackages 'interest'
312-buildtriggerpackages 'interest-noawait'
313-buildsimplenativepackage "trigstuff" 'all' '1.0' 'unstable'
314-
315-setupaptarchive
316-
317-runtests() {
318- local TYPE="$1"
319- msgmsg 'Working with trigger type' "$TYPE"
320- testsuccess aptget install triggerable-$TYPE -y
321- cp rootdir/tmp/testsuccess.output terminal.output
322- testsuccess grep '^REWRITE ' terminal.output
323- testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
324-
325- testsuccess aptget install trigdepends-$TYPE -y --reinstall
326- cp rootdir/tmp/testsuccess.output terminal.output
327- testsuccess grep '^REWRITE ' terminal.output
328- testsuccess grep ' root root ' terminal.output
329- testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
330-
331- testsuccess aptget install trigstuff -y
332- cp rootdir/tmp/testsuccess.output terminal.output
333- testsuccess grep '^REWRITE ' terminal.output
334- testsuccess grep ' root root ' terminal.output
335- testdpkginstalled triggerable-$TYPE trigdepends-$TYPE trigstuff
336-
337- testsuccess aptget purge trigstuff -y
338- cp rootdir/tmp/testsuccess.output terminal.output
339- testsuccess grep '^REWRITE ' terminal.output
340- testsuccess grep ' root root ' terminal.output
341- testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
342- testdpkgnotinstalled trigstuff
343-
344- testsuccess aptget purge trigdepends-$TYPE -y
345- cp rootdir/tmp/testsuccess.output terminal.output
346- testfailure grep '^REWRITE ' terminal.output
347- testfailure grep ' root root ' terminal.output
348- testdpkgnotinstalled triggerable-$TYPE trigdepends-$TYPE
349-}
350-#runtests 'interest'
351-runtests 'interest-noawait'
352diff --git a/test/integration/test-no-fds-leaked-to-maintainer-scripts b/test/integration/test-no-fds-leaked-to-maintainer-scripts
353index 41c0570..d3960d7 100755
354--- a/test/integration/test-no-fds-leaked-to-maintainer-scripts
355+++ b/test/integration/test-no-fds-leaked-to-maintainer-scripts
356@@ -59,8 +59,7 @@ startup packages configure
357 configure $PKGNAME 1.0 <none>
358 status unpacked $PKGNAME 1.0
359 status half-configured $PKGNAME 1.0
360-status installed $PKGNAME 1.0
361-startup packages configure" cut -f 3- -d' ' rootdir/var/log/dpkg.log
362+status installed $PKGNAME 1.0" cut -f 3- -d' ' rootdir/var/log/dpkg.log
363 }
364 checkinstall
365
366@@ -85,8 +84,7 @@ status config-files $PKGNAME 1.0
367 status config-files $PKGNAME 1.0
368 status config-files $PKGNAME 1.0
369 status config-files $PKGNAME 1.0
370-status not-installed $PKGNAME <none>
371-startup packages configure" cut -f 3- -d' ' rootdir/var/log/dpkg.log
372+status not-installed $PKGNAME <none>" cut -f 3- -d' ' rootdir/var/log/dpkg.log
373 }
374 checkpurge
375
376--
3772.1.4
378