From 45169762beb0969855bb8d9ff3fc940287da10d1 Mon Sep 17 00:00:00 2001 From: Ilyas Gasanov Date: Sun, 14 Apr 2019 00:07:27 +0300 Subject: 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. --- baiji | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3