[PROPOSED 00/12] Assume POSIX.2-1992

For many years we have maintained code in tzselect and Makefile intended to port to older platforms that predate POSIX.2-1992. The only remaining such platform that is still supported by its supplier is Solaris 10 (2005), which has a shell and related tools that are still pre-POSIX by default, although POSIX variants are available. However, I recently discovered that Solaris 10’s own copy of tzselect now uses POSIX.2-1992 features and is based on the POSIX variants. Now that even Oracle has abandoned its pre-POSIX environment for TZDB, it’s time for us to follow suit. This series of patches updates the Makefile and tzselect shell script to assume POSIX.2-1992 or later. This simplifies maintenance and speeds up the code a bit. Paul Eggert (12): Assume POSIX.2 and eschew ‘expr’ Prefer $(CMD) to `CMD` in Makefile Prefer $PWD to $(pwd) in Makefile Avoid subshells when possible Assume POSIX.2 command substitution * tzselect.ksh: Assume POSIX.2 $PWD. * tzselect.ksh: Assume POSIX.2 awk. Avoid some subshells in tzselect Avoid an awk invocation via $'...' Use ‘export VAR=VAL’ syntax Avoid crash in Solaris 10 /usr/xpg4/bin/make Port ! to Solaris make .gitignore | 4 +- Makefile | 343 +++++++++++++++++++++++++-------------------------- NEWS | 9 ++ checknow.awk | 2 +- tzselect.ksh | 112 +++++++---------- workman.sh | 3 +- 6 files changed, 231 insertions(+), 242 deletions(-) -- 2.45.1

