On Fri, Apr 19, 2024 at 10:48:10PM +0700, Robert Elz wrote: > Date: Fri, 19 Apr 2024 14:58:18 +0000 > From: "Jonathan A. Kollasch" <jakll...@netbsd.org> > Message-ID: <20240419145818.351d2f...@cvs.netbsd.org> > > | - bail out if resulting __DATE__/__TIME__ replacement strings are empty > > If you want to do that (not that it would be useful, even if the %b > (etc) conversions produced nothing, there would still be two spaces > in the output. It is almost impossible to get date to exit with an > error code (and nothing on stdout) in cases like this. > > But if this is worth keeping, then > > if ${MKREPRO_TIME} == "" || ${MKREPRO_TIME} == "" > > probably is not what you wanted.
I've tested this with MKREPRO_TIMESTAMP=RandomNonNumericString, and MKREPRO_TIME/MKREPRO_DATE came out "" when nbdate produced a non-zero exit status and a warning message. I wish nbmake could actually error when it gets a non-zero exit status there, but it merely spouts a warning and continues. I've spent enough time looking at this.