Dear Maintainer,
I'm maintaining a package for which things are bit unusual. I would like that
on tracker.debian.org & qa.debian.org which rely on https://qa.debian.org/cgi-bin/watch report if there is a new upstream version available.
In my case, I need to get the latest version from an XML file.
This files contains a date/time which is used to determine the version of the
package in debian in the format of a timestamp.
In the usptream XML there is:
<!--Generated on 2023-06-08 14:28:41.521115 with ADRT.-->
The debian package version would be
1686227321
Now concerning uscan, I would need the ability to convert
from "2023-06-08 14:28:41.521115" to "1686227321"
I tried with `uversionmangle="s///e"` (ie with 'e' flag), something like this
`'s/(.*)/({ eval "date --date$1 +%s"})/ee'` but this returns: 'flags must
consist of "gix"'.
And maybe this would be some security issue to support that "e" flag.
Maybe it would be safer to support a "date" operation in mangle formulas.
You can find attached a patch which would add support for:
`uversionmangle=date//%s/`
It converts the input to the format given in parameter (here %s) and run date
--date='input' +%d
You may update/fix/improve that patch, perl is rather foreign to me. I just
wanted to check if that would be possible.
That feature may also be useful for those having to convert date/time between
upstream format & debian format. For example like:
YYYY-MM-DD → YYYYMMDD
DD-MM-YYYY → YYYYMMDD
DDMMYYYY → YYYYMMDD
YYYY-MM-DD → TIMESTAMP
TIMESTAMP → YYYYMMDD
...
Regards
Fab
--- /etc/devscripts.conf ---
Empty.
--- ~/.devscripts ---
Empty.