Assume POSIX.2-1992 or later, which specifies ‘make’ macro expansions ‘$(v:a=b)’ and shell arithmetic ‘$((EXPRESSION))’. This simplifies maintenance and removes a dependency on the confusing ‘expr’ command. It is safe to assume POSIX.2-1992; the only reason we were porting to pre-POSIX was Solaris 10 (2005), but nowadays even Solaris 10’s own /usr/bin/tzselect uses ksh and you can run ‘make’ and ‘make check’ by prepending /usr/xpg4/bin to PATH, so there’s no longer any point to porting to older shells. As part of this change, rename several build-product files to end in ‘.ck’ as this simplifies removal and clarifies which ‘make’ rules are phony. * .gitignore: Add *.ck, *.ckd/, *.dir/; remove check_*. * Makefile (int_least64_t.ck, uint_least32_t.ck) (uint_least64_t.ck, theory.ck, tz-art.ck) (tz-how-to.ck, tz-link.ck, character-set.ck) (white-space.ck, links.ck, mainguard.ck) (name-lengths.ck, now.ck, slashed-abbrs.ck, sorted.ck) (tables.ck, ziguard.ck, tzs.ck, zishrink-posix.ck) (zishrink-right.ck, public.ck, long-long.ck) (unsigned.ck): Rename from int_least64_t, uint_least32_t, uint_least64_t, check_theory.html, check_tz-art.html, check_tz-how-to.html, check_tz-link.html, check_character_set, check_white_space, check_links, check_mainguard, check_name_lengths, check_now, check_slashed_abbrs, check_sorted, check_tables, check_ziguard, check_tzs, check_zishrink_posix, check_zishrink_right, check_public, typecheck_long_long, typecheck_unsigned. All uses changed. (vanguard.zi, main.zi, rearguard.zi, zdump) (.html.ck, $(MANTXTS), $(TIME_T_ALTERNATIVES)): Simplify by using ‘make’ macro expansions ‘$(v:a=b)’ or ‘$<’ instead of shell expressions ‘`expr $(v) : '\(.*\).a'`.b’. (CHECK_NOW_FUTURE_SECS): Don’t quote ‘*’. (now.ck, zishrink-posix.ck, zishrink-right.ck, public.ck) ($(TIME_T_ALTERNATIVES), long-long.ck, unsigned.ck): Use .ckd for check directory extension, as that’s easier now. (now.ck, SET_TIMESTAMP_N): Simplify by using shell arithmetic ‘$((EXPRESSION))’ instead of ‘`expr EXPRESSION`’. (now.ck): Quote $PWD in case it has spaces. (.SUFFIXES): Add .ck, .html. (.html.ck): New inference rule, replacing the old target rule for $(CHECK_WEB_PAGES). (clean_misc): Remove *.ckd, *.ck instead of check_*, typecheck_*, $(TIME_T_ALTERNATIVES). Also remove *.core and core.*, for operating systems that do that. (long-long.ck, unsigned.ck): Remove stray assignment to typecheck_cflags, a shell variable that is not used. * NEWS: Mention this. * checknow.awk: .ckd, not .dir, is now the check directory extension. --- .gitignore | 4 +- Makefile | 211 +++++++++++++++++++++++++-------------------------- NEWS | 4 + checknow.awk | 2 +- 4 files changed, 110 insertions(+), 111 deletions(-) diff --git a/.gitignore b/.gitignore index ae9568e6..e7bb0416 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,10 @@ # This file is in the public domain. *.a *.asc +*.ck +*.ckd/ *.diff +*.dir/ *.i *.o *.orig @@ -18,7 +21,6 @@ *.zi *~ ChangeLog -check_* date leapseconds tzdir.h diff --git a/Makefile b/Makefile index a067f4ae..7a2cb00d 100644 --- a/Makefile +++ b/Makefile @@ -3,9 +3,9 @@ # 2009-05-17 by Arthur David Olson. # Request POSIX conformance; this must be the first non-comment line. .POSIX: -# On older platforms you may need to scrounge for a POSIX-conforming 'make'. -# For example, on Solaris 10 (2005), use /usr/sfw/bin/gmake or -# /usr/xpg4/bin/make, not /usr/ccs/bin/make. +# On older platforms you may need to scrounge for POSIX conformance. +# For example, on Solaris 10 (2005) with Sun Studio 12 aka Sun C 5.9 (2007), +# use 'PATH=/usr/xpg4/bin:$PATH make CC=c99'. # To affect how this Makefile works, you can run a shell script like this: # @@ -132,8 +132,9 @@ LIBDIR = $(TOPDIR)/$(USRDIR)/lib # Types to try, as an alternative to time_t. TIME_T_ALTERNATIVES = $(TIME_T_ALTERNATIVES_HEAD) $(TIME_T_ALTERNATIVES_TAIL) -TIME_T_ALTERNATIVES_HEAD = int_least64_t -TIME_T_ALTERNATIVES_TAIL = int_least32_t uint_least32_t uint_least64_t +TIME_T_ALTERNATIVES_HEAD = int_least64_t.ck +TIME_T_ALTERNATIVES_TAIL = int_least32_t.ck uint_least32_t.ck \ + uint_least64_t.ck # What kind of TZif data files to generate. (TZif is the binary time # zone data format that zic generates; see Internet RFC 8536.) @@ -584,8 +585,7 @@ MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.txt \ COMMON= calendars CONTRIBUTING LICENSE Makefile \ NEWS README SECURITY theory.html version WEB_PAGES= tz-art.html tz-how-to.html tz-link.html -CHECK_WEB_PAGES=check_theory.html check_tz-art.html \ - check_tz-how-to.html check_tz-link.html +CHECK_WEB_PAGES=theory.ck tz-art.ck tz-how-to.ck tz-link.ck DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES) PRIMARY_YDATA= africa antarctica asia australasia \ europe northamerica southamerica @@ -683,7 +683,7 @@ version: $(VERSION_DEPS) # These files can be tailored by setting BACKWARD, PACKRATDATA, PACKRATLIST. vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS) $(AWK) \ - -v DATAFORM=`expr $@ : '\(.*\).zi'` \ + -v DATAFORM=$(@:.zi=) \ -v PACKRATDATA='$(PACKRATDATA)' \ -v PACKRATLIST='$(PACKRATLIST)' \ -f ziguard.awk \ @@ -807,8 +807,7 @@ ZDS = dummy.zd # Rule used only by submakes invoked by the $(TZS_NEW) rule. # It is separate so that GNU 'make -j' can run instances in parallel. $(ZDS): zdump - ./zdump -i $(TZS_CUTOFF_FLAG) '$(wd)/'$$(expr $@ : '\(.*\).zd') \ - >$@ + ./zdump -i $(TZS_CUTOFF_FLAG) '$(wd)/'$(@:.zd=) >$@ TZS_NEW_DEPS = tzdata.zi zdump zic $(TZS_NEW): $(TZS_NEW_DEPS) @@ -830,7 +829,7 @@ $(TZS_NEW): $(TZS_NEW_DEPS) rm -fr tzs$(TZS_YEAR).dir mv $@.out $@ -# If $(TZS) exists but 'make check_tzs' fails, a maintainer should inspect the +# If $(TZS) exists but 'make tzs.ck' fails, a maintainer should inspect the # failed output and fix the inconsistency, perhaps by running 'make force_tzs'. $(TZS): touch $@ @@ -858,11 +857,11 @@ tzselect: tzselect.ksh version chmod +x $@.out mv $@.out $@ -check: check_back check_mild -check_mild: check_character_set check_white_space check_links \ - check_mainguard check_name_lengths check_now \ - check_slashed_abbrs check_sorted \ - check_tables check_web check_ziguard check_zishrink check_tzs +check: check_mild back.ck +check_mild: check_web check_zishrink \ + character-set.ck white-space.ck links.ck mainguard.ck \ + name-lengths.ck now.ck slashed-abbrs.ck sorted.ck \ + tables.ck ziguard.ck tzs.ck # True if UTF8_LOCALE does not work; # otherwise, false but with LC_ALL set to $(UTF8_LOCALE). @@ -872,7 +871,7 @@ UTF8_LOCALE_MISSING = \ | LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 \ || { LC_ALL='$(UTF8_LOCALE)'; export LC_ALL; false; }; } -check_character_set: $(ENCHILADA) +character-set.ck: $(ENCHILADA) $(UTF8_LOCALE_MISSING) || { \ sharp='#' && \ ! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \ @@ -887,7 +886,7 @@ check_character_set: $(ENCHILADA) } touch $@ -check_white_space: $(ENCHILADA) +white-space.ck: $(ENCHILADA) $(UTF8_LOCALE_MISSING) || { \ patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \ ! grep -En "$$pat|[$s]\$$" \ @@ -898,12 +897,12 @@ check_white_space: $(ENCHILADA) PRECEDES_FILE_NAME = ^(Zone|Link[$s]+[^$s]+)[$s]+ FILE_NAME_COMPONENT_TOO_LONG = $(PRECEDES_FILE_NAME)[^$s]*[^/$s]{15} -check_name_lengths: $(TDATA_TO_CHECK) backzone +name-lengths.ck: $(TDATA_TO_CHECK) backzone ! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \ $(TDATA_TO_CHECK) backzone touch $@ -check_mainguard: main.zi +mainguard.ck: main.zi test '$(PACKRATLIST)' || \ cat $(TDATA) $(PACKRATDATA) | diff -u - main.zi touch $@ @@ -914,26 +913,26 @@ RULELESS_SAVE = (-|$(STDOFF)[sd]?) RULELESS_SLASHED_ABBRS = \ $(PRECEDES_STDOFF)$(STDOFF)[$s]+$(RULELESS_SAVE)[$s]+[^$s]*/ -check_slashed_abbrs: $(TDATA_TO_CHECK) +slashed-abbrs.ck: $(TDATA_TO_CHECK) ! grep -En '$(RULELESS_SLASHED_ABBRS)' $(TDATA_TO_CHECK) touch $@ CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; } -check_sorted: backward backzone +sorted.ck: backward backzone $(AWK) '/^Link/ {printf "%.5d %s\n", g, $$3} !/./ {g++}' \ backward | LC_ALL=C sort -cu $(AWK) '/^Zone.*\// {print $$2}' backzone | LC_ALL=C sort -cu touch $@ -check_back: checklinks.awk $(TDATA_TO_CHECK) +back.ck: checklinks.awk $(TDATA_TO_CHECK) $(AWK) \ -v DATAFORM=$(DATAFORM) \ -v backcheck=backward \ -f checklinks.awk $(TDATA_TO_CHECK) touch $@ -check_links: checklinks.awk tzdata.zi +links.ck: checklinks.awk tzdata.zi $(AWK) \ -v DATAFORM=$(DATAFORM) \ -f checklinks.awk tzdata.zi @@ -945,33 +944,33 @@ check_links: checklinks.awk tzdata.zi # 2800+ years but that would take a long time to check. CHECK_NOW_TIMESTAMP = `./date +%s` CHECK_NOW_FUTURE_YEARS = 28 -CHECK_NOW_FUTURE_SECS = $(CHECK_NOW_FUTURE_YEARS) '*' 366 '*' 24 '*' 60 '*' 60 -check_now: checknow.awk date tzdata.zi zdump zic zone1970.tab zonenow.tab - rm -fr $@.dir - mkdir $@.dir - ./zic -d $@.dir tzdata.zi +CHECK_NOW_FUTURE_SECS = $(CHECK_NOW_FUTURE_YEARS) * 366 * 24 * 60 * 60 +now.ck: checknow.awk date tzdata.zi zdump zic zone1970.tab zonenow.tab + rm -fr $@d + mkdir $@d + ./zic -d $@d tzdata.zi now=$(CHECK_NOW_TIMESTAMP) && \ - future=`expr $(CHECK_NOW_FUTURE_SECS) + $$now` && \ + future=$$(($(CHECK_NOW_FUTURE_SECS) + $$now)) && \ ./zdump -i -t $$now,$$future \ - $$(find $$PWD/$@.dir/????*/ -type f) \ - >$@.dir/zdump-now.tab && \ + $$(find "$$PWD/$@d"/????*/ -type f) \ + >$@d/zdump-now.tab && \ ./zdump -i -t 0,$$future \ - $$(find $$PWD/$@.dir -name Etc -prune \ + $$(find "$$PWD/$@d" -name Etc -prune \ -o -type f ! -name '*.tab' -print) \ - >$@.dir/zdump-1970.tab + >$@d/zdump-1970.tab $(AWK) \ - -v zdump_table=$@.dir/zdump-now.tab \ + -v zdump_table=$@d/zdump-now.tab \ -f checknow.awk zonenow.tab $(AWK) \ 'BEGIN {print "-\t-\tUTC"} /^Zone/ {print "-\t-\t" $$2}' \ $(PRIMARY_YDATA) backward factory | \ $(AWK) \ - -v zdump_table=$@.dir/zdump-1970.tab \ + -v zdump_table=$@d/zdump-1970.tab \ -f checknow.awk - rm -fr $@.dir + rm -fr $@d touch $@ -check_tables: checktab.awk $(YDATA) backward zone.tab zone1970.tab +tables.ck: checktab.awk $(YDATA) backward zone.tab zone1970.tab for tab in $(ZONETABLES); do \ test "$$tab" = zone.tab && links='$(BACKWARD)' || links=''; \ $(AWK) -f checktab.awk -v zone_table=$$tab $(YDATA) $$links \ @@ -979,7 +978,7 @@ check_tables: checktab.awk $(YDATA) backward zone.tab zone1970.tab done touch $@ -check_tzs: $(TZS) $(TZS_NEW) +tzs.ck: $(TZS) $(TZS_NEW) if test -s $(TZS); then \ $(DIFF_TZS) $(TZS) $(TZS_NEW); \ else \ @@ -988,18 +987,15 @@ check_tzs: $(TZS) $(TZS_NEW) touch $@ check_web: $(CHECK_WEB_PAGES) -check_theory.html: theory.html -check_tz-art.html: tz-art.html -check_tz-how-to.html: tz-how-to.html -check_tz-link.html: tz-link.html -check_theory.html check_tz-art.html check_tz-how-to.html check_tz-link.html: +.SUFFIXES: .ck .html +.html.ck: { ! ($(CURL) --version) >/dev/null 2>&1 || \ $(CURL) -sS --url https://validator.w3.org/nu/ -F out=gnu \ - -F file=@$$(expr $@ : 'check_\(.*\)'); } >$@.out && \ + -F file=@$<; } >$@.out && \ test ! -s $@.out || { cat $@.out; exit 1; } mv $@.out $@ -check_ziguard: rearguard.zi vanguard.zi ziguard.awk +ziguard.ck: rearguard.zi vanguard.zi ziguard.awk $(AWK) -v DATAFORM=rearguard -f ziguard.awk vanguard.zi | \ diff -u rearguard.zi - $(AWK) -v DATAFORM=vanguard -f ziguard.awk rearguard.zi | \ @@ -1008,36 +1004,35 @@ check_ziguard: rearguard.zi vanguard.zi ziguard.awk # Check that zishrink.awk does not alter the data, and that ziguard.awk # preserves main-format data. -check_zishrink: check_zishrink_posix check_zishrink_right -check_zishrink_posix check_zishrink_right: \ +check_zishrink: zishrink-posix.ck zishrink-right.ck +zishrink-posix.ck zishrink-right.ck: \ zic leapseconds $(PACKRATDATA) $(PACKRATLIST) \ $(TDATA) $(DATAFORM).zi tzdata.zi - rm -fr $@.dir $@-t.dir $@-shrunk.dir - mkdir $@.dir $@-t.dir $@-shrunk.dir + rm -fr $@d t-$@d shrunk-$@d + mkdir $@d t-$@d shrunk-$@d case $@ in \ - *_right) leap='-L leapseconds';; \ + *right*) leap='-L leapseconds';; \ *) leap=;; \ esac && \ - $(ZIC) $$leap -d $@.dir $(DATAFORM).zi && \ - $(ZIC) $$leap -d $@-shrunk.dir tzdata.zi && \ + $(ZIC) $$leap -d $@d $(DATAFORM).zi && \ + $(ZIC) $$leap -d shrunk-$@d tzdata.zi && \ case $(DATAFORM),$(PACKRATLIST) in \ main,) \ - $(ZIC) $$leap -d $@-t.dir $(TDATA) && \ + $(ZIC) $$leap -d t-$@d $(TDATA) && \ $(AWK) '/^Rule/' $(TDATA) | \ - $(ZIC) $$leap -d $@-t.dir - $(PACKRATDATA) && \ - diff -r $@.dir $@-t.dir;; \ + $(ZIC) $$leap -d t-$@d - $(PACKRATDATA) && \ + diff -r $@d t-$@d;; \ esac - diff -r $@.dir $@-shrunk.dir - rm -fr $@.dir $@-t.dir $@-shrunk.dir + diff -r $@d shrunk-$@d + rm -fr $@d t-$@d shrunk-$@d touch $@ clean_misc: - rm -fr check_*.dir typecheck_*.dir - rm -f *.o *.out $(TIME_T_ALTERNATIVES) \ - check_* core typecheck_* \ + rm -fr *.ckd *.dir + rm -f *.ck *.core *.o *.out core core.* \ date tzdir.h tzselect version.h zdump zic libtz.a clean: clean_misc - rm -fr *.dir tzdb-*/ + rm -fr tzdb-*/ rm -f *.zi $(TZS_NEW) maintainer-clean: clean @@ -1048,7 +1043,7 @@ maintainer-clean: clean names: @echo $(ENCHILADA) -public: check check_public $(CHECK_TIME_T_ALTERNATIVES) \ +public: check public.ck $(CHECK_TIME_T_ALTERNATIVES) \ tarballs signatures date.1.txt: date.1 @@ -1062,7 +1057,7 @@ zdump.8.txt: zdump.8 zic.8.txt: zic.8 $(MANTXTS): workman.sh - LC_ALL=C sh workman.sh `expr $@ : '\(.*\)\.txt$$'` >$@.out + LC_ALL=C sh workman.sh $(@.txt=) >$@.out mv $@.out $@ # Set file timestamps deterministically if possible, @@ -1077,7 +1072,7 @@ SET_TIMESTAMP_N = sh -c '\ if test $$n != 0 && \ lsout=`ls -nt --time-style="+%s" "$$@" 2>/dev/null`; then \ set x $$lsout && \ - timestamp=`expr $$7 + $$n` && \ + timestamp=$$(($$7 + $$n)) && \ echo "+ touch -md @$$timestamp $$dest" && \ touch -md @$$timestamp "$$dest"; \ else \ @@ -1135,30 +1130,29 @@ set-tzs-timestamp.out: $(TZS) # The zics below ensure that each data file can stand on its own. # We also do an all-files run to catch links to links. -check_public: $(VERSION_DEPS) - rm -fr public.dir - mkdir public.dir - ln $(VERSION_DEPS) public.dir - cd public.dir \ +public.ck: $(VERSION_DEPS) + rm -fr $@d + mkdir $@d + ln $(VERSION_DEPS) $@d + cd $@d \ && $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' TZDIR='$(TZDIR)' ALL - for i in $(TDATA_TO_CHECK) public.dir/tzdata.zi \ - public.dir/vanguard.zi public.dir/main.zi \ - public.dir/rearguard.zi; \ + for i in $(TDATA_TO_CHECK) \ + tzdata.zi vanguard.zi main.zi rearguard.zi; \ do \ - public.dir/zic -v -d public.dir/zoneinfo $$i 2>&1 || exit; \ + $@d/zic -v -d $@d/zoneinfo $@d/$$i || exit; \ done - public.dir/zic -v -d public.dir/zoneinfo-all $(TDATA_TO_CHECK) + $@d/zic -v -d $@d/zoneinfo-all $(TDATA_TO_CHECK) : : Also check 'backzone' syntax. - rm public.dir/main.zi - cd public.dir && $(MAKE) PACKRATDATA=backzone main.zi - public.dir/zic -d public.dir/zoneinfo main.zi - rm public.dir/main.zi - cd public.dir && \ + rm $@d/main.zi + cd $@d && $(MAKE) PACKRATDATA=backzone main.zi + $@d/zic -d $@d/zoneinfo main.zi + rm $@d/main.zi + cd $@d && \ $(MAKE) PACKRATDATA=backzone PACKRATLIST=zone.tab main.zi - public.dir/zic -d public.dir/zoneinfo main.zi + $@d/zic -d $@d/zoneinfo main.zi : - rm -fr public.dir + rm -fr $@d touch $@ # Check that the code works under various alternative @@ -1166,11 +1160,11 @@ check_public: $(VERSION_DEPS) check_time_t_alternatives: $(TIME_T_ALTERNATIVES) $(TIME_T_ALTERNATIVES_TAIL): $(TIME_T_ALTERNATIVES_HEAD) $(TIME_T_ALTERNATIVES): $(VERSION_DEPS) - rm -fr $@.dir - mkdir $@.dir - ln $(VERSION_DEPS) $@.dir + rm -fr $@d + mkdir $@d + ln $(VERSION_DEPS) $@d case $@ in \ - int*32_t) range=-2147483648,2147483648;; \ + *32_t*) range=-2147483648,2147483648;; \ u*) range=0,4294967296;; \ *) range=-4294967296,4294967296;; \ esac && \ @@ -1181,31 +1175,31 @@ $(TIME_T_ALTERNATIVES): $(VERSION_DEPS) else \ range_target=to$$range.tzs; \ fi && \ - (cd $@.dir && \ - $(MAKE) TOPDIR="$$wd/$@.dir" \ - CFLAGS='$(CFLAGS) -Dtime_tz='"'$@'" \ + (cd $@d && \ + $(MAKE) TOPDIR="$$wd/$@d" \ + CFLAGS='$(CFLAGS) -Dtime_tz='"'$(@:.ck=)'" \ REDO='$(REDO)' \ - D=$$wd/$@.dir \ + D=$$wd/$@d \ TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \ install $$range_target) && \ test $@ = $(TIME_T_ALTERNATIVES_HEAD) || { \ - (cd $(TIME_T_ALTERNATIVES_HEAD).dir && \ - $(MAKE) TOPDIR="$$wd/$@.dir" \ + (cd $(TIME_T_ALTERNATIVES_HEAD)d && \ + $(MAKE) TOPDIR="$$wd/$@d" \ TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \ - D=$$wd/$@.dir \ + D=$$wd/$@d \ to$$range.tzs) && \ - $(DIFF_TZS) $(TIME_T_ALTERNATIVES_HEAD).dir/to$$range.tzs \ - $@.dir/to$$range.tzs && \ + $(DIFF_TZS) $(TIME_T_ALTERNATIVES_HEAD)d/to$$range.tzs \ + $@d/to$$range.tzs && \ if diff -q Makefile Makefile 2>/dev/null; then \ quiet_option='-q'; \ else \ quiet_option=''; \ fi && \ - diff $$quiet_option -r $(TIME_T_ALTERNATIVES_HEAD).dir/etc \ - $@.dir/etc && \ + diff $$quiet_option -r $(TIME_T_ALTERNATIVES_HEAD)d/etc \ + $@d/etc && \ diff $$quiet_option -r \ - $(TIME_T_ALTERNATIVES_HEAD).dir/usr/share \ - $@.dir/usr/share; \ + $(TIME_T_ALTERNATIVES_HEAD)d/usr/share \ + $@d/usr/share; \ } touch $@ @@ -1334,22 +1328,21 @@ $(ALL_ASC): $(GPG) --armor --detach-sign $? TYPECHECK_CFLAGS = $(CFLAGS) -DTYPECHECK -D__time_t_defined -D_TIME_T -typecheck: typecheck_long_long typecheck_unsigned -typecheck_long_long typecheck_unsigned: $(VERSION_DEPS) - rm -fr $@.dir - mkdir $@.dir - ln $(VERSION_DEPS) $@.dir - cd $@.dir && \ +typecheck: long-long.ck unsigned.ck +long-long.ck unsigned.ck: $(VERSION_DEPS) + rm -fr $@d + mkdir $@d + ln $(VERSION_DEPS) $@d + cd $@d && \ case $@ in \ - *_long_long) i="long long";; \ - *_unsigned ) i="unsigned" ;; \ + long-long.*) i="long long";; \ + unsigned.* ) i="unsigned" ;; \ esac && \ - typecheck_cflags='' && \ $(MAKE) \ CFLAGS="$(TYPECHECK_CFLAGS) \"-Dtime_t=$$i\"" \ TOPDIR="`pwd`" \ install - $@.dir/zdump -i -c 1970,1971 Europe/Rome + $@d/zdump -i -c 1970,1971 Europe/Rome touch $@ zonenames: tzdata.zi diff --git a/NEWS b/NEWS index b3f9ce20..1771c8dd 100644 --- a/NEWS +++ b/NEWS @@ -63,6 +63,10 @@ Unreleased, experimental changes 'make check' no longer requires curl and Internet access. + The build procedure now assumes POSIX.2-1992 or later, to simplify + maintenance. To build on Solaris 10, the only extant system still + defaulting to pre-POSIX, prepend /usr/xpg4/bin to PATH. + Release 2024a - 2024-02-01 09:28:56 -0800 diff --git a/checknow.awk b/checknow.awk index f0b8ed19..8b7881d2 100644 --- a/checknow.awk +++ b/checknow.awk @@ -14,7 +14,7 @@ BEGIN { if ($0 ~ /^TZ/) { record_zone(zone, data) zone = $0 - sub(/.*\.dir\//, "", zone) + sub(/.*\.ckd\//, "", zone) sub(/\/\//, "/", zone) sub(/"/, "", zone) data = "" -- 2.45.1

