diff options
author | Ilyas Gasanov <torso.nafi@gmail.com> | 2019-04-14 00:09:10 +0300 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2019-04-15 16:47:00 +0000 |
commit | d426e504aa674de613c3cd21e106d0dcec2d77b4 (patch) | |
tree | 4c5fe877c980d38dfca2edcbb4b5dc3f3cd6de9b | |
parent | 45169762beb0969855bb8d9ff3fc940287da10d1 (diff) |
Support extra sources.list and gpg keyring files.
-rwxr-xr-x | baiji | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -97,6 +97,10 @@ def fakeroot_filter(info): help = "mirror URL to pull packages from"), arg("--components", default = ["main"], nargs = "+", help = "repository components to use"), + arg("--lists", nargs = "+", + help = "additional files with sources.list entries"), + arg("--keyrings", nargs = "+", + help = "additional gpg keyring files"), ) def create(args): """ @@ -111,6 +115,13 @@ def create(args): "--foreign", "--variant=buildd", "--components={}".format(",".join(args.components)), args.dist, dn, args.mirror)) + for files, aptdir in ((args.lists, "sources.list.d"), + (args.keyrings, "trusted.gpg.d")): + if files is not None: + d = os.path.join(dn, "etc", "apt", aptdir) + os.makedirs(d) + for f in files: + shutil.copy(f, d) with Docker("import", "-", args.tag, stdin = subprocess.PIPE) as docker: with tarfile.open(mode = "w|", fileobj = docker.stdin) as tar: tar.add(dn, ".", filter = fakeroot_filter) |