bin/chroot-maint: Add missing format argument to diagnostic.
[distorted-chroot] / bin / chroot-maint
index 9d2d366..ba51ec5 100755 (executable)
@@ -2051,8 +2051,9 @@ class ChrootJob (BaseJob):
         run_root(["mv", new, real])
       for path in have_link.iterkeys():
         if path in want_link: continue
-        progress("remove obsolete link `%s' -> `%s'" % path)
         real = root + path
+        progress("remove obsolete link `%s' -> `%s'" %
+                 (path, OS.readlink(real)))
         run_root(["rm", "-f", real])
 
       ## Remove diversions from paths which don't need them any more.  Here
@@ -2116,7 +2117,7 @@ class ChrootJob (BaseJob):
 
         ## Install the base system.
         progress("install base system")
-        run_root(["eatmydata", "debootstrap"] +
+        run_root(["eatmydata", "debootstrap", "--no-merged-usr"] +
                  (arch in C.FOREIGN_ARCHS and ["--foreign"] or []) +
                  ["--arch=" + arch, "--variant=minbase",
                   "--include=" + ",".join(C.BASE_PACKAGES),
@@ -2156,12 +2157,12 @@ class ChrootJob (BaseJob):
         with safewrite_root\
              (OS.path.join(mnt, "fs/etc/apt/apt.conf.d/20arch")) as f:
           f.write("""\
-  ### -*-conf-*-
+### -*-conf-*-
 
-  APT {
-          Architecture "%s";
-  };
-  """ % arch)
+APT {
+       Architecture "%s";
+};
+""" % arch)
 
         ## Set up the locale and time zone from the host system.
         progress("configure locales and timezone")
@@ -2184,10 +2185,10 @@ class ChrootJob (BaseJob):
         with safewrite_root(OS.path.join(mnt, "fs/usr/sbin/policy-rc.d"),
                             mode = "755") as f:
           f.write("""\
-  #! /bin/sh
-  echo >&2 "policy-rc.d: Services disabled by policy."
-  exit 101
-  """)
+#! /bin/sh
+echo >&2 "policy-rc.d: Services disabled by policy."
+exit 101
+""")
 
         ## Hack the dynamic linker to prefer libraries in `/usr' over
         ## `/usr/local'.  This prevents `dpkg-shlibdeps' from becoming
@@ -2199,10 +2200,10 @@ class ChrootJob (BaseJob):
         with safewrite_root\
              (OS.path.join(mnt, "fs/etc/ld.so.conf.d/zzz-local.conf")) as f:
           f.write("""\
-  ### -*-conf-*-
-  ### Local hack to make /usr/local/ late.
-  /usr/local/lib
-  """)
+### -*-conf-*-
+### Local hack to make /usr/local/ late.
+/usr/local/lib
+""")
 
       ## If this is a foreign architecture then we need to set it up.
       if arch in C.FOREIGN_ARCHS:
@@ -2253,6 +2254,7 @@ class ChrootJob (BaseJob):
         apt-get -y dist-upgrade
         apt-get -y autoremove
         apt-get -y clean
+        ldconfig
       """], stdin = DISCARD)
       if arch in C.FOREIGN_ARCHS: me._install_cross_tools()
       me._meta.update = zulu(); me._meta.write()
@@ -2375,7 +2377,7 @@ class CrossToolsJob (BaseJob):
               try: dest = dest[:dest.rindex("/")]
               except ValueError: dest = ""
             if path == "": path = link
-            else: path = "%s/%s" % (path, link)
+            else: path = "%s/%s" % (link, path)
 
       ## Work through the shopping list, copying the things it names into the
       ## cross-tools tree.
@@ -2668,6 +2670,11 @@ class PackageBuildJob (BaseJob):
       run_schroot_session(session,
                           ["mount", "-oremount,rw", "/usr/local.schroot"],
                           rootp = True, stdin = DISCARD)
+      run_schroot_session(session,
+                          ["mount", "--bind",
+                           "/usr/local.schroot/%s/include.aside" % arch,
+                           "/usr/local.schroot/%s/include" % arch],
+                          rootp = True, stdin = DISCARD)
 
       progress("configure `%s' %s for %s" % (pkg, ver, arch))
       run_schroot_session(session, ["sh", "-e", "-c", """