This is OK as Makefile now assumes POSIX.2-1992 or later. * Makefile (TARFLAGS, install, version, tzdata.zi) (version.h, $(TZS_NEW), tzselect, white-space.check) (CHECK_NOW_TIMESTAMP, SET_TIMESTAMP_N, set-timestamps.out) ($(TIME_T_ALTERNATIVES), signatures, rearguard_signatures) (traditional_signatures, version, set-timestamp.out, rearguard.zi) (vanguard.zi, tzdata$(VERSION)-tailored.tar.gz, long-long.check) (unsigned.check): Use $(CMD) instead of `CMD` in the Makefile, as this is less error-prone. --- Makefile | 56 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index 7a2cb00d..061a6d84 100644 --- a/Makefile +++ b/Makefile @@ -542,10 +542,10 @@ OK_LINE= '^'$(OK_CHAR)'*$$' GNUTARFLAGS= --format=pax --pax-option='delete=atime,delete=ctime' \ --numeric-owner --owner=0 --group=0 \ --mode=go+u,go-w --sort=name -TARFLAGS= `if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \ - then echo $(GNUTARFLAGS); \ - else :; \ - fi` +TARFLAGS= $$(if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \ + then echo $(GNUTARFLAGS); \ + else :; \ + fi) # Flags to give 'gzip' when making a distribution. GZIPFLAGS= -9n @@ -646,8 +646,8 @@ install: all $(DATA) $(REDO) $(MANS) '$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \ '$(DESTDIR)$(MANDIR)/man8' $(ZIC_INSTALL) -l $(LOCALTIME) \ - `case '$(POSIXRULES)' in ?*) echo '-p';; esac \ - ` $(POSIXRULES) \ + $$(case '$(POSIXRULES)' in ?*) echo ' -p';; esac) \ + $(POSIXRULES) \ -t '$(DESTDIR)$(TZDEFAULT)' cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.' cp tzselect '$(DESTDIR)$(BINDIR)/.' @@ -670,9 +670,9 @@ INSTALL: ALL install date.1 # and append "-dirty" if the contents do not already end in "-dirty". version: $(VERSION_DEPS) { (type git) >/dev/null 2>&1 && \ - V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \ - --abbrev=7 --dirty` || \ - if test '$(VERSION)' = unknown && V=`cat $@`; then \ + V=$$(git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \ + --abbrev=7 --dirty) || \ + if test '$(VERSION)' = unknown && V=$$(cat $@); then \ case $$V in *-dirty);; *) V=$$V-dirty;; esac; \ else \ V='$(VERSION)'; \ @@ -692,7 +692,7 @@ vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS) # This file has a version comment that attempts to capture any tailoring # via BACKWARD, DATAFORM, PACKRATDATA, PACKRATLIST, and REDO. tzdata.zi: $(DATAFORM).zi version zishrink.awk - version=`sed 1q version` && \ + version=$$(sed 1q version) && \ LC_ALL=C $(AWK) \ -v dataform='$(DATAFORM)' \ -v deps='$(DSTDATA_ZI_DEPS) zishrink.awk' \ @@ -713,7 +713,7 @@ tzdir.h: mv $@.out $@ version.h: version - VERSION=`cat version` && printf '%s\n' \ + VERSION=$$(cat version) && printf '%s\n' \ 'static char const PKGVERSION[]="($(PACKAGE)) ";' \ "static char const TZVERSION[]=\"$$VERSION\";" \ 'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";' \ @@ -816,10 +816,10 @@ $(TZS_NEW): $(TZS_NEW_DEPS) $(zic) -d tzs$(TZS_YEAR).dir tzdata.zi $(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \ tzdata.zi | LC_ALL=C sort >$@.out - wd=`pwd` && \ - x=`$(AWK) '/^Z/{print "tzs$(TZS_YEAR).dir/" $$2 ".zd"}' \ + wd=$$(pwd) && \ + x=$$($(AWK) '/^Z/{print "tzs$(TZS_YEAR).dir/" $$2 ".zd"}' \ tzdata.zi \ - | LC_ALL=C sort -t . -k 2,2` && \ + | LC_ALL=C sort -t . -k 2,2) && \ set x $$x && \ shift && \ ZDS=$$* && \ @@ -846,7 +846,7 @@ date: $(DATEOBJS) $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS) tzselect: tzselect.ksh version - VERSION=`cat version` && sed \ + VERSION=$$(cat version) && sed \ -e "s'#!/bin/bash'#!"'$(KSHELL)'\' \ -e s\''\(AWK\)=[^}]*'\''\1=\'\''$(AWK)\'\'\' \ -e s\''\(PKGVERSION\)=.*'\''\1=\'\''($(PACKAGE)) \'\'\' \ @@ -888,7 +888,7 @@ character-set.ck: $(ENCHILADA) white-space.ck: $(ENCHILADA) $(UTF8_LOCALE_MISSING) || { \ - patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \ + patfmt=' \t|[\f\r\v]' && pat=$$(printf "$$patfmt\\n") && \ ! grep -En "$$pat|[$s]\$$" \ $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list); \ } @@ -942,7 +942,7 @@ links.ck: checklinks.awk tzdata.zi # that zonenow.tab contains all sequences of planned timestamps, # without any duplicate sequences. In theory this might require # 2800+ years but that would take a long time to check. -CHECK_NOW_TIMESTAMP = `./date +%s` +CHECK_NOW_TIMESTAMP = $$(./date +%s) CHECK_NOW_FUTURE_YEARS = 28 CHECK_NOW_FUTURE_SECS = $(CHECK_NOW_FUTURE_YEARS) * 366 * 24 * 60 * 60 now.ck: checknow.awk date tzdata.zi zdump zic zone1970.tab zonenow.tab @@ -1070,13 +1070,13 @@ SET_TIMESTAMP_N = sh -c '\ n=$$0 dest=$$1; shift; \ <"$$dest" && \ if test $$n != 0 && \ - lsout=`ls -nt --time-style="+%s" "$$@" 2>/dev/null`; then \ + lsout=$$(ls -nt --time-style="+%s" "$$@" 2>/dev/null); then \ set x $$lsout && \ timestamp=$$(($$7 + $$n)) && \ echo "+ touch -md @$$timestamp $$dest" && \ touch -md @$$timestamp "$$dest"; \ else \ - newest=`ls -t "$$@" | sed 1q` && \ + newest=$$(ls -t "$$@" | sed 1q) && \ echo "+ touch -mr $$newest $$dest" && \ touch -mr "$$newest" "$$dest"; \ fi' @@ -1099,15 +1099,15 @@ SET_TIMESTAMP_DEP = $(SET_TIMESTAMP_N) 1 set-timestamps.out: $(EIGHT_YARDS) rm -f $@ if (type git) >/dev/null 2>&1 && \ - files=`git ls-files $(EIGHT_YARDS)` && \ + files=$$(git ls-files $(EIGHT_YARDS)) && \ touch -md @1 test.out; then \ rm -f test.out && \ for file in $$files; do \ if git diff --quiet $$file; then \ - time=`TZ=UTC0 git log -1 \ + time=$$(TZ=UTC0 git log -1 \ --format='tformat:%cd' \ --date='format:%Y-%m-%dT%H:%M:%SZ' \ - $$file` && \ + $$file) && \ echo "+ touch -md $$time $$file" && \ touch -md $$time $$file; \ else \ @@ -1116,7 +1116,7 @@ set-timestamps.out: $(EIGHT_YARDS) done; \ fi $(SET_TIMESTAMP_DEP) leapseconds $(LEAP_DEPS) - for file in `ls $(MANTXTS) | sed 's/\.txt$$//'`; do \ + for file in $$(ls $(MANTXTS) | sed 's/\.txt$$//'); do \ $(SET_TIMESTAMP_DEP) $$file.txt $$file workman.sh || \ exit; \ done @@ -1168,8 +1168,8 @@ $(TIME_T_ALTERNATIVES): $(VERSION_DEPS) u*) range=0,4294967296;; \ *) range=-4294967296,4294967296;; \ esac && \ - wd=`pwd` && \ - zones=`$(AWK) '/^[^#]/ { print $$3 }' <zone1970.tab` && \ + wd=$$(pwd) && \ + zones=$$($(AWK) '/^[^#]/ { print $$3 }' <zone1970.tab) && \ if test $@ = $(TIME_T_ALTERNATIVES_HEAD); then \ range_target=; \ else \ @@ -1214,7 +1214,7 @@ ALL_ASC = $(TRADITIONAL_ASC) $(REARGUARD_ASC) \ tarballs rearguard_tarballs tailored_tarballs traditional_tarballs \ signatures rearguard_signatures traditional_signatures: \ version set-timestamps.out rearguard.zi vanguard.zi - VERSION=`cat version` && \ + VERSION=$$(cat version) && \ $(MAKE) AWK='$(AWK)' VERSION="$$VERSION" $@_version # These *_version rules are intended for use if VERSION is set by some @@ -1286,7 +1286,7 @@ tzdata$(VERSION)-tailored.tar.gz: set-timestamps.out : The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier. cd $@.dir && \ $(CREATE_EMPTY) $(PRIMARY_YDATA) $(NDATA) backward \ - `test $(DATAFORM) = vanguard || echo pacificnew` + $$(test $(DATAFORM) = vanguard || echo pacificnew) (grep '^#' tzdata.zi && echo && cat $(DATAFORM).zi) \ >$@.dir/etcetera touch -mr tzdata.zi $@.dir/etcetera @@ -1340,7 +1340,7 @@ long-long.ck unsigned.ck: $(VERSION_DEPS) esac && \ $(MAKE) \ CFLAGS="$(TYPECHECK_CFLAGS) \"-Dtime_t=$$i\"" \ - TOPDIR="`pwd`" \ + TOPDIR="$$(pwd)" \ install $@d/zdump -i -c 1970,1971 Europe/Rome touch $@ -- 2.45.1

