From: Mark Wooding Date: Sun, 9 Aug 2020 00:11:23 +0000 (+0100) Subject: Merge branch 'deploy' into deploy.universe X-Git-Url: https://git.distorted.org.uk/~mdw/distorted-chroot/commitdiff_plain/refs/heads/deploy.universe?hp=3cde241f3f1a70a629be582e8e638fe5d015a9f8 Merge branch 'deploy' into deploy.universe * deploy: Makefile: Don't insist on `/usr/lib/.../coreutils/'. bin/chroot-maint: Enhance the `CROSS_TOOLS' pattern machinery. --- diff --git a/Makefile b/Makefile index 4b4a616..fb888c0 100644 --- a/Makefile +++ b/Makefile @@ -134,7 +134,7 @@ CROSS_PATHS += \ sha256sum sha384sum sha512sum shred shuf sort split stat \ stdbuf sum tac tail tee test timeout tr truncate tsort tty \ unexpand uniq unlink users wc who whoami yes) \ - /usr/lib/MULTI/coreutils/ \ + ?/usr/lib/MULTI/coreutils/ \ $(addprefix /lib/MULTI/, \ libnsl.so.* libnss_*.so.*) \ /usr/bin/gpgv \ diff --git a/bin/chroot-maint b/bin/chroot-maint index 34dec2e..fbd45e3 100755 --- a/bin/chroot-maint +++ b/bin/chroot-maint @@ -2384,15 +2384,25 @@ class CrossToolsJob (BaseJob): ## Work through the shopping list, copying the things it names into the ## cross-tools tree. + ## + ## Each thing in the `CROSS_PATHS' list is a `|'-separated list of glob + ## patterns, optionally preceded by `?'. Unless the list starts with + ## `?', at least one of the patterns must match at least one file. + ## Patterns may contain the token `MULTI', which is replaced by the + ## donor architecture's multiarch triplet. scan = [] for pat in C.CROSS_PATHS: - pat = pat.replace("MULTI", mymulti) any = False - for rootpath in GLOB.iglob(root + pat): + pat = pat.replace("MULTI", mymulti) + if pat.startswith("?"): + pat = pat[1:] any = True - path = rootpath[len(root):] - progress("copy `%s'" % path) - run_program(["rsync", "-aHR", "%s/.%s" % (root, path), crossnew]) + for subpat in pat.split("|"): + for rootpath in GLOB.iglob(root + subpat): + any = True + path = rootpath[len(root):] + progress("copy `%s'" % path) + run_program(["rsync", "-aHR", "%s/.%s" % (root, path), crossnew]) if not any: raise RuntimeError("no matches for cross-tool pattern `%s'" % pat)