Makefile: Add `help' summary. master
authorMark Wooding <mdw@distorted.org.uk>
Tue, 18 Jun 2024 22:37:37 +0000 (23:37 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 18 Jun 2024 22:37:37 +0000 (23:37 +0100)
Makefile
bin/chroot-maint
etc/aptsrc.conf

index 4b4a616..1a25369 100644 (file)
--- a/Makefile
+++ b/Makefile
 ### Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 ### USA.
 
 ### Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 ### USA.
 
-all::
+all:
 clean::
 check::
 clean::
 check::
-.PHONY: all clean check
+help::
+.PHONY: all clean check help
 .SECONDEXPANSION: #sorry
 
 ###--------------------------------------------------------------------------
 .SECONDEXPANSION: #sorry
 
 ###--------------------------------------------------------------------------
@@ -35,8 +36,20 @@ check::
 
 CONFIG_VARS             =
 
 
 CONFIG_VARS             =
 
+help::
+       @echo  "Configuration variables"
+
+## Make verbosity.
+V                       = 0
+help::;  @echo "       V               build verbosity"
+
 ## Level of pickiness to aspire to.
 NOTIFY_FATAL            = 1
 ## Level of pickiness to aspire to.
 NOTIFY_FATAL            = 1
+help::
+       @echo  "        NOTIFY_FATAL    report fatal error on ..." && \
+       echo   "                                1 = error" && \
+       echo   "                                2 = warning" && \
+       echo   "                                3 = info"
 
 ## Volume group from which to allocate chroot volumes and snapshots.
 CONFIG_VARS            += VG LVPREFIX
 
 ## Volume group from which to allocate chroot volumes and snapshots.
 CONFIG_VARS            += VG LVPREFIX
@@ -72,7 +85,7 @@ PROXY                  = $(shell \
 ## Debian distributions to support.
 CONFIG_VARS            += PRIMARY_DIST DISTS
 PRIMARY_DIST            = stretch
 ## Debian distributions to support.
 CONFIG_VARS            += PRIMARY_DIST DISTS
 PRIMARY_DIST            = stretch
-DISTS                   = $(PRIMARY_DIST) buster bullseye sid
+DISTS                   = $(PRIMARY_DIST) buster bullseye bookworm sid
 
 ## Host's native architecture(s).
 CONFIG_VARS            += MYARCH NATIVE_ARCHS
 
 ## Host's native architecture(s).
 CONFIG_VARS            += MYARCH NATIVE_ARCHS
@@ -134,7 +147,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) \
                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 \
        $(addprefix /lib/MULTI/, \
                libnsl.so.* libnss_*.so.*) \
        /usr/bin/gpgv \
@@ -206,12 +219,14 @@ TOOLSARCH          = $(MYARCH)
 ## A directory in which we can maintain private files and state.
 CONFIG_VARS            += STATE
 STATE                   = state
 ## A directory in which we can maintain private files and state.
 CONFIG_VARS            += STATE
 STATE                   = state
+help::;  @echo "       STATE           directory for state files"
 
 ## A directory which will be spliced into chroots as `/usr/local.schroot/'.
 ## This will be our primary point of contact with the chroot.
 CONFIG_VARS            += LOCAL ABSLOCAL
 LOCAL                   = local.schroot
 ABSLOCAL                = $(abspath $(LOCAL))
 
 ## A directory which will be spliced into chroots as `/usr/local.schroot/'.
 ## This will be our primary point of contact with the chroot.
 CONFIG_VARS            += LOCAL ABSLOCAL
 LOCAL                   = local.schroot
 ABSLOCAL                = $(abspath $(LOCAL))
+help::;  @echo "       LOCAL           directory for chroot /usr/local"
 
 ## How to run a command as a privileged user.
 CONFIG_VARS            += ROOTLY
 
 ## How to run a command as a privileged user.
 CONFIG_VARS            += ROOTLY
@@ -236,6 +251,15 @@ FOREIGN_GNUARCHS   := $(foreach a,$(FOREIGN_ARCHS),\
                                        -qDEB_TARGET_GNU_TYPE))
 
 ###--------------------------------------------------------------------------
                                        -qDEB_TARGET_GNU_TYPE))
 
 ###--------------------------------------------------------------------------
+### Basic help.
+
+help::
+       @echo  "Basic targets" && \
+       echo   "        all             build and install the infrastructure" && \
+       echo   "        clean           delete build files" && \
+       echo   "        check           verify correct installation"
+
+###--------------------------------------------------------------------------
 ### Utilities.
 
 ## Hack to force rebuilding.
 ### Utilities.
 
 ## Hack to force rebuilding.
