[elbe-devel] [PATCH v2 2/4] virtapt: fix apt paths

Manuel Traut manut at linutronix.de
Mon Aug 13 09:51:03 CEST 2018


using Dir to set the basepath and than work with relative paths doesn't
work. So always set the full-path to avoid using hosts apt config.

Signed-off-by: Manuel Traut <manut at linutronix.de>
---
 elbepack/virtapt.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/elbepack/virtapt.py b/elbepack/virtapt.py
index 7f03d767..ded50586 100644
--- a/elbepack/virtapt.py
+++ b/elbepack/virtapt.py
@@ -71,15 +71,16 @@ class VirtApt:
         apt_pkg.config.set("APT::Architectures", arch)
         apt_pkg.config.set("Acquire::http::Proxy::127.0.0.1", "DIRECT")
         apt_pkg.config.set("APT::Install-Recommends", "0")
-        apt_pkg.config.set("Dir", self.projectpath)
+        apt_pkg.config.set("Dir::Etc", os.path.join(self.projectpath, "etc"))
         apt_pkg.config.set("APT::Cache-Limit", "0")
         apt_pkg.config.set("APT::Cache-Start", "32505856")
         apt_pkg.config.set("APT::Cache-Grow", "2097152")
-        apt_pkg.config.set("Dir::State", "state")
-        apt_pkg.config.set("Dir::State::status", "status")
-        apt_pkg.config.set("Dir::Cache", "cache")
-        apt_pkg.config.set("Dir::Etc", "etc/apt")
-        apt_pkg.config.set("Dir::Log", "log")
+        apt_pkg.config.set("Dir::State", os.path.join(self.projectpath, "state"))
+        apt_pkg.config.set("Dir::State::status", os.path.join(self.projectpath, "state/status"))
+        apt_pkg.config.set("Dir::Cache", os.path.join(self.projectpath, "cache"))
+        apt_pkg.config.set("Dir::Cache::archives", os.path.join(self.projectpath, "cache/archives"))
+        apt_pkg.config.set("Dir::Etc", os.path.join(self.projectpath, "etc/apt"))
+        apt_pkg.config.set("Dir::Log", os.path.join(self.projectpath, "log"))
         if noauth:
             apt_pkg.config.set("APT::Get::AllowUnauthenticated", "1")
             apt_pkg.config.set("Acquire::AllowInsecureRepositories", "1")
-- 
2.18.0




More information about the elbe-devel mailing list