#614802 [uscan] watch file syntax for taking version from timestamp

Package:
devscripts
Source:
devscripts
Description:
scripts to make the life of a Debian Package maintainer easier
Submitter:
Date:
2015-11-09 15:15:11 UTC
Severity:
wishlist
#614802#5
Date:
2011-02-23 14:59:20 UTC
From:
To:
The upstream developer of the scheme9 package silently dumps new
versions of the upstream tarball, with the same name, in a specified
location.

http://t3x.org/s9fes.tgz

The version can be determined in one of two ways.

Either unpack the tarball, find a specific line, and parse it:

  $ tar --to-stdout --extract --file ../scheme9_2011.02.18.orig.tar.gz s9/s9.c | egrep '^[#]define +VERSION'
  #define VERSION "2010-11-13"

Or use the timestamp from the headers:

  $ curl --silent --remote-time --remote-name http://t3x.org/s9fes.tgz
  $ ls -l s9fes.tgz
  -rw-rw-r-- 1 barak barak 483351 Feb 18 07:11 s9fes.tgz
  $ mv s9fes.tgz scheme9_$(stat --format '%y' s9fes.tgz | awk '{print $1}' | tr - .).orig.tar.gz
  $ ls -l scheme9_2011.02.18.orig.tar.gz
  -rw-rw-r-- 1 barak barak 483351 Feb 18 07:11 scheme9_2011.02.18.orig.tar.gz

Ideally, uscan would have some way to support each of these.

(And yes, I do have a strong stomach; why do you ask?)

#614802#14
Date:
2015-11-09 15:11:08 UTC
From:
To:
control: forcemerge 279236 614802

Hi,

There are 2 bugs on timetstamp.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=279236
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614802

If full URL path contain version, we can use it but if timestamp is the
only way, it is nice to have some mechanism to use uscan.  (I agree it
is ugly situation.)

I think solution is the same as #517637
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=517637#44

@YYYMMDD@
@YYMMDD@

But for this, we need a way to get the timesamp of the remote file which
we seem to lack now.

Here is my reminder:

For FTP: http://stackoverflow.com/questions/21698309/lwpuseragent-retrieve-file-date-and-time-from-ftp-directory-listing

http://lwp.interglacial.com/ch03_05.htm :
The Last-Modified header contains a timestamp indicating when the
content was last modified, but it is sometimes not present.

  $lm = $response->last_modified( );


http://www.perlmonks.org/?node_id=179063 :

#!/usr/bin/perl -w

use strict;
use LWP::Simple;

my ($content_type, $document_length, $modified_time, $expires, $server
+) = head("http://www.gnu.org/index.html");
$modified_time = localtime($modified_time) if $modified_time;
print "Modified: " . ($modified_time ? $modified_time : "Unknown") . "
+\n";

exit;

https://books.google.co.jp/books?id=1Cp2-ydxKj4C&pg=PA184&lpg=PA184&dq=perl+LWP+file+timestamp&source=bl&ots=FGZUiFxGw6&sig=K01o4Y2H-HIR-kDRv2mBkdG958s&hl=ja&sa=X&ved=0CE0Q6AEwBWoVChMI7IWCvs2DyQIVpoOmCh2VMgJx#v=onepage&q=perl%20LWP%20file%20timestamp&f=false





If anyone has patch, I welcome it.

Osamu