This is OK as Makefile now assumes POSIX.2-1992 or later. * Makefile ($(ZDS), $(TZS_NEW), now.check, $(TIME_T_ALTERNATIVES)) (long-long.check, unsigned.check): Prefer $PWD to $(pwd), as it's a bit faster and is more likely to match user desires. --- Makefile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 061a6d84..624cb461 100644 --- a/Makefile +++ b/Makefile @@ -807,7 +807,7 @@ ZDS = dummy.zd # Rule used only by submakes invoked by the $(TZS_NEW) rule. # It is separate so that GNU 'make -j' can run instances in parallel. $(ZDS): zdump - ./zdump -i $(TZS_CUTOFF_FLAG) '$(wd)/'$(@:.zd=) >$@ + ./zdump -i $(TZS_CUTOFF_FLAG) "$$PWD/$(@:.zd=)" >$@ TZS_NEW_DEPS = tzdata.zi zdump zic $(TZS_NEW): $(TZS_NEW_DEPS) @@ -816,14 +816,13 @@ $(TZS_NEW): $(TZS_NEW_DEPS) $(zic) -d tzs$(TZS_YEAR).dir tzdata.zi $(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \ tzdata.zi | LC_ALL=C sort >$@.out - wd=$$(pwd) && \ x=$$($(AWK) '/^Z/{print "tzs$(TZS_YEAR).dir/" $$2 ".zd"}' \ tzdata.zi \ | LC_ALL=C sort -t . -k 2,2) && \ set x $$x && \ shift && \ ZDS=$$* && \ - $(MAKE) wd="$$wd" TZS_CUTOFF_FLAG="$(TZS_CUTOFF_FLAG)" \ + $(MAKE) TZS_CUTOFF_FLAG="$(TZS_CUTOFF_FLAG)" \ ZDS="$$ZDS" $$ZDS && \ sed 's,^TZ=".*\.dir/,TZ=",' $$ZDS >>$@.out rm -fr tzs$(TZS_YEAR).dir @@ -1168,7 +1167,7 @@ $(TIME_T_ALTERNATIVES): $(VERSION_DEPS) u*) range=0,4294967296;; \ *) range=-4294967296,4294967296;; \ esac && \ - wd=$$(pwd) && \ + wd=$$PWD && \ zones=$$($(AWK) '/^[^#]/ { print $$3 }' <zone1970.tab) && \ if test $@ = $(TIME_T_ALTERNATIVES_HEAD); then \ range_target=; \ @@ -1179,14 +1178,14 @@ $(TIME_T_ALTERNATIVES): $(VERSION_DEPS) $(MAKE) TOPDIR="$$wd/$@d" \ CFLAGS='$(CFLAGS) -Dtime_tz='"'$(@:.ck=)'" \ REDO='$(REDO)' \ - D=$$wd/$@d \ + D="$$wd/$@d" \ TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \ install $$range_target) && \ test $@ = $(TIME_T_ALTERNATIVES_HEAD) || { \ (cd $(TIME_T_ALTERNATIVES_HEAD)d && \ $(MAKE) TOPDIR="$$wd/$@d" \ TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \ - D=$$wd/$@d \ + D="$$wd/$@d" \ to$$range.tzs) && \ $(DIFF_TZS) $(TIME_T_ALTERNATIVES_HEAD)d/to$$range.tzs \ $@d/to$$range.tzs && \ @@ -1340,7 +1339,7 @@ long-long.ck unsigned.ck: $(VERSION_DEPS) esac && \ $(MAKE) \ CFLAGS="$(TYPECHECK_CFLAGS) \"-Dtime_t=$$i\"" \ - TOPDIR="$$(pwd)" \ + TOPDIR="$$PWD" \ install $@d/zdump -i -c 1970,1971 Europe/Rome touch $@ -- 2.45.1

This speeds up builds a bit. These changes are safe now that Makefile assumes POSIX.2-1992 or later. * Makefile (GNUTARFLAGS): Omit now-harmful quoting. (SETUP_TAR): New macro, replacing TARFLAGS. All uses changed. (SETUP_DIFF_TZS): New macro, replacing DIFF_TZS. All uses changed. (install): Assume POSIXRULES is nonempty, which it must be nowadays. (version, tzdata.zi, version.h, tzselect, tarballs) (rearguard_tarballs, tailored_tarballs, traditional_tarballs) (signatures, rearguard_signatures, traditional_signatures): Use ‘read -r’ rather than a subshell. (version, white-space.ck, set-timestamps.out): Simplify by using ${var%...}. (tzdata$(VERSION)-tailored.tar.gz): Redo to avoid subshell. --- Makefile | 76 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 31 deletions(-) diff --git a/Makefile b/Makefile index 624cb461..0ca3edda 100644 --- a/Makefile +++ b/Makefile @@ -539,21 +539,28 @@ OK_LINE= '^'$(OK_CHAR)'*$$' # Flags to give 'tar' when making a distribution. # Try to use flags appropriate for GNU tar. -GNUTARFLAGS= --format=pax --pax-option='delete=atime,delete=ctime' \ +GNUTARFLAGS= --format=pax --pax-option=delete=atime,delete=ctime \ --numeric-owner --owner=0 --group=0 \ --mode=go+u,go-w --sort=name -TARFLAGS= $$(if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \ - then echo $(GNUTARFLAGS); \ - else :; \ - fi) +SETUP_TAR= \ + LC_ALL=C && export LC_ALL && \ + if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; then \ + TAR='tar $(GNUTARFLAGS)'; \ + else \ + TAR=tar; \ + fi # Flags to give 'gzip' when making a distribution. GZIPFLAGS= -9n # When comparing .tzs files, use GNU diff's -F'^TZ=' option if supported. # This makes it easier to see which Zone has been affected. -DIFF_TZS= diff -u$$(! diff -u -F'^TZ=' - - <>/dev/null >&0 2>&1 \ - || echo ' -F^TZ=') +SETUP_DIFF_TZS = \ + if diff -u -F'^TZ=' - - <>/dev/null >&0 2>&1; then \ + DIFF_TZS='diff -u -F^TZ='; \ + else \ + DIFF_TZS='diff -u'; \ + fi # ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib. RANLIB= : @@ -646,8 +653,7 @@ install: all $(DATA) $(REDO) $(MANS) '$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \ '$(DESTDIR)$(MANDIR)/man8' $(ZIC_INSTALL) -l $(LOCALTIME) \ - $$(case '$(POSIXRULES)' in ?*) echo ' -p';; esac) \ - $(POSIXRULES) \ + -p $(POSIXRULES) \ -t '$(DESTDIR)$(TZDEFAULT)' cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.' cp tzselect '$(DESTDIR)$(BINDIR)/.' @@ -672,8 +678,8 @@ version: $(VERSION_DEPS) { (type git) >/dev/null 2>&1 && \ V=$$(git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \ --abbrev=7 --dirty) || \ - if test '$(VERSION)' = unknown && V=$$(cat $@); then \ - case $$V in *-dirty);; *) V=$$V-dirty;; esac; \ + if test '$(VERSION)' = unknown && read -r V <$@; then \ + V=$${V%-dirty}-dirty; \ else \ V='$(VERSION)'; \ fi; } && \ @@ -692,7 +698,7 @@ vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS) # This file has a version comment that attempts to capture any tailoring # via BACKWARD, DATAFORM, PACKRATDATA, PACKRATLIST, and REDO. tzdata.zi: $(DATAFORM).zi version zishrink.awk - version=$$(sed 1q version) && \ + read -r version <version && \ LC_ALL=C $(AWK) \ -v dataform='$(DATAFORM)' \ -v deps='$(DSTDATA_ZI_DEPS) zishrink.awk' \ @@ -713,7 +719,7 @@ tzdir.h: mv $@.out $@ version.h: version - VERSION=$$(cat version) && printf '%s\n' \ + read -r VERSION <version && printf '%s\n' \ 'static char const PKGVERSION[]="($(PACKAGE)) ";' \ "static char const TZVERSION[]=\"$$VERSION\";" \ 'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";' \ @@ -845,7 +851,7 @@ date: $(DATEOBJS) $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS) tzselect: tzselect.ksh version - VERSION=$$(cat version) && sed \ + read -r VERSION <version && sed \ -e "s'#!/bin/bash'#!"'$(KSHELL)'\' \ -e s\''\(AWK\)=[^}]*'\''\1=\'\''$(AWK)\'\'\' \ -e s\''\(PKGVERSION\)=.*'\''\1=\'\''($(PACKAGE)) \'\'\' \ @@ -887,9 +893,11 @@ character-set.ck: $(ENCHILADA) white-space.ck: $(ENCHILADA) $(UTF8_LOCALE_MISSING) || { \ + enchilada='$(ENCHILADA)' && \ patfmt=' \t|[\f\r\v]' && pat=$$(printf "$$patfmt\\n") && \ ! grep -En "$$pat|[$s]\$$" \ - $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list); \ + $${enchilada%leap-seconds.list*} \ + $${enchilada#*leap-seconds.list}; \ } touch $@ @@ -979,7 +987,7 @@ tables.ck: checktab.awk $(YDATA) backward zone.tab zone1970.tab tzs.ck: $(TZS) $(TZS_NEW) if test -s $(TZS); then \ - $(DIFF_TZS) $(TZS) $(TZS_NEW); \ + $(SETUP_DIFF_TZS) && $$DIFF_TZS $(TZS) $(TZS_NEW); \ else \ cp $(TZS_NEW) $(TZS); \ fi @@ -1115,8 +1123,8 @@ set-timestamps.out: $(EIGHT_YARDS) done; \ fi $(SET_TIMESTAMP_DEP) leapseconds $(LEAP_DEPS) - for file in $$(ls $(MANTXTS) | sed 's/\.txt$$//'); do \ - $(SET_TIMESTAMP_DEP) $$file.txt $$file workman.sh || \ + for file in $(MANTXTS); do \ + $(SET_TIMESTAMP_DEP) $$file $${file%.txt} workman.sh || \ exit; \ done $(SET_TIMESTAMP_DEP) version $(VERSION_DEPS) @@ -1187,7 +1195,8 @@ $(TIME_T_ALTERNATIVES): $(VERSION_DEPS) TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \ D="$$wd/$@d" \ to$$range.tzs) && \ - $(DIFF_TZS) $(TIME_T_ALTERNATIVES_HEAD)d/to$$range.tzs \ + $(SETUP_DIFF_TZS) && \ + $$DIFF_TZS $(TIME_T_ALTERNATIVES_HEAD)d/to$$range.tzs \ $@d/to$$range.tzs && \ if diff -q Makefile Makefile 2>/dev/null; then \ quiet_option='-q'; \ @@ -1213,7 +1222,7 @@ ALL_ASC = $(TRADITIONAL_ASC) $(REARGUARD_ASC) \ tarballs rearguard_tarballs tailored_tarballs traditional_tarballs \ signatures rearguard_signatures traditional_signatures: \ version set-timestamps.out rearguard.zi vanguard.zi - VERSION=$$(cat version) && \ + read -r VERSION <version && \ $(MAKE) AWK='$(AWK)' VERSION="$$VERSION" $@_version # These *_version rules are intended for use if VERSION is set by some @@ -1232,15 +1241,15 @@ rearguard_signatures_version: $(REARGUARD_ASC) traditional_signatures_version: $(TRADITIONAL_ASC) tzcode$(VERSION).tar.gz: set-timestamps.out - LC_ALL=C && export LC_ALL && \ - tar $(TARFLAGS) -cf - \ + $(SETUP_TAR) && \ + $$TAR -cf - \ $(COMMON) $(DOCS) $(SOURCES) | \ gzip $(GZIPFLAGS) >$@.out mv $@.out $@ tzdata$(VERSION).tar.gz: set-timestamps.out - LC_ALL=C && export LC_ALL && \ - tar $(TARFLAGS) -cf - $(TZDATA_DIST) | \ + $(SETUP_TAR) && \ + $$TAR -cf - $(TZDATA_DIST) | \ gzip $(GZIPFLAGS) >$@.out mv $@.out $@ @@ -1265,9 +1274,9 @@ tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-timestamps.out : The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier. $(CREATE_EMPTY) $@.dir/pacificnew touch -mr version $@.dir/version - LC_ALL=C && export LC_ALL && \ + $(SETUP_TAR) && \ (cd $@.dir && \ - tar $(TARFLAGS) -cf - \ + $$TAR -cf - \ $(TZDATA_DIST) pacificnew | \ gzip $(GZIPFLAGS)) >$@.out mv $@.out $@ @@ -1283,9 +1292,14 @@ tzdata$(VERSION)-tailored.tar.gz: set-timestamps.out rm -fr $@.dir mkdir $@.dir : The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier. + if test $(DATAFORM) = vanguard; then \ + pacificnew=; \ + else \ + pacificnew=pacificnew; \ + fi && \ cd $@.dir && \ $(CREATE_EMPTY) $(PRIMARY_YDATA) $(NDATA) backward \ - $$(test $(DATAFORM) = vanguard || echo pacificnew) + $$pacificnew (grep '^#' tzdata.zi && echo && cat $(DATAFORM).zi) \ >$@.dir/etcetera touch -mr tzdata.zi $@.dir/etcetera @@ -1305,9 +1319,9 @@ tzdata$(VERSION)-tailored.tar.gz: set-timestamps.out test -f $@.dir/$$file || links="$$links $$file"; \ done && \ ln $$links $@.dir - LC_ALL=C && export LC_ALL && \ + $(SETUP_TAR) && \ (cd $@.dir && \ - tar $(TARFLAGS) -cf - * | gzip $(GZIPFLAGS)) >$@.out + $$TAR -cf - * | gzip $(GZIPFLAGS)) >$@.out mv $@.out $@ tzdb-$(VERSION).tar.lz: set-timestamps.out set-tzs-timestamp.out @@ -1315,8 +1329,8 @@ tzdb-$(VERSION).tar.lz: set-timestamps.out set-tzs-timestamp.out mkdir tzdb-$(VERSION) ln $(ENCHILADA) tzdb-$(VERSION) $(SET_TIMESTAMP) tzdb-$(VERSION) tzdb-$(VERSION)/* - LC_ALL=C && export LC_ALL && \ - tar $(TARFLAGS) -cf - tzdb-$(VERSION) | lzip -9 >$@.out + $(SETUP_TAR) && \ + $$TAR -cf - tzdb-$(VERSION) | lzip -9 >$@.out mv $@.out $@ tzcode$(VERSION).tar.gz.asc: tzcode$(VERSION).tar.gz -- 2.45.1

* tzselect.ksh: Use $(...) instead of `...`. --- NEWS | 4 +++ tzselect.ksh | 82 ++++++++++++++++++++++++---------------------------- 2 files changed, 42 insertions(+), 44 deletions(-) diff --git a/NEWS b/NEWS index 1771c8dd..92984445 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,7 @@ Unreleased, experimental changes The main data form now uses %z. The code now conforms to RFC 8536 for early timestamps. Support POSIX.1-2024, which removes asctime_r and ctime_r. + Assume POSIX.2-1992 or later for shell scripts. Improve historical data for Portugal and possessions. Changes to data @@ -59,6 +60,9 @@ Unreleased, experimental changes can overrun user buffers. If you still need them, add -DSUPPORT_POSIX2008 to CFLAGS. + tzselect now assumes POSIX.2-1992 or later, as practical porting + targets now all support this. + Changes to build procedure 'make check' no longer requires curl and Internet access. diff --git a/tzselect.ksh b/tzselect.ksh index 38941bbc..8a80cd67 100644 --- a/tzselect.ksh +++ b/tzselect.ksh @@ -20,12 +20,6 @@ REPORT_BUGS_TO=tz@iana.org # Korn Shell <http://www.kornshell.com/> # MirBSD Korn Shell <http://www.mirbsd.org/mksh.htm> # -# For portability to Solaris 10 /bin/sh (supported by Oracle through -# January 2027) this script avoids some POSIX features and common -# extensions, such as $(...), $((...)), ! CMD, unquoted ^, ${#ID}, -# ${ID##PAT}, ${ID%%PAT}, and $10. Although some of these constructs -# work sometimes, it's simpler to avoid them entirely. -# # This script also uses several features of POSIX awk. # If your host lacks awk, or has an old awk that does not conform to POSIX, # you can use any of the following free programs instead: @@ -45,7 +39,7 @@ set -f # Specify default values for environment variables if they are unset. : ${AWK=awk} -: ${PWD=`pwd`} +: ${PWD=$(pwd)} : ${TZDIR=$PWD} # Output one argument as-is to standard output, with trailing newline. @@ -118,7 +112,7 @@ else doselect() { # Field width of the prompt numbers. print_nargs_length="BEGIN {print length(\"$#\");}" - select_width=`$AWK "$print_nargs_length"` + select_width=$($AWK "$print_nargs_length") select_i= @@ -129,14 +123,14 @@ else select_i=0 for select_word do - select_i=`$AWK "BEGIN { print $select_i + 1 }"` + select_i=$($AWK "BEGIN { print $select_i + 1 }") printf >&2 "%${select_width}d) %s\\n" $select_i "$select_word" done;; *[!0-9]*) echo >&2 'Please enter a number in range.';; *) if test 1 -le $select_i && test $select_i -le $#; then - shift `$AWK "BEGIN { print $select_i - 1 }"` + shift $($AWK "BEGIN { print $select_i - 1 }") select_result=$1 break fi @@ -170,7 +164,7 @@ do esac done -shift `$AWK "BEGIN { print $OPTIND - 1 }"` +shift $($AWK "BEGIN { print $OPTIND - 1 }") case $# in 0) ;; *) say >&2 "$0: $1: unknown argument"; exit 1 @@ -192,10 +186,10 @@ fi # if that does not work, fall back on 'cat'. read_file() { { $translit && { - eval "$1=\`(iconv -f UTF-8 -t //TRANSLIT) 2>/dev/null <\"\$2\"\`" || - eval "$1=\`(iconv -f UTF-8) 2>/dev/null <\"\$2\"\`" + eval "$1=\$( (iconv -f UTF-8 -t //TRANSLIT) 2>/dev/null <\"\$2\")" || + eval "$1=\$( (iconv -f UTF-8) 2>/dev/null <\"\$2\")" }; } || - eval "$1=\`cat <\"\$2\"\`" || { + eval "$1=\$(cat <\"\$2\")" || { say >&2 "$0: time zone files are not set up correctly" exit 1 } @@ -403,7 +397,7 @@ while echo >&2 \ 'Please select a continent, ocean, "coord", "TZ", "time", or "now".' - quoted_continents=` + quoted_continents=$( $AWK ' function handle_entry(entry) { entry = substr(entry, 1, index(entry, "/") - 1) @@ -433,7 +427,7 @@ while sort -u | tr '\n' ' ' echo '' - ` + ) eval ' doselect '"$quoted_continents"' \ @@ -507,14 +501,14 @@ while '74 degrees 3 minutes west.' read coord esac - distance_table=` + distance_table=$( $AWK \ "$output_distances_or_times" \ ="$coord" ="$TZ_COUNTRY_TABLE" ="$TZ_ZONE_TABLE" | sort -n | $AWK "{print} NR == $location_limit { exit }" - ` - regions=` + ) + regions=$( $AWK ' BEGIN { distance_table = substr(ARGV[1], 2) @@ -526,13 +520,13 @@ while } } ' ="$distance_table" - ` + ) echo >&2 'Please select one of the following timezones,' echo >&2 'listed roughly in increasing order' \ "of distance from $coord". doselect $regions region=$select_result - tz=` + tz=$( $AWK ' BEGIN { distance_table = substr(ARGV[1], 2) @@ -546,22 +540,22 @@ while } } ' ="$distance_table" ="$region" - `;; + );; *) case $continent in now|time) minute_format='%a %b %d %H:%M' - old_minute=`TZ=UTC0 date +"$minute_format"` + old_minute=$(TZ=UTC0 date +"$minute_format") for i in 1 2 3 do - time_table_command=` + time_table_command=$( $AWK \ -v output_times=1 \ "$output_distances_or_times" \ = = ="$TZ_ZONE_TABLE" - ` - time_table=`eval "$time_table_command"` - new_minute=`TZ=UTC0 date +"$minute_format"` + ) + time_table=$(eval "$time_table_command") + new_minute=$(TZ=UTC0 date +"$minute_format") case $old_minute in "$new_minute") break esac @@ -569,11 +563,11 @@ while done echo >&2 "The system says Universal Time is $new_minute." echo >&2 "Assuming that's correct, what is the local time?" - sorted_table=`say "$time_table" | sort -k2n -k2,5 -k1n` || { + sorted_table=$(say "$time_table" | sort -k2n -k2,5 -k1n) || { say >&2 "$0: cannot sort time table" exit 1 } - eval doselect ` + eval doselect $( $AWK ' BEGIN { sorted_table = substr(ARGV[1], 2) @@ -590,10 +584,10 @@ while } } ' ="$sorted_table" - ` + ) time=$select_result continent_re='^' - zone_table=` + zone_table=$( $AWK ' BEGIN { time = substr(ARGV[1], 2) @@ -609,13 +603,13 @@ while } } ' ="$time" ="$time_table" - ` - countries=` + ) + countries=$( $AWK \ "$output_country_list" \ ="$continent_re" ="$TZ_COUNTRY_TABLE" ="$zone_table" | sort -f - ` + ) ;; *) continent_re="^$continent/" @@ -623,16 +617,16 @@ while esac # Get list of names of countries in the continent or ocean. - countries=` + countries=$( $AWK \ "$output_country_list" \ ="$continent_re" ="$TZ_COUNTRY_TABLE" ="$zone_table" | sort -f - ` + ) # If all zone table entries have comments, and there are # at most 22 entries, asked based on those comments. # This fits the prompt onto old-fashioned 24-line screens. - regions=` + regions=$( $AWK ' BEGIN { TZ_ZONE_TABLE = substr(ARGV[1], 2) @@ -653,7 +647,7 @@ while print comment[i] } ' ="$zone_table" - ` + ) # If there's more than one country, ask the user which one. case $countries in @@ -669,7 +663,7 @@ while # Get list of timezones in the country. - regions=` + regions=$( $AWK ' BEGIN { country = substr(ARGV[1], 2) @@ -696,7 +690,7 @@ while } } ' ="$country" ="$TZ_COUNTRY_TABLE" ="$zone_table" - ` + ) # If there's more than one region, ask the user which one. case $regions in @@ -707,7 +701,7 @@ while esac # Determine tz from country and region. - tz=` + tz=$( $AWK ' BEGIN { country = substr(ARGV[1], 2) @@ -735,7 +729,7 @@ while } } ' ="$country" ="$region" ="$TZ_COUNTRY_TABLE" ="$zone_table" - ` + ) esac # Make sure the corresponding zoneinfo file exists. @@ -754,8 +748,8 @@ while extra_info= for i in 1 2 3 4 5 6 7 8 do - TZdate=`LANG=C TZ="$TZ_for_date" date` - UTdate=`LANG=C TZ=UTC0 date` + TZdate=$(LANG=C TZ="$TZ_for_date" date) + UTdate=$(LANG=C TZ=UTC0 date) if $AWK ' function getsecs(d) { return match(d, /.*:[0-5][0-9]/) ? substr(d, RLENGTH - 1, 2) : "" -- 2.45.1

--- tzselect.ksh | 1 - 1 file changed, 1 deletion(-) diff --git a/tzselect.ksh b/tzselect.ksh index 8a80cd67..756ff887 100644 --- a/tzselect.ksh +++ b/tzselect.ksh @@ -39,7 +39,6 @@ set -f # Specify default values for environment variables if they are unset. : ${AWK=awk} -: ${PWD=$(pwd)} : ${TZDIR=$PWD} # Output one argument as-is to standard output, with trailing newline. -- 2.45.1

--- tzselect.ksh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tzselect.ksh b/tzselect.ksh index 756ff887..a76bce64 100644 --- a/tzselect.ksh +++ b/tzselect.ksh @@ -47,13 +47,6 @@ say() { printf '%s\n' "$1" } -# Check for awk POSIX compliance. -($AWK -v x=y 'BEGIN { exit 123 }') <>/dev/null >&0 2>&0 -[ $? = 123 ] || { - say >&2 "$0: Sorry, your '$AWK' program is not POSIX compatible." - exit 1 -} - coord= location_limit=10 zonetabtype=zone1970 -- 2.45.1

* tzselect.ksh: Instead of awk, use ${##}, $((...)), ${V##...}, ${V%%...}. This OK now that tzselect assumes POSIX.2-1992. --- tzselect.ksh | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tzselect.ksh b/tzselect.ksh index a76bce64..b1625b03 100644 --- a/tzselect.ksh +++ b/tzselect.ksh @@ -103,8 +103,7 @@ then else doselect() { # Field width of the prompt numbers. - print_nargs_length="BEGIN {print length(\"$#\");}" - select_width=$($AWK "$print_nargs_length") + select_width=${##} select_i= @@ -115,14 +114,14 @@ else select_i=0 for select_word do - select_i=$($AWK "BEGIN { print $select_i + 1 }") + select_i=$(($select_i + 1)) printf >&2 "%${select_width}d) %s\\n" $select_i "$select_word" done;; *[!0-9]*) echo >&2 'Please enter a number in range.';; *) if test 1 -le $select_i && test $select_i -le $#; then - shift $($AWK "BEGIN { print $select_i - 1 }") + shift $(($select_i - 1)) select_result=$1 break fi @@ -156,7 +155,7 @@ do esac done -shift $($AWK "BEGIN { print $OPTIND - 1 }") +shift $(($OPTIND - 1)) case $# in 0) ;; *) say >&2 "$0: $1: unknown argument"; exit 1 @@ -742,12 +741,9 @@ while do TZdate=$(LANG=C TZ="$TZ_for_date" date) UTdate=$(LANG=C TZ=UTC0 date) - if $AWK ' - function getsecs(d) { - return match(d, /.*:[0-5][0-9]/) ? substr(d, RLENGTH - 1, 2) : "" - } - BEGIN { exit getsecs(ARGV[1]) != getsecs(ARGV[2]) } - ' ="$TZdate" ="$UTdate" + TZsecsetc=${TZdate##*[0-5][0-9]:} + UTsecsetc=${UTdate##*[0-5][0-9]:} + if test "${TZsecsetc%%[!0-9]*}" = "${UTsecsetc%%[!0-9]*}" then extra_info=" Selected time is now: $TZdate. -- 2.45.1

* NEWS: Mention this. * tzselect.ksh (CUNEIFORM_SIGN_URU_TIMES_KI): New variable. This uses $'...' if available, which avoids an awk invocation in the typical case when Bash is used. $'...' is available in ksh93, bash-2.0 (1996), and any shell conforming to POSIX.1-2024. (translit): Use it. --- NEWS | 3 ++- tzselect.ksh | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 92984445..6b71212c 100644 --- a/NEWS +++ b/NEWS @@ -61,7 +61,8 @@ Unreleased, experimental changes -DSUPPORT_POSIX2008 to CFLAGS. tzselect now assumes POSIX.2-1992 or later, as practical porting - targets now all support this. + targets now all support this. Also, tzselect uses some features + from POSIX.1-2024 if available. Changes to build procedure diff --git a/tzselect.ksh b/tzselect.ksh index b1625b03..811645c2 100644 --- a/tzselect.ksh +++ b/tzselect.ksh @@ -163,11 +163,13 @@ esac # translit=true to try transliteration. # This is false if U+12345 CUNEIFORM SIGN URU TIMES KI has length 1 -# which means awk (and presumably the shell) do not need transliteration. -if $AWK 'BEGIN { u12345 = "\360\222\215\205"; exit length(u12345) == 1 }'; then - translit=true -else - translit=false +# which means the shell and (presumably) awk do not need transliteration. +# It is true if the byte string has some other length in characters, or +# if this is a POSIX.1-2017 or earlier shell that does not support $'...'. +CUNEIFORM_SIGN_URU_TIMES_KI=$'\360\222\215\205' +if test ${#CUNEIFORM_SIGN_URU_TIMES_KI} = 1 +then translit=false +else translit=true fi # Read into shell variable $1 the contents of file $2. -- 2.45.1

This is OK now that we assume POSIX.2-1992. * Makefile (SETUP_TAR, UTF8_LOCALE_MISSING): * tzselect.ksh (line): * workman.sh (GROFF_NO_SGR): Use ‘export VAR=VAL’ instead of ‘VAR=VAL; export VAR’. --- Makefile | 4 ++-- tzselect.ksh | 2 +- workman.sh | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 0ca3edda..8eefce0c 100644 --- a/Makefile +++ b/Makefile @@ -543,7 +543,7 @@ GNUTARFLAGS= --format=pax --pax-option=delete=atime,delete=ctime \ --numeric-owner --owner=0 --group=0 \ --mode=go+u,go-w --sort=name SETUP_TAR= \ - LC_ALL=C && export LC_ALL && \ + export LC_ALL=C && \ if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; then \ TAR='tar $(GNUTARFLAGS)'; \ else \ @@ -874,7 +874,7 @@ UTF8_LOCALE_MISSING = \ { test ! '$(UTF8_LOCALE)' \ || ! printf 'A\304\200B\n' \ | LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 \ - || { LC_ALL='$(UTF8_LOCALE)'; export LC_ALL; false; }; } + || { export LC_ALL='$(UTF8_LOCALE)'; false; }; } character-set.ck: $(ENCHILADA) $(UTF8_LOCALE_MISSING) || { \ diff --git a/tzselect.ksh b/tzselect.ksh index 811645c2..48159afd 100644 --- a/tzselect.ksh +++ b/tzselect.ksh @@ -785,7 +785,7 @@ done case $SHELL in *csh) file=.login line="setenv TZ '$tz'";; -*) file=.profile line="TZ='$tz'; export TZ" +*) file=.profile line="export TZ='$tz'" esac test -t 1 && say >&2 " diff --git a/workman.sh b/workman.sh index 6e2da3a8..29f317cb 100644 --- a/workman.sh +++ b/workman.sh @@ -7,8 +7,7 @@ if (type nroff && type perl) >/dev/null 2>&1; then # Tell groff not to emit SGR escape sequences (ANSI color escapes). - GROFF_NO_SGR=1 - export GROFF_NO_SGR + export GROFF_NO_SGR=1 echo ".am TH .hy 0 -- 2.45.1

