1*4882a593SmuzhiyunFrom 47c2b42af60ceefd8ed52b32a3a365facf0e05b8 Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: Alexander Kanavin <alex.kanavin@gmail.com>
3*4882a593SmuzhiyunDate: Thu, 21 May 2020 20:13:25 +0000
4*4882a593SmuzhiyunSubject: [PATCH] Revert "always run 'dpkg --configure -a' at the end of our
5*4882a593Smuzhiyun dpkg callings"
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunThis reverts commit a2a75ff4516f7609f4c55b42270abb8d08943c60, which
8*4882a593Smuzhiyunalways run 'dpkg --configure -a' at the end of our dpkg callings,
9*4882a593Smuzhiyunbut it does not work for cross-compile, since the rootfs dir can not
10*4882a593Smuzhiyunbe passed into dpkg, and lead to the below similar error:
11*4882a593Smuzhiyun   -------
12*4882a593Smuzhiyun   |mkdir: cannot create directory '/usr/lib/opkg': Permission denied
13*4882a593Smuzhiyun   -------
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunUpstream-Status: Inappropriate [embedded specific]
16*4882a593SmuzhiyunSigned-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun---
19*4882a593Smuzhiyun apt-pkg/deb/dpkgpm.cc | 9 ++-------
20*4882a593Smuzhiyun 1 file changed, 2 insertions(+), 7 deletions(-)
21*4882a593Smuzhiyun
22*4882a593Smuzhiyundiff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
23*4882a593Smuzhiyunindex 93effa9..4375781 100644
24*4882a593Smuzhiyun--- a/apt-pkg/deb/dpkgpm.cc
25*4882a593Smuzhiyun+++ b/apt-pkg/deb/dpkgpm.cc
26*4882a593Smuzhiyun@@ -1199,12 +1199,6 @@ void pkgDPkgPM::BuildPackagesProgressMap()
27*4882a593Smuzhiyun 	 }
28*4882a593Smuzhiyun       }
29*4882a593Smuzhiyun    }
30*4882a593Smuzhiyun-   /* one extra: We don't want the progress bar to reach 100%, especially not
31*4882a593Smuzhiyun-      if we call dpkg --configure --pending and process a bunch of triggers
32*4882a593Smuzhiyun-      while showing 100%. Also, spindown takes a while, so never reaching 100%
33*4882a593Smuzhiyun-      is way more correct than reaching 100% while still doing stuff even if
34*4882a593Smuzhiyun-      doing it this way is slightly bending the rules */
35*4882a593Smuzhiyun-   ++PackagesTotal;
36*4882a593Smuzhiyun }
37*4882a593Smuzhiyun                                                                         /*}}}*/
38*4882a593Smuzhiyun void pkgDPkgPM::StartPtyMagic()						/*{{{*/
39*4882a593Smuzhiyun@@ -1741,7 +1735,8 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress)
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun       // support subpressing of triggers processing for special
42*4882a593Smuzhiyun       // cases like d-i that runs the triggers handling manually
43*4882a593Smuzhiyun-      if (_config->FindB("DPkg::ConfigurePending", true))
44*4882a593Smuzhiyun+      bool const SmartConf = (_config->Find("PackageManager::Configure", "all") != "all");
45*4882a593Smuzhiyun+      if (0)
46*4882a593Smuzhiyun 	 List.emplace_back(Item::ConfigurePending, pkgCache::PkgIterator());
47*4882a593Smuzhiyun    }
48*4882a593Smuzhiyun    bool const TriggersPending = _config->FindB("DPkg::TriggersPending", false);
49