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