* Makefile (LEAPSECONDS, install_data): Remove. All uses removed. (posix_only, right_only): Invoke $(ZIC_INSTALL) directly rather than indirectly via a submake. This saves a process and avoids a core dump in Solaris 10 /usr/xpg4/bin/make. --- Makefile | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 8eefce0c..b6ed36e2 100644 --- a/Makefile +++ b/Makefile @@ -440,11 +440,6 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 \ #LDFLAGS = #MAKE = make -# For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in -# submake command lines. The default is no leap seconds. - -LEAPSECONDS= - # Where to fetch leap-seconds.list from. leaplist_URI = \ https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list @@ -466,7 +461,7 @@ ZFLAGS= # How to use zic to install TZif files. -ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS) +ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' # The name of a POSIX-compliant 'awk' on your system. # mawk 1.3.3 and Solaris 10 /usr/bin/awk do not work. @@ -759,12 +754,11 @@ commit-leap-seconds.list: fetch-leap-seconds.list git commit --author="$$author" --date="$$date" -m'make $@' \ leap-seconds.list -# Arguments to pass to submakes of install_data. +# Arguments to pass to submakes. # They can be overridden by later submake arguments. INSTALLARGS = \ BACKWARD='$(BACKWARD)' \ DESTDIR='$(DESTDIR)' \ - LEAPSECONDS='$(LEAPSECONDS)' \ PACKRATDATA='$(PACKRATDATA)' \ PACKRATLIST='$(PACKRATLIST)' \ TZDEFAULT='$(TZDEFAULT)' \ @@ -773,16 +767,11 @@ INSTALLARGS = \ INSTALL_DATA_DEPS = zic leapseconds tzdata.zi -# 'make install_data' installs one set of TZif files. -install_data: $(INSTALL_DATA_DEPS) - $(ZIC_INSTALL) tzdata.zi - posix_only: $(INSTALL_DATA_DEPS) - $(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data + $(ZIC_INSTALL) tzdata.zi right_only: $(INSTALL_DATA_DEPS) - $(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \ - install_data + $(ZIC_INSTALL) -L leapseconds tzdata.zi # In earlier versions of this makefile, the other two directories were # subdirectories of $(TZDIR). However, this led to configuration errors. @@ -1374,7 +1363,7 @@ zic.o: private.h tzfile.h tzdir.h version.h .PHONY: check_web check_zishrink .PHONY: clean clean_misc commit-leap-seconds.list dummy.zd .PHONY: fetch-leap-seconds.list force_tzs -.PHONY: install install_data maintainer-clean names +.PHONY: install maintainer-clean names .PHONY: posix_only posix_right public .PHONY: rearguard_signatures rearguard_signatures_version .PHONY: rearguard_tarballs rearguard_tarballs_version -- 2.45.1

