found 423669 2.10.6 submitter 423669 ! thanks On Sun, 08 Jul, 2007 at 01:22:01AM +0530, Varun Hiremath wrote: > > Please find attached a patch to fix this temporarily using wget.
Sorry, there was a small bug in the previous patch:
- if ($site =~ m%^http(s)://%) {
+ if ($site =~ m%^http(s)?://%) {
I missed the '?'
So, please find attached the correct patch.
Regards
Varun
--
Varun Hiremath
Undergraduate Student,
Aerospace Engineering Department,
Indian Institute of Technology Madras,
Chennai, India
---------------------------------------
Homepage : http://varun.travisbsd.org
--- uscan.orig.pl 2007-07-08 00:43:15.000000000 +0530
+++ uscan.pl 2007-07-08 22:00:30.000000000 +0530
@@ -748,7 +748,7 @@
# What is the most recent file, based on the filenames?
# We first have to find the candidates, then we sort them using
# Devscripts::Versort::versort
- if ($site =~ m%^http(s)?://%) {
+ if ($site =~ m%^http://%) {
if (defined($1) and !$haveSSL) {
die "$progname: you must have the libcrypt-ssleay-perl package
installed\nto use https URLs\n";
}
@@ -814,6 +814,67 @@
return 1;
}
}
+ elsif ($site =~ m%^https://%) {
+ print STDERR "$progname debug: requesting URL $base\n" if $debug;
+ # Added by Varun Hiremath <[EMAIL PROTECTED]>
+ # https support using wget
+ if (system("command -v wget >/dev/null 2>&1") != 0) {
+ die "$progname: this program requires the wget package to be
installed\n";
+ }
+ my $content = `wget --no-check-certificate -q -O - $base`;
+ print STDERR "$progname debug: received content:\n$content\[End of
received content]\n"
+ if $debug;
+ # We need this horrid stuff to handle href=foo type
+ # links. OK, bad HTML, but we have to handle it nonetheless.
+ # It's bug #89749.
+ $content =~ s/href\s*=\s*(?=[^\"\'])([^\s>]+)/href="$1"/ig;
+ # Strip comments
+ $content =~ s/<!-- .*?-->//sg;
+ # Is there a base URL given?
+ if ($content =~ /<\s*base\s+[^>]*href\s*=\s*([\"\'])(.*?)\1/) {
+ # Ensure it ends with /
+ $urlbase = "$2/";
+ $urlbase =~ s%//$%/%;
+ } else {
+ # May have to strip a base filename
+ ($urlbase = $base) =~ s%/[^/]*$%/%;
+ }
+
+ print STDERR "$progname debug: matching pattern $pattern\n" if $debug;
+ my @hrefs;
+ while ($content =~ m/<\s*a\s+[^>]*href\s*=\s*([\"\'])(.*?)\1/gi) {
+ my $href = $2;
+ if ($href =~ m&^$pattern$&) {
+ if ($watch_version == 2) {
+ # watch_version 2 only recognised one group; the code
+ # below will break version 2 watchfiles with a construction
+ # such as file-([\d\.]+(-\d+)?) (bug #327258)
+ push @hrefs, [$1, $href];
+ } else {
+ # need the map { ... } here to handle cases of (...)?
+ # which may match but then return undef values
+ my $mangled_version =
+ join(".", map { $_ if defined($_) }
+ $href =~ m&^$pattern$&);
+ foreach my $pat (@{$options{'uversionmangle'}}) {
+ eval "\$mangled_version =~ $pat;";
+ }
+ push @hrefs, [$mangled_version, $href];
+ }
+ }
+ }
+ if (@hrefs) {
+ if ($verbose) {
+ print "-- Found the following matching hrefs:\n";
+ foreach my $href (@hrefs) { print " $$href[1]\n"; }
+ }
+ @hrefs = Devscripts::Versort::versort(@hrefs);
+ ($newversion, $newfile) = @{$hrefs[0]};
+ } else {
+ warn "$progname warning: In $watchfile,\n no matching hrefs for
watch line\n $line\n";
+ return 1;
+ }
+ }
else {
# Better be an FTP site
if ($site !~ m%^ftp://%) {
@@ -914,7 +975,7 @@
eval "\$newfile_base =~ $pat;";
}
# Remove HTTP header trash
- if ($site =~ m%^http://%) {
+ if ($site =~ m%^http(s)?://%) {
$newfile_base =~ s/\?.*$//;
# just in case this leaves us with nothing
if ($newfile_base eq '') {
@@ -933,7 +994,7 @@
# So what have we got to report now?
my $upstream_url;
# Upstream URL? Copying code from below - ugh.
- if ($site =~ m%^http://%) {
+ if ($site =~ m%^http(s)?://%) {
# absolute URL?
if ($newfile =~ m%^\w+://%) {
$upstream_url = $newfile;
@@ -1069,6 +1130,14 @@
return 1;
}
}
+ elsif ($upstream_url =~ m%^https://%) {
+ print STDERR "$progname debug: requesting URL $upstream_url\n" if
$debug;
+ # Added by Varun Hiremath <[EMAIL PROTECTED]>
+ # https support using wget
+ if(system("wget --no-check-certificate \"$upstream_url\" -O
../$newfile_base") !=0){
+ die "$progname: wget failed: $!\n";
+ }
+ }
else {
# FTP site
if (exists $options{'pasv'}) {
signature.asc
Description: Digital signature