@@ -246,7 +270,6 @@ _force:
 comma                   = ,
 
 ## Silent-rules machinery.
 comma                   = ,
 
 ## Silent-rules machinery.
-V                       = 0
 V_AT                    = $(V_AT_$V)
 V_AT_0                  = @
 v_print                         = $(call v_print_$V,$1,$2)
 V_AT                    = $(V_AT_$V)
 V_AT_0                  = @
 v_print                         = $(call v_print_$V,$1,$2)
@@ -265,6 +288,24 @@ CLEANFILES         += log/*.log
 SILENCE_LVM             = \
        LVM_SUPPRESS_FD_WARNINGS=1; export LVM_SUPPRESS_FD_WARNINGS
 
 SILENCE_LVM             = \
        LVM_SUPPRESS_FD_WARNINGS=1; export LVM_SUPPRESS_FD_WARNINGS
 
+##     $(call file-name,PATH)
+##
+## Strip any trailing `/' from the PATH.
+file-name               = $(1:/=)
+
+##     $(call base-name,PATH)
+##
+## Expand to the last component of PATH, whether or not it's a directory
+## name with a trailing `/'.
+base-name               = $(notdir $(call file-name,$1))
+
+##     $(call parent-dir,PATH)
+##
+## Expand to the parent directory of PATH, whether or not it's a directory
+## name with a trailing `/'.
+## `/'.
+parent-dir              = $(dir $(call file-name,$1))
+
 ##     $(call definedp,VAR)
 ##
 ## Expand non-empty if and only if VAR is defined (but possibly empty).
 ##     $(call definedp,VAR)
 ##
 ## Expand non-empty if and only if VAR is defined (but possibly empty).
@@ -388,6 +429,11 @@ check-mountpoint    = $(call check,$1,"\`$2' is not a mount point", \
 check-symlink           = $(call check,$1,"\`$2' is not a link to \`$3'", \
        [ -L "$2" ] && [ "$$(readlink "$2")" = "$3" ])
 
 check-symlink           = $(call check,$1,"\`$2' is not a link to \`$3'", \
        [ -L "$2" ] && [ "$$(readlink "$2")" = "$3" ])
 
+##     DIR/
+##
+## Make a directory.  Use as an order-only dependency.
+%/:; $(V_AT)mkdir -p $@
+
 ###--------------------------------------------------------------------------
 ### Python extensions.
 
 ###--------------------------------------------------------------------------
 ### Python extensions.
 
@@ -411,14 +457,13 @@ PYEXT_ALLSRC               = $(foreach x,$(PYEXTS),\
                                $(call c-source,$($x_SOURCES)))
 PYEXT_ALLOBJ            = $(foreach x,$(PYEXTS),\
                                $(call c-object,$($x_SOURCES)))
                                $(call c-source,$($x_SOURCES)))
 PYEXT_ALLOBJ            = $(foreach x,$(PYEXTS),\
                                $(call c-object,$($x_SOURCES)))
-$(PYEXT_ALLOBJ): $(STATE)/obj/%.o: src/%.c
-       $(V_AT)mkdir -p $(dir $@)
+$(PYEXT_ALLOBJ): $(STATE)/obj/%.o: src/%.c | $$(dir $$@)
        $(call v_tag,CC)$(CC) -c $(CFLAGS) $(PYEXT_CFLAGS) -o$@ $<
 
 PYMODULES               = $(foreach x,$(PYEXTS),$(STATE)/lib/python/$x.so)
        $(call v_tag,CC)$(CC) -c $(CFLAGS) $(PYEXT_CFLAGS) -o$@ $<
 
 PYMODULES               = $(foreach x,$(PYEXTS),$(STATE)/lib/python/$x.so)
-all:: $(PYMODULES)
-$(PYMODULES): $(STATE)/lib/python/%.so: $$(call c-object,$$($$*_SOURCES))
-       $(V_AT)mkdir -p $(dir $@)
+all: $(PYMODULES)
+$(PYMODULES): $(STATE)/lib/python/%.so: \
+               $$(call c-object,$$($$*_SOURCES)) | $$(dir $$@)
        $(call v_tag,LD)$(LD) $(LDFLAGS) $(PYEXT_LDFLAGS) -o$@ $^
 
 ###--------------------------------------------------------------------------
        $(call v_tag,LD)$(LD) $(LDFLAGS) $(PYEXT_LDFLAGS) -o$@ $^
 
 ###--------------------------------------------------------------------------
@@ -428,9 +473,8 @@ SCRIPTS                     += chroot-maint
 SCRIPTS                        += mkchrootconf
 
 SUBST_SCRIPTS           = $(addprefix $(STATE)/bin/,$(SCRIPTS))
 SCRIPTS                        += mkchrootconf
 
 SUBST_SCRIPTS           = $(addprefix $(STATE)/bin/,$(SCRIPTS))
-all:: $(SUBST_SCRIPTS)
-$(SUBST_SCRIPTS): $(STATE)/bin/%: bin/% $(STATE)/config.sh
-       $(V_AT)mkdir -p $(dir $@)
+all: $(SUBST_SCRIPTS)
+$(SUBST_SCRIPTS): $(STATE)/bin/%: bin/% $(STATE)/config.sh | $$(dir $$@)
        $(call v_tag,SUBST){ \
                sed \
                -e '2i### GENERATED by distorted-chroot: do not edit' \
        $(call v_tag,SUBST){ \
                sed \
                -e '2i### GENERATED by distorted-chroot: do not edit' \
@@ -446,10 +490,10 @@ $(SUBST_SCRIPTS): $(STATE)/bin/%: bin/% $(STATE)/config.sh
 ## In a chroot, `/etc/apt/sources.list' links to
 ## `/usr/local.schroot/etc/apt/sources.$d' for the appropriate distribution.
 APT_SOURCES             = $(foreach d,$(DISTS),$(LOCAL)/etc/apt/sources.$d)
 ## In a chroot, `/etc/apt/sources.list' links to
 ## `/usr/local.schroot/etc/apt/sources.$d' for the appropriate distribution.
 APT_SOURCES             = $(foreach d,$(DISTS),$(LOCAL)/etc/apt/sources.$d)
-all:: $(APT_SOURCES)
+all: $(APT_SOURCES)
 
 
-$(foreach d,$(DISTS),$(STATE)/etc/apt/aptsrc.$d): $(STATE)/etc/apt/aptsrc.%:
-       $(V_AT)mkdir -p $(dir $@)
+$(foreach d,$(DISTS),$(STATE)/etc/apt/aptsrc.$d): \
+               $(STATE)/etc/apt/aptsrc.%: | $$(dir $$@)
        $(call v_tag,GEN){ \
          echo "### -*-conf-*- GENERATED by distorted-chroot: do not edit"; \
          echo "subscribe"; \
        $(call v_tag,GEN){ \
          echo "### -*-conf-*- GENERATED by distorted-chroot: do not edit"; \
          echo "subscribe"; \
@@ -457,8 +501,8 @@ $(foreach d,$(DISTS),$(STATE)/etc/apt/aptsrc.$d): $(STATE)/etc/apt/aptsrc.%:
        } >$@.new && mv $@.new $@
 
 $(APT_SOURCES): $(LOCAL)/etc/apt/sources.%: \
        } >$@.new && mv $@.new $@
 
 $(APT_SOURCES): $(LOCAL)/etc/apt/sources.%: \
-               $$(APTSRC) $$($$*_APTSRC) $$(STATE)/etc/apt/aptsrc.$$*
-       $(V_AT)mkdir -p $(dir $@)
+               $$(APTSRC) $$($$*_APTSRC) $$(STATE)/etc/apt/aptsrc.$$* \
+               | $$(dir $$@)
        $(call v_tag,GEN)bin/mkaptsrc \
                $(APTSRC) $($*_APTSRC) $(STATE)/etc/apt/aptsrc.$* \
                >$@.new && mv $@.new $@
        $(call v_tag,GEN)bin/mkaptsrc \
                $(APTSRC) $($*_APTSRC) $(STATE)/etc/apt/aptsrc.$* \
                >$@.new && mv $@.new $@
@@ -467,10 +511,9 @@ CLEANFILES         += $(APT_SOURCES)
 ## In a chroot, a link `/etc/apt/apt.conf.d/FOO' is created for each file in
 ## `/usr/local.schroot/etc/apt/apt.conf.d/FOO'.
 APT_CONFIGS           = $(addprefix $(LOCAL)/etc/apt/apt.conf.d/,$(APTCONF))
 ## In a chroot, a link `/etc/apt/apt.conf.d/FOO' is created for each file in
 ## `/usr/local.schroot/etc/apt/apt.conf.d/FOO'.
 APT_CONFIGS           = $(addprefix $(LOCAL)/etc/apt/apt.conf.d/,$(APTCONF))
-all:: $(APT_CONFIGS)
+all: $(APT_CONFIGS)
 $(APT_CONFIGS): $(LOCAL)/etc/apt/apt.conf.d/%: \
 $(APT_CONFIGS): $(LOCAL)/etc/apt/apt.conf.d/%: \
-               $$(or $$(_$$*_APTCONFSRC) etc/apt-conf.d/$$*)
-       $(V_AT)mkdir -p $(dir $@)
+               $$(or $$(_$$*_APTCONFSRC) etc/apt-conf.d/$$*) | $$(dir $$@)
        $(call v_tag,COPY)cp $< $@.new && mv $@.new $@
 clean::; rm -f $(APT_CONFIGS)
 
        $(call v_tag,COPY)cp $< $@.new && mv $@.new $@
 clean::; rm -f $(APT_CONFIGS)
 
@@ -481,26 +524,25 @@ check::; $(call check-executable,ERR,/usr/bin/eatmydata)
 
 EATMYDATA_HACKS                += apt-get aptitude dpkg
 SYMLINK_EATMYDATA_HACKS         = $(addprefix $(LOCAL)/hacks/,$(EATMYDATA_HACKS))
 
 EATMYDATA_HACKS                += apt-get aptitude dpkg
 SYMLINK_EATMYDATA_HACKS         = $(addprefix $(LOCAL)/hacks/,$(EATMYDATA_HACKS))
-all:: $(SYMLINK_EATMYDATA_HACKS)
+all: $(SYMLINK_EATMYDATA_HACKS)
 $(SYMLINK_EATMYDATA_HACKS): $(LOCAL)/hacks/%: \
 $(SYMLINK_EATMYDATA_HACKS): $(LOCAL)/hacks/%: \
-               $$(if $$(call symlink-ok-p,$$@,/usr/bin/eatmydata),,_force)
-       $(V_AT)mkdir -p $(dir $@)
+               $$(if $$(call symlink-ok-p,$$@,/usr/bin/eatmydata),,_force) \
+               | $$(dir $$@)
        $(call v_tag,SYMLINK)ln -sf /usr/bin/eatmydata $@.new && mv $@.new $@
 clean::; rm -f $(SYMLINK_EATMYDATA_HACKS)
 
 SCRIPT_HACKS           += buildwrap
 COPY_SCRIPT_HACKS       = $(addprefix $(LOCAL)/hacks/,$(SCRIPT_HACKS))
        $(call v_tag,SYMLINK)ln -sf /usr/bin/eatmydata $@.new && mv $@.new $@
 clean::; rm -f $(SYMLINK_EATMYDATA_HACKS)
 
 SCRIPT_HACKS           += buildwrap
 COPY_SCRIPT_HACKS       = $(addprefix $(LOCAL)/hacks/,$(SCRIPT_HACKS))
-all:: $(COPY_SCRIPT_HACKS)
-$(COPY_SCRIPT_HACKS): $(LOCAL)/hacks/%: bin/%
-       $(V_AT)mkdir -p $(dir $@)
+all: $(COPY_SCRIPT_HACKS)
+$(COPY_SCRIPT_HACKS): $(LOCAL)/hacks/%: bin/% | $$(dir $$@)
        $(call v_tag,COPY)cp $< $@.new && mv $@.new $@
 clean::; rm -f $(COPY_SCRIPT_HACKS)
 
 ###--------------------------------------------------------------------------
 ### `schroot' and `sbuild' configuration.
 
        $(call v_tag,COPY)cp $< $@.new && mv $@.new $@
 clean::; rm -f $(COPY_SCRIPT_HACKS)
 
 ###--------------------------------------------------------------------------
 ### `schroot' and `sbuild' configuration.
 
-all:: schroot-config
-schroot-config::
+all: schroot-config
+schroot-config:
 .PHONY: schroot-config
 
 check::; $(call check-mountpoint,WARN,/var/lib/sbuild/build)
 .PHONY: schroot-config
 
 check::; $(call check-mountpoint,WARN,/var/lib/sbuild/build)
@@ -516,55 +558,52 @@ schroot-config_HASH       := \
        $(shell $(call %print-varlist,$(CONFIG_VARS)) | \
                sha256sum | cut -c1-32)
 schroot-config_FILE     = $(STATE)/config.sh-$(schroot-config_HASH)
        $(shell $(call %print-varlist,$(CONFIG_VARS)) | \
                sha256sum | cut -c1-32)
 schroot-config_FILE     = $(STATE)/config.sh-$(schroot-config_HASH)
-$(schroot-config_FILE):
-       $(V_AT)mkdir -p $(STATE)
+$(schroot-config_FILE): | $(STATE)/
        $(V_AT)rm -f $(STATE)/config.sh-*
        $(call v_tag,GEN)$(call %print-varlist,$(CONFIG_VARS)) \
                >$@.new && mv $@.new $@
 
        $(V_AT)rm -f $(STATE)/config.sh-*
        $(call v_tag,GEN)$(call %print-varlist,$(CONFIG_VARS)) \
                >$@.new && mv $@.new $@
 
-schroot-config:: $(STATE)/config.sh
+schroot-config: $(STATE)/config.sh
 $(STATE)/config.sh: $(schroot-config_FILE)
 $(STATE)/config.sh: $(schroot-config_FILE)
-       $(call v_tag,SYMLINK)ln -sf $(notdir $<) $@
+       $(call v_tag,SYMLINK)ln -sf $(call base-name,$<) $@
 
 
-schroot-config:: $(LOCAL)/etc/schroot/sbuild.schroot
-$(LOCAL)/etc/schroot/sbuild.schroot: $(STATE)/bin/mkchrootconf
-       $(V_AT)mkdir -p $(dir $@)
+schroot-config: $(LOCAL)/etc/schroot/sbuild.schroot
+$(LOCAL)/etc/schroot/sbuild.schroot: $(STATE)/bin/mkchrootconf | $$(dir $$@)
        $(call v_tag,GEN)$(STATE)/bin/mkchrootconf >$@.new && \
                $(ROOTLY) chown root:root $@.new && mv $@.new $@
 CLEANFILES             += $(LOCAL)/etc/schroot/sbuild.schroot
 check::; $(call check-symlink,WARN,/etc/schroot/chroot.d/sbuild,$(ABSLOCAL)/etc/schroot/sbuild.schroot)
 
        $(call v_tag,GEN)$(STATE)/bin/mkchrootconf >$@.new && \
                $(ROOTLY) chown root:root $@.new && mv $@.new $@
 CLEANFILES             += $(LOCAL)/etc/schroot/sbuild.schroot
 check::; $(call check-symlink,WARN,/etc/schroot/chroot.d/sbuild,$(ABSLOCAL)/etc/schroot/sbuild.schroot)
 
-schroot-config:: $(LOCAL)/etc/schroot/sbuild.profile/copyfiles
-$(LOCAL)/etc/schroot/sbuild.profile/copyfiles: $(schroot-config_STAMP)
-       $(V_AT)mkdir -p $(dir $@)
+schroot-config: $(LOCAL)/etc/schroot/sbuild.profile/copyfiles
+$(LOCAL)/etc/schroot/sbuild.profile/copyfiles: \
+               $(schroot-config_STAMP) | $$(dir $$@)
        $(call v_tag,GEN){ \
          echo "### -*-conf-*- GENERATED by distorted-chroot: do not edit"; \
          for i in $(SCHROOT_COPYFILES); do echo "$$i"; done; \
        } >$@.new && mv $@.new $@
 CLEANFILES             += $(LOCAL)/etc/schroot/sbuild.profile/copyfiles
 
        $(call v_tag,GEN){ \
          echo "### -*-conf-*- GENERATED by distorted-chroot: do not edit"; \
          for i in $(SCHROOT_COPYFILES); do echo "$$i"; done; \
        } >$@.new && mv $@.new $@
 CLEANFILES             += $(LOCAL)/etc/schroot/sbuild.profile/copyfiles
 
-schroot-config:: $(LOCAL)/etc/schroot/sbuild.profile/nssdatabases
-$(LOCAL)/etc/schroot/sbuild.profile/nssdatabases: $(schroot-config_STAMP)
-       $(V_AT)mkdir -p $(dir $@)
+schroot-config: $(LOCAL)/etc/schroot/sbuild.profile/nssdatabases
+$(LOCAL)/etc/schroot/sbuild.profile/nssdatabases: \
+               $(schroot-config_STAMP) | $$(dir $$@)
        $(call v_tag,GEN){ \
          echo "### -*-conf-*- GENERATED by distorted-chroot: do not edit"; \
          for i in $(SCHROOT_NSSDATABASES); do echo "$$i"; done; \
        } >$@.new && mv $@.new $@
 CLEANFILES             += $(LOCAL)/etc/schroot/sbuild.profile/nssdatabases
 
        $(call v_tag,GEN){ \
          echo "### -*-conf-*- GENERATED by distorted-chroot: do not edit"; \
          for i in $(SCHROOT_NSSDATABASES); do echo "$$i"; done; \
        } >$@.new && mv $@.new $@
 CLEANFILES             += $(LOCAL)/etc/schroot/sbuild.profile/nssdatabases
 
-schroot-config:: $(LOCAL)/etc/schroot/sbuild.profile/fstab
+schroot-config: $(LOCAL)/etc/schroot/sbuild.profile/fstab
 $(LOCAL)/etc/schroot/sbuild.profile/fstab: \
 $(LOCAL)/etc/schroot/sbuild.profile/fstab: \
-               etc/sbuild.fstab.in $(schroot-config_STAMP)
-       $(V_AT)mkdir -p $(dir $@)
+               etc/sbuild.fstab.in $(schroot-config_STAMP) | $$(dir $$@)
        $(call v_tag,SUBST)$(call subst-file,### -*-conf-*-) \
                <$< >$@.new && mv $@.new $@
 CLEANFILES             += $(LOCAL)/etc/schroot/sbuild.profile/fstab
 
 check::; $(call check-symlink,WARN,/etc/schroot/sbuild,$(ABSLOCAL)/etc/schroot/sbuild.profile)
 
        $(call v_tag,SUBST)$(call subst-file,### -*-conf-*-) \
                <$< >$@.new && mv $@.new $@
 CLEANFILES             += $(LOCAL)/etc/schroot/sbuild.profile/fstab
 
 check::; $(call check-symlink,WARN,/etc/schroot/sbuild,$(ABSLOCAL)/etc/schroot/sbuild.profile)
 
-schroot-config:: $(LOCAL)/etc/sbuild.conf
-$(LOCAL)/etc/sbuild.conf: etc/sbuild.conf.in $(schroot-config_STAMP)
-       $(V_AT)mkdir -p $(dir $@)
+schroot-config: $(LOCAL)/etc/sbuild.conf
+$(LOCAL)/etc/sbuild.conf: etc/sbuild.conf.in \
+               $(schroot-config_STAMP) | $$(dir $$@)
        $(call v_tag,SUBST)$(call subst-file,### -*-perl-*-) \
                <$< >$@.new && mv $@.new $@
 CLEANFILES             += $(LOCAL)/etc/sbuild.conf
        $(call v_tag,SUBST)$(call subst-file,### -*-perl-*-) \
                <$< >$@.new && mv $@.new $@
 CLEANFILES             += $(LOCAL)/etc/sbuild.conf
@@ -575,10 +614,10 @@ SCHROOT_SCRIPTS           += 11private
 SCHROOT_SCRIPTS                += 15binfmt
 SCHROOT_SCRIPTS                += 51chrootenv
 COPY_SCHROOT_SCRIPTS    = $(addprefix $(LOCAL)/etc/schroot/setup.d/,$(SCHROOT_SCRIPTS))
 SCHROOT_SCRIPTS                += 15binfmt
 SCHROOT_SCRIPTS                += 51chrootenv
 COPY_SCHROOT_SCRIPTS    = $(addprefix $(LOCAL)/etc/schroot/setup.d/,$(SCHROOT_SCRIPTS))
-schroot-config:: $(COPY_SCHROOT_SCRIPTS)
+schroot-config: $(COPY_SCHROOT_SCRIPTS)
 $(COPY_SCHROOT_SCRIPTS): \
 $(COPY_SCHROOT_SCRIPTS): \
-               $(LOCAL)/etc/schroot/setup.d/%: etc/schroot-scripts/%
-       $(V_AT)mkdir -p $(dir $@)
+               $(LOCAL)/etc/schroot/setup.d/%: etc/schroot-scripts/% \
+               | $$(dir $$@)
        $(call v_tag,COPY)cp $< $@.new && mv $@.new $@
 CLEANFILES             += $(COPY_SCHROOT_SCRIPTS)
 
        $(call v_tag,COPY)cp $< $@.new && mv $@.new $@
 CLEANFILES             += $(COPY_SCHROOT_SCRIPTS)
 
@@ -593,10 +632,9 @@ $(CHECK_SCHROOT_SCRIPTS): check-script/%:
 
 CCACHE_CONFIGS          = $(foreach r,$(ALL_CHROOTS), \
        /var/lib/sbuild/build/.ccache/$(LVPREFIX)$r/ccache.conf)
 
 CCACHE_CONFIGS          = $(foreach r,$(ALL_CHROOTS), \
        /var/lib/sbuild/build/.ccache/$(LVPREFIX)$r/ccache.conf)
-all:: $(CCACHE_CONFIGS)
+all: $(CCACHE_CONFIGS)
 $(CCACHE_CONFIGS): /var/lib/sbuild/build/.ccache/$(LVPREFIX)%/ccache.conf: \
 $(CCACHE_CONFIGS): /var/lib/sbuild/build/.ccache/$(LVPREFIX)%/ccache.conf: \
-               etc/ccache.conf
-       $(V_AT)mkdir -p $(dir $@)
+               etc/ccache.conf | $$(dir $$@)
        $(call v_tag,COPY)cp $< $@.new && mv $@.new $@
 
 ###--------------------------------------------------------------------------
        $(call v_tag,COPY)cp $< $@.new && mv $@.new $@
 
 ###--------------------------------------------------------------------------
@@ -604,37 +642,28 @@ $(CCACHE_CONFIGS): /var/lib/sbuild/build/.ccache/$(LVPREFIX)%/ccache.conf: \
 
 LOCAL_COMMON_DIRS       = share/ src/
 LOCAL_EXTRA_DIRS        = share/man/
 
 LOCAL_COMMON_DIRS       = share/ src/
 LOCAL_EXTRA_DIRS        = share/man/
-all:: $(foreach d,$(LOCAL_COMMON_DIRS) $(LOCAL_EXTRA_DIRS),$(LOCAL)/$d)
-$(foreach d,$(LOCAL_COMMON_DIRS) $(LOCAL_EXTRA_DIRS),$(LOCAL)/$d):
-       $(V_AT)mkdir -p $(dir $(patsubst %/,%,$@))
-       $(call v_tag,MKDIR)mkdir $@
+all: $(foreach d,$(LOCAL_COMMON_DIRS) $(LOCAL_EXTRA_DIRS),$(LOCAL)/$d)
 
 LOCAL_ARCH_DIRS                 = bin/ etc/ games/ include/ include.aside/
 LOCAL_ARCH_DIRS                += lib/ libexec/ sbin/
 LOCAL_ARCH_LINKS        = man
 man_LINKDEST            = share/man
 
 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),\
+all: $(foreach a,$(ALL_ARCHS),\
        $(LOCAL)/$a/ \
        $(foreach d,$(LOCAL_ARCH_DIRS),$(LOCAL)/$a/$d) \
        $(foreach d,$(LOCAL_ARCH_LINKS),$(LOCAL)/$a/$d) \
        $(foreach d,$(LOCAL_COMMON_DIRS),$(LOCAL)/$a/$d))
 
        $(LOCAL)/$a/ \
        $(foreach d,$(LOCAL_ARCH_DIRS),$(LOCAL)/$a/$d) \
        $(foreach d,$(LOCAL_ARCH_LINKS),$(LOCAL)/$a/$d) \
        $(foreach d,$(LOCAL_COMMON_DIRS),$(LOCAL)/$a/$d))
 
-$(foreach a,$(ALL_ARCHS),$(LOCAL)/$a/):
-       $(call v_tag,MKDIR)mkdir $@
-$(foreach a,$(ALL_ARCHS),\
-  $(foreach d,$(LOCAL_ARCH_DIRS),$(LOCAL)/$a/$d)):
-       $(V_AT)mkdir -p $(dir $(patsubst %/,%,$@))
-       $(call v_tag,MKDIR)mkdir $@
 $(foreach a,$(ALL_ARCHS),\
   $(foreach d,$(LOCAL_ARCH_LINKS),$(LOCAL)/$a/$d)): \
 $(foreach a,$(ALL_ARCHS),\
   $(foreach d,$(LOCAL_ARCH_LINKS),$(LOCAL)/$a/$d)): \
-               $$(if $$(call symlink-ok-p,$$@,$$($$(notdir $$@)_LINKDEST)),,_force)
-       $(V_AT)mkdir -p $(notdir $@)
-       $(call v_tag,SYMLINK)ln -sf $($(notdir $@)_LINKDEST) $@
+               $$(if $$(call symlink-ok-p,$$@,$$($$(call base-name,$$@)_LINKDEST)),,_force) \
+               | $$(dir $$@)
+       $(call v_tag,SYMLINK)ln -sf $($(call base-name,$@)_LINKDEST) $@
 $(foreach a,$(ALL_ARCHS),\
   $(foreach d,$(LOCAL_COMMON_DIRS),$(LOCAL)/$a/$d)): \
 $(foreach a,$(ALL_ARCHS),\
   $(foreach d,$(LOCAL_COMMON_DIRS),$(LOCAL)/$a/$d)): \
-               $$(if $$(call symlink-ok-p,$$@,../$$(notdir $$(patsubst %/,%,$$@))),,_force)
-       $(V_AT)mkdir -p $(dir $(patsubst %/,%,$@))
-       $(call v_tag,SYMLINK)ln -sf ../$(notdir $(patsubst %/,%,$@)) $(patsubst %/,%,$@)
+               $$(if $$(call symlink-ok-p,$$@,../$$(call base-name,$$@)),,_force) \
+               | $$(call parent-dir,$$@)
+       $(call v_tag,SYMLINK)ln -sf ../$(call base-name,$@) $(call file-name,$@)
 
 ###--------------------------------------------------------------------------
 ### Main chroot maintenance.
 
 ###--------------------------------------------------------------------------
 ### Main chroot maintenance.
@@ -653,6 +682,21 @@ maint: all check
        $(MAINT) -f$(FRESH) $(JOBS)
 .PHONY: maint
 
        $(MAINT) -f$(FRESH) $(JOBS)
 .PHONY: maint
 
+help::
+       @echo  "Maintenance targets" && \
+       echo   "        maint           run chroot maintenance" && \
+       echo   "Maintenance variables" && \
+       echo   "        FRESH           max time between updates" && \
+       echo   "                                N[smhdw] | create | force" && \
+       echo   "        JOBS            maintenance jobs to run" && \
+       echo   "                                ACT[.PAT,...][/FRESH]" && \
+       echo   "        OPTS            additional options (bin/chroot-maint --help)" && \
+       echo   "Maintenance actions" && \
+       echo   "        chroot          create and populate chroot" && \
+       echo   "        cross-tools     build cross-compilation toolchains" && \
+       echo   "        pkg-source      download and unpack local utilities" && \
+       echo   "        pkg-build       compile and install local utilities"
+
 ###--------------------------------------------------------------------------
 ### Running random commands.
 
 ###--------------------------------------------------------------------------
 ### Running random commands.
 
index fbd45e3..70a028a 100755 (executable)
@@ -2810,7 +2810,7 @@ with toplevel_handler():
   FRESH = parse_fresh(OPT.fresh)
 
   SCHED = JobScheduler(rfd, wfd, njobs)
   FRESH = parse_fresh(OPT.fresh)
 
   SCHED = JobScheduler(rfd, wfd, njobs)
-  OS.environ["http_proxy"] = C.PROXY
+  OS.environ["http_proxy"] = OS.environ["https_proxy"] = C.PROXY
 
   jobs = []
   if not args: OPTIONS.print_usage(SYS.stderr); SYS.exit(2)
 
   jobs = []
   if not args: OPTIONS.print_usage(SYS.stderr); SYS.exit(2)
index 8083c5a..ab8fcf4 100644 (file)
@@ -14,22 +14,28 @@ default
 
 distribution debian
        banner = Debian GNU/Linux.
 
 distribution debian
        banner = Debian GNU/Linux.
+       uri[archive] = http://archive.debian.org/debian/
        uri[base] = %debmirror/debian/
        uri[updates] = %debmirror/debian/
        uri[backports] = %debmirror/debian/
        uri[base] = %debmirror/debian/
        uri[updates] = %debmirror/debian/
        uri[backports] = %debmirror/debian/
+       uri[archive-security] = http://archive.debian.org/debian-security/
        uri[security-mirror] = %debmirror/debian-security/
        uri[security-upstream] = http://security.debian.org/debian-security/
        uri[nsecurity-mirror] = %debmirror/debian-security/
        uri[nsecurity-upstream] = http://security.debian.org/debian-security/
        uri[security-mirror] = %debmirror/debian-security/
        uri[security-upstream] = http://security.debian.org/debian-security/
        uri[nsecurity-mirror] = %debmirror/debian-security/
        uri[nsecurity-upstream] = http://security.debian.org/debian-security/
+       release[updates] = %RELEASE-updates
+       release[archive-security] = %RELEASE/updates
        release[security-*] = %RELEASE/updates
        release[nsecurity-*] = %RELEASE-security
        release[security-*] = %RELEASE/updates
        release[nsecurity-*] = %RELEASE-security
-       release[updates] = %RELEASE-updates
-       releases[base] = stable testing unstable stretch buster bullseye sid
-       releases[updates] = stable testing stretch buster bullseye
-       releases[security-*] = stable testing stretch buster
-       releases[nsecurity-*] = bullseye
+       releases[archive] = stretch
+       releases[base] = oldstable stable testing unstable buster bullseye bookworm sid
+       releases[updates] = oldstable stable testing buster bullseye bookworm
+       releases[archive-security] = stretch
+       releases[security-*] = oldstable stable testing buster
+       releases[nsecurity-*] = bullseye bookworm
        releases[backports] = *-backports
        components = main non-free contrib
        releases[backports] = *-backports
        components = main non-free contrib
+       components[archive-security] = main
        components[security-*] = main
        components[backports] = main
 
        components[security-*] = main
        components[backports] = main