On 14/12/2025 16:25, Brian Inglis via Cygwin-apps wrote:
Hi folks,
I noticed an issue with my most recent build of tzdata, where it is
downloading leap-seconds.list, which changes every 6 months, so needs
accessed with its unique id, which is the NTP timestamp suffixed name in
the link on the FTP site.
So in tzdata.cygport I retrieve the verbatim symlink using wget and
readlink the NTP timestamp suffixed name, adding that name to SRC_URI.
Everything works fine locally, including srcpkg, but Scallywag now
complains it can not publish the artifacts because it puts a wget
argument into a tar command line and fails?
For comparison, `cygport ... vars SRC_URI` displays the correct URIs.
See any failing tzdata job recently for more details than the failure:
scallywag: publishing artifacts
scallywag: staging/tzdata/tzdata-2025c-1-src.hint
scallywag: staging/tzdata/tzdata-2025c-1-src.tar.xz
tar: unrecognized option '--retr-sym=no'
Try 'tar --help' or 'tar --usage' for more information.
Traceback (most recent call last):
File "/cygdrive/d/a/scallywag/scallywag/./scallywag", line 195, in
<module>
subprocess.check_call('tar -Jcf %s *' % (os.path.join(mydir,
'builddir.tar.xz')),
File "/usr/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'tar -Jcf /cygdrive/d/a/
scallywag/scallywag/builddir.tar.xz *' returned non-zero exit status 64.
Error: Process completed with exit code 1.
Huh. This is a weird one.
I think what's happening is that there's a file or directory named
'--retr-sym=no' which is being picked up by the glob here and then tar
tries to interpret it as an argument.
So I guess a '--' is needed here to protect against that.
LS_URI=ftp://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list
LS_NTP=$(/usr/bin/wget -NqP ${T:-$TMPDIR} --retr-sym=no $LS_URI &&
readlink ${T-$TMPDIR}/${LS_URI##*/})
SRC_URI+=" ${LS_URI%/*}/$LS_NTP"
PATCH_URI=
Very clever, but I think this deserves a comment to explain what's going on!
I guess that means that ${T:-$TMPDIR} is evaluating to empty, so
'--retr-sym=no' is taken as the argument to '-P'?
(In passing, I notice that the ':' is missing in the second instance in
this line, is that intended?)
Despite being described as "globals" $T and friends aren't set until
after the .cygport file has been sourced (so are only in scope for
src_compile() etc. (this all revolves around that we can't definitively
know the name of our working directory until after we've sourced the
cygport to have it set NAME, VERSION, RELEASE...)
It appears that only TMP and TEMP are set the the login profile in a
default installation, which seems like a bit of an omission?