Re: Need help with uscan
Andrius Merkys <andrius.merkys@gmail.com> writes:
> I want to package unversioned source. AFAIK, it should be possible to
> have timestamp of the last tarball change in lieu of upstream version.
Yes, that is feasible.
> I am wondering if it would be possible to write uscan rules to extract
> the timestamp and download the upstream tarball by analyzing [the HTML
> of the index page]
I don't know enough about hacking UScan for custom mangling like that.
AFAIK, the mangling that UScan does is built into the tool, I don't know
about custom extensions.
So the only way I know to do this is to write some script that would be
invoked by something other than UScan, for example in a custom Debian
maintainer workflow for this package.
What I would advise for using timestamp as version:
* Allow for some future upstream release to have SemVer-conforming
version strings (for example, if upstream decides to begin making
versioned releases). That means: Ensure the fake version strings you
use will all sort earlier than any future “first release” from
upstream.
Practically, this means: Precede your fake version string with “0”.
* Use the special-character rules of Debian package version comparison
to place the timestamp.
Practically, this means: Use “+” separator between the “0” prefix and
the timestamp.
* Format the timestamp so that it works like a version string, that it
avoids characters reserved for Debian release suffix, and so that
consecutive values will sort correctly as version strings.
Practically, this means: Use only “.” to separate components of the
timestamp.
So, for an upstream source tarball with timestamp “2013-03-12T12:16”,
mangle that to the version string “0+2013.03.12.12.16” (and hence the
first Debian release of that upstream source has the Debian package
version string “0+2013.03.12.12.16-1”).
You can reduce the precision of the timestamp, for example to omit the
time-of-day, “0+2013.03.12”. That will still allow for multiple releases
on one day (just include the timestamp for subsequent releases on that
day) while being easier for a human to understand and still retaining
correct ordering semantics by DPkg.
Reply to: