aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlyas Gasanov <torso.nafi@gmail.com>2019-04-14 00:07:27 +0300
committerRob Austein <sra@hactrn.net>2019-04-15 16:47:00 +0000
commit45169762beb0969855bb8d9ff3fc940287da10d1 (patch)
tree68ef9d51ffb765b6a2fe428333e7c7cf402a3c56
parent04f55c9042b4e09ec1914bf1923d5181ef5b2514 (diff)
Custom mirror and components for baiji create.
This assumes that debootstrap treats empty string in the mirror argument as no mirror argument being passed at all. We can be safe as long as the runtime environment of debootstrap (i.e. the shell command language interpreter) does not distinguish between the two cases outlined above.
-rwxr-xr-xbaiji8
1 files changed, 7 insertions, 1 deletions
diff --git a/baiji b/baiji
index c493e03..3ab1556 100755
--- a/baiji
+++ b/baiji
@@ -93,6 +93,10 @@ def fakeroot_filter(info):
help = "distribution for base docker image"),
arg("--tag", default = "baiji:jessie",
help = "tag to use for constructed base docker image"),
+ arg("--mirror", default = "",
+ help = "mirror URL to pull packages from"),
+ arg("--components", default = ["main"], nargs = "+",
+ help = "repository components to use"),
)
def create(args):
"""
@@ -104,7 +108,9 @@ def create(args):
with tempdir() as dn:
subprocess.check_call(("fakeroot", "/usr/sbin/debootstrap",
- "--foreign", "--variant=buildd", args.dist, dn))
+ "--foreign", "--variant=buildd",
+ "--components={}".format(",".join(args.components)),
+ args.dist, dn, args.mirror))
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)