Bug#773390: uscan: add opts="pagemangle=s/data-realurl/href/" feature

Osamu Aoki osamu at debian.org
Sun Aug 23 13:11:04 UTC 2015


Hi,

As I tried to make uscan compatible with multiple upstream source, I am
getting familiar with uscan's strange mechanism and its parsing of watch
file.  (watch file is really designed to be easy for the uscan programmer.
Not so easy for users.)

Any new feature can be added backward compatible way via additional
opts= line.  Its ugly but easy to code.

Requested feature on https://bugs.debian.org/773390 can be generalized
by running string substitution over the downloaded page.

Around line 990 of uscan, I see:
        if ($content =~ m%^<[?]xml%i &&
            $content =~ m%xmlns="http://s3.amazonaws.com/doc/2006-03-01/"%) {
            # this is an S3 bucket listing.  Insert an 'a href' tag
            # into the content for each 'Key', so that it looks like html (LP: #798293)
            print STDERR "$progname debug: fixing s3 listing\n" if $debug;
            $content =~ s%<Key>([^<]*)</Key>%<Key><a href="$1">$1</a></Key>%g
        }

This is a hack to address Amazon only.  Adding more like this is easy
but it is ugly.  Let's add opts="pagemangle=s/data-realurl/href/"
feature which allow us to specify arbitrary substitution rule.

What does other think of this idea for feature bloat.

Osamu 



More information about the devscripts-devel mailing list