aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
blob: b3a883bae88b88a94bde130d68fb2b25c9af5104 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
From dfc1370d50322e2e9d225a7a63b44993fc01a727 Mon Sep 17 00:00:00 2001
From: Roy Li <rongqing.li@windriver.com>
Date: Fri, 22 May 2015 08:05:15 +0800
Subject: [PATCH] Revert "always run 'dpkg --configure -a' at the end of our
 dpkg callings"

Upstream-Status: Inappropriate [embedded specific]

This reverts commit a2a75ff4516f7609f4c55b42270abb8d08943c60, which
always run 'dpkg --configure -a' at the end of our dpkg callings,
but it does not work for cross-compile, since the rootfs dir can not
be passed into dpkg, and lead to the below similar error:
   -------
   |mkdir: cannot create directory '/usr/lib/opkg': Permission denied
   -------

Signed-off-by: Roy Li <rongqing.li@windriver.com>
---
 apt-pkg/deb/dpkgpm.cc                                     |  9 ++-------
 test/integration/test-apt-progress-fd-deb822              | 14 +++++++-------
 test/integration/test-no-fds-leaked-to-maintainer-scripts |  6 ++----
 3 files changed, 11 insertions(+), 18 deletions(-)

diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 834cb0e..84ded3a 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -1037,12 +1037,6 @@ void pkgDPkgPM::BuildPackagesProgressMap()
 	 PackagesTotal++;
       }
    }
-   /* one extra: We don't want the progress bar to reach 100%, especially not
-      if we call dpkg --configure --pending and process a bunch of triggers
-      while showing 100%. Also, spindown takes a while, so never reaching 100%
-      is way more correct than reaching 100% while still doing stuff even if
-      doing it this way is slightly bending the rules */
-   ++PackagesTotal;
 }
                                                                         /*}}}*/
 bool pkgDPkgPM::Go(int StatusFd)
@@ -1250,8 +1244,9 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress)
 
    // support subpressing of triggers processing for special
    // cases like d-i that runs the triggers handling manually
+   bool const SmartConf = (_config->Find("PackageManager::Configure", "all") != "all");
    bool const TriggersPending = _config->FindB("DPkg::TriggersPending", false);
-   if (_config->FindB("DPkg::ConfigurePending", true) == true)
+   if (_config->FindB("DPkg::ConfigurePending", SmartConf) == true)
       List.push_back(Item(Item::ConfigurePending, PkgIterator()));
 
    // for the progress
diff --git a/test/integration/test-apt-progress-fd-deb822 b/test/integration/test-apt-progress-fd-deb822
index 58fd732..3359762 100755
--- a/test/integration/test-apt-progress-fd-deb822
+++ b/test/integration/test-apt-progress-fd-deb822
@@ -27,36 +27,36 @@ Message: Installing testing (amd64)
 
 Status: progress
 Package: testing:amd64
-Percent: 16.6667
+Percent: 20
 Message: Preparing testing (amd64)
 
 Status: progress
 Package: testing:amd64
-Percent: 33.3333
+Percent: 40
 Message: Unpacking testing (amd64)
 
 Status: progress
 Package: testing:amd64
-Percent: 50
+Percent: 60
 Message: Preparing to configure testing (amd64)
 
 Status: progress
-Percent: 50
+Percent: 60
 Message: Running dpkg
 
 Status: progress
 Package: testing:amd64
-Percent: 50
+Percent: 60
 Message: Configuring testing (amd64)
 
 Status: progress
 Package: testing:amd64
-Percent: 66.6667
+Percent: 80
 Message: Configuring testing (amd64)
 
 Status: progress
 Package: testing:amd64
-Percent: 83.3333
+Percent: 100
 Message: Installed testing (amd64)
 
 Status: progress
diff --git a/test/integration/test-no-fds-leaked-to-maintainer-scripts b/test/integration/test-no-fds-leaked-to-maintainer-scripts
index d86e638..ef6d23b 100755
--- a/test/integration/test-no-fds-leaked-to-maintainer-scripts
+++ b/test/integration/test-no-fds-leaked-to-maintainer-scripts
@@ -59,8 +59,7 @@ startup packages configure
 configure $PKGNAME 1.0 <none>
 status unpacked $PKGNAME 1.0
 status half-configured $PKGNAME 1.0
-status installed $PKGNAME 1.0
-startup packages configure" cut -f 3- -d' ' rootdir/var/log/dpkg.log
+status installed $PKGNAME 1.0" cut -f 3- -d' ' rootdir/var/log/dpkg.log
 }
 checkinstall
 
@@ -85,8 +84,7 @@ status config-files $PKGNAME 1.0
 status config-files $PKGNAME 1.0
 status config-files $PKGNAME 1.0
 status config-files $PKGNAME 1.0
-status not-installed $PKGNAME <none>
-startup packages configure" cut -f 3- -d' ' rootdir/var/log/dpkg.log
+status not-installed $PKGNAME <none>" cut -f 3- -d' ' rootdir/var/log/dpkg.log
 }
 checkpurge
 
-- 
2.1.4