This URL is helpful
https://api.ftp-master.debian.org/file_in_archive/%25git2cl%5C_3.0.orig.tar.xz
According to the docs:
"""
Check if a file pattern is known to the archive. Note that the
patterns are matched against the location of the files in the
pool, so for %tmux_2.3-1.dsc it will return t/tmux/tmux_2.3-1.dsc
as filename.
.. versionadded:: October 2016
:param filepattern: Pattern of the filenames to match. SQL LIKE
statement wildcard matches are supported, that
is % for zero, one or more characters, _ for a
single character match.
:return: List of dictionaries made out of
- filename
- sha256sum
- component
"""
$ curl -Ss
'https://api.ftp-master.debian.org/file_in_archive/%25git2cl%5C_3.0.orig.tar.xz'
| jq
[
{
"filename": "g/git2cl/git2cl_3.0.orig.tar.xz",
"component": "main",
"sha256sum":
"c16fb604903d7a370fd15c10323195a3f86e89f5016bdd8e718e9f31d50d323c"
}
]
We then have to find the file in the archive and actually download
it - but dgit has machinery for that already since it knows how to
turn a dsc record from the ftpmaster API into files on the local disk.
This should be a new dgit subcommand `dgit obtain-orig-from-archive`
or something.
One wrinkle is that ideally we want this to work even if the orig
upload is very recent and there hasn't been a mirror pulse. Is there
a way to have the builder go via some Debian-internal method?
Ian.