Browse Source

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.
Ilyas Gasanov 6 năm trước cách đây
mục cha
commit
45169762be
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 7 1
      baiji

+ 7 - 1
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)