* Makefile (name-lengths.ck, slashed-abbrs.ck): Do not begin a make command line with ‘!’, as this runs afoul of a Solaris make incompatibility with POSIX. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b6ed36e2..97a88535 100644 --- a/Makefile +++ b/Makefile @@ -894,7 +894,7 @@ PRECEDES_FILE_NAME = ^(Zone|Link[$s]+[^$s]+)[$s]+ FILE_NAME_COMPONENT_TOO_LONG = $(PRECEDES_FILE_NAME)[^$s]*[^/$s]{15} name-lengths.ck: $(TDATA_TO_CHECK) backzone - ! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \ + :;! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \ $(TDATA_TO_CHECK) backzone touch $@ @@ -910,7 +910,7 @@ RULELESS_SLASHED_ABBRS = \ $(PRECEDES_STDOFF)$(STDOFF)[$s]+$(RULELESS_SAVE)[$s]+[^$s]*/ slashed-abbrs.ck: $(TDATA_TO_CHECK) - ! grep -En '$(RULELESS_SLASHED_ABBRS)' $(TDATA_TO_CHECK) + :;! grep -En '$(RULELESS_SLASHED_ABBRS)' $(TDATA_TO_CHECK) touch $@ CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; } -- 2.45.1
participants (1)
-
Paul Eggert