[elbe-devel] [PATCH v2 1/4] virtapt: introduce noauth parameter

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


noauth is used in the elbe context to be able to use unsigned repositories.
the allowinsecurerepositories option is also set, to be able to use repos
that are signed with an unknown key.

defaults to false, to have the same behaviour than without the patch.

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

diff --git a/elbepack/virtapt.py b/elbepack/virtapt.py
index fd3149ba..7f03d767 100644
--- a/elbepack/virtapt.py
+++ b/elbepack/virtapt.py
@@ -56,7 +56,7 @@ def lookup_uri(v, d, target_pkg):
 
 
 class VirtApt:
-    def __init__(self, arch, suite, sources, prefs, keylist=[]):
+    def __init__(self, arch, suite, sources, prefs, keylist=[], noauth=False):
 
         self.projectpath = mkdtemp()
         self.initialize_dirs()
@@ -80,7 +80,12 @@ class VirtApt:
         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("APT::Get::AllowUnauthenticated", "0")
+        if noauth:
+            apt_pkg.config.set("APT::Get::AllowUnauthenticated", "1")
+            apt_pkg.config.set("Acquire::AllowInsecureRepositories", "1")
+        else:
+            apt_pkg.config.set("APT::Get::AllowUnauthenticated", "0")
+            apt_pkg.config.set("Acquire::AllowInsecureRepositories", "0")
 
         apt_pkg.init_system()
 
-- 
2.18.0




More information about the elbe-devel mailing list