chiark / gitweb /
Merge branch 'master' into deploy.crybaby
authorMark Wooding <mdw@distorted.org.uk>
Sat, 9 May 2020 16:09:19 +0000 (17:09 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 9 May 2020 16:09:19 +0000 (17:09 +0100)
* master:
  Makefile, bin/chroot-maint: Keep `/usr/local/include' mostly empty.
  etc/sbuild.conf.in: Don't run complicated Debian testing by default.
  Makefile: Add a new thing for running arbitrary commands.
  Makefile: Change the tag for maintenance to be `MAINT'.
  Makefile: Fix `squote' to have the right number of `\'s.
  bin/chroot-maint: Run `ldconfig' after an update.
  bin/chroot-maint: Fix mistakenly indented file-contents literals.
  src/jobclient.c: Cope if the jobserver pipe is set nonblocking.
  bin/chroot-maint: Force `--no-merged-usr'.
  bin/chroot-maint: Update the path correctly when following a symlink.
  bin/chroot-maint: Don't forget to copy symlinks to directories.

Makefile
bin/chroot-maint
etc/sbuild.conf.in
src/jobclient.c

index ea89661aba834616ffd7f2681fef7296d202f9d2..3b431a286b10cb2942a0f73c4427df6019c17fb2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -274,7 +274,8 @@ throwrc                      = { $1; echo $$? >&4; }
 ##     $(call squote,TXT)
 ##
 ## Single-quote TXT.
-squote                  = '$(subst ','\\'',$1)'
+squote                  = '$(subst ','\'',$1)'
+#'
 
 ##     $(call chroot-dist,D-A) -> D
 ##     $(call chroot-arch,D-A) -> A
@@ -603,7 +604,8 @@ $(foreach d,$(LOCAL_COMMON_DIRS) $(LOCAL_EXTRA_DIRS),$(LOCAL)/$d):
        $(V_AT)mkdir -p $(dir $(patsubst %/,%,$@))
        $(call v_tag,MKDIR)mkdir $@
 
-LOCAL_ARCH_DIRS                 = bin/ etc/ games/ include/ lib/ libexec/ sbin/
+LOCAL_ARCH_DIRS                 = bin/ etc/ games/ include/ include.aside/
+LOCAL_ARCH_DIRS                += lib/ libexec/ sbin/
 LOCAL_ARCH_LINKS        = man
 man_LINKDEST            = share/man
 all:: $(foreach a,$(ALL_ARCHS),\
@@ -638,7 +640,7 @@ JOBS                         = chroot cross-tools pkg-build
 
 MAINTQ_                         = -q
 MAINTQ_0                = -q
-MAINT                   = +$(call v_tag,RUN)\
+MAINT                   = +$(call v_tag,MAINT)\
        PYTHONPATH=$(STATE)/lib/python $(STATE)/bin/chroot-maint \
                $(MAINTQ_$V) $(OPTS)
 
@@ -646,6 +648,19 @@ maint: all check
        $(MAINT) -f$(FRESH) $(JOBS)
 .PHONY: maint
 
+###--------------------------------------------------------------------------
+### Running random commands.
+
+CMD                     = echo %d %a
+subst-command           = $(subst %d,$(call chroot-dist,$1), \
+                               $(subst %a,$(call chroot-arch,$1), \
+                                       $(subst %r,$1, $(CMD))))
+
+run: $(foreach c,$(ALL_CHROOTS),run/$c)
+$(foreach c,$(ALL_CHROOTS),run/$c): run/%:
+       $(V_AT)$(call v_print,RUN,$(call subst-command,$*))\
+               $(call subst-command,$*)
+
 ###--------------------------------------------------------------------------
 ### Other maintenance targets.
 
index 2f91e9c54bc087f9114eccee3abcdf2e57db01b9..21e5c215bdc8e8f9f64682ee05127e8bda9c1cc3 100755 (executable)
@@ -1944,7 +1944,7 @@ class ChrootJob (BaseJob):
             continue
           ff.append(f)
           path = OS.path.join(dir, f)
-          if not OS.path.isdir(path): examine(path)
+          if OS.path.islink(path) or not OS.path.isdir(path): examine(path)
         files[:] = ff
       OS.path.walk(crossdir, visit, None)
       OS.path.walk(OS.path.join(crossdir, "TOOLCHAIN", gnuarch),
@@ -2116,7 +2116,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 +2156,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 +2184,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 +2199,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 +2253,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 +2376,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 +2669,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", """
index 963f7d418e596662c20db24b285f2fbe136522c1..fe0aa10064befdc82ff1e174c58b3b48cbdecd58 100644 (file)
@@ -61,6 +61,11 @@ $build_environment = {
 ## Actually resolve alternatives properly.
 $resolve_alternatives = 1;
 
+## Other things to do.
+$run_autopkgtest = 0;
+$run_lintian = 0;
+$run_piuparts = 0;
+
 ## Leave debris for diagnostics.
 $purge_build_deps = "successful";
 $purge_build_directory = "successful";
index bc8d85890da59a767a9f0ed81a5afaa49820c6da..02141d4718098b0a916851c27a002ca54197ae31 100644 (file)
@@ -33,6 +33,7 @@
 
 #include <sys/types.h>
 #include <sys/wait.h>
+#include <sys/select.h>
 #include <unistd.h>
 
 #define PY_SSIZE_T_CLEAN
@@ -52,6 +53,7 @@ static PyObject *pymeth_jobclient(PyObject *me, PyObject *arg)
   PyObject *rc = 0;
   struct sigaction sa, oldsa;
   sigset_t mask, oldmask;
+  fd_set infd;
   int rstrchld = 0;
   int fd, sfd;
   int kid, st;
@@ -101,7 +103,11 @@ again:
    * like this happens, then we go back and try reaping children again.
    */
   Py_BEGIN_ALLOW_THREADS
-  n = read(sigfd, &ch, 1);
+  for (;;) {
+    n = read(sigfd, &ch, 1); if (n >= 0 || errno != EAGAIN) break;
+    FD_ZERO(&infd); FD_SET(sigfd, &infd);
+    n = select(sigfd + 1, &infd, 0, 0, 0); if (n < 0) break;
+  }
   Py_END_ALLOW_THREADS
   if (n == 1) rc = Py_BuildValue("(cOO)", ch, Py_None, Py_None);
   else if (!n) rc = Py_BuildValue("(sOO)", "", Py_None, Py_None);