[devscripts] 01/05: uscan: Clear cached redirection URLs each watch line
James McCoy
jamessan at debian.org
Wed Jun 10 03:34:07 UTC 2015
This is an automated email from the git hooks/post-receive script.
jamessan pushed a commit to branch master
in repository devscripts.
commit 110f8be9511db8cb6c4b7248952ae4e39fe41fef
Author: James McCoy <jamessan at debian.org>
Date: Tue Jun 9 20:27:28 2015 -0400
uscan: Clear cached redirection URLs each watch line
When the matched href isn't a full URL, uscan uses the redirected URLs
to build a full URL. Since the redirections weren't being cleared, when
processing multiple watch files/lines, old redirect URLs were being used
as candidates for the full URL.
Closes: #736063
Signed-off-by: James McCoy <jamessan at debian.org>
---
debian/changelog | 6 +++++-
scripts/uscan.pl | 9 +++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index 8cac5c1..fb1d716 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -32,7 +32,11 @@ devscripts (2.15.5) UNRELEASED; urgency=medium
parameters. (Closes: #786706)
* debuild: Recognize -jauto as a valid option. Based on a patch by Reiner
Herrmann. (Closes: #787276)
- * uscan: Fix Github example in man page. (Closes: #757194)
+ * uscan:
+ + Fix Github example in man page. (Closes: #757194)
+ + Clear cached redirection URLs every time a watch line is processed.
+ This ensures any relative URLs are built into absolute URLs using
+ relevant sites. (Closes: #736063)
* Devscripts::Debbugs: Retrieve bug status in chunks to avoid building large
responses on bugs.d.o.
diff --git a/scripts/uscan.pl b/scripts/uscan.pl
index 92d84f0..119a741 100755
--- a/scripts/uscan.pl
+++ b/scripts/uscan.pl
@@ -426,6 +426,11 @@ sub get_redirections {
return \@uscan_redirections;
}
+sub clear_redirections {
+ undef @uscan_redirections;
+ return;
+}
+
package main;
my $user_agent = LWP::UserAgent::UscanCatchRedirections->new(env_proxy => 1);
@@ -742,6 +747,10 @@ sub process_watchline ($$$$$$)
my $headers = HTTP::Headers->new;
my ($keyring, $gpghome);
+ # Need to clear remembered redirection URLs so we don't try to build URLs
+ # from previous watch files or watch lines
+ $user_agent->clear_redirections;
+
# Comma-separated list of features that sites being queried might
# want to be aware of
$headers->header('X-uscan-features' => 'enhanced-matching');
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git
More information about the devscripts-devel
mailing list