Your message dated Tue, 27 Aug 2013 20:47:11 +0200
with message-id <[email protected]>
and subject line Re: Bug#719701: [PATCH] allow Vcs-Upstream-* tags
has caused the Debian Bug report #719699,
regarding [PATCH] use Vcs-Upstream-* when --upstream is used
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
719699: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719699
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: devscripts
Severity: wishlist
Tags: patch

Dear maintainer,

attached you can find a patch which adds an option called --upstream.
With that option, debcheckout will look for Vcs-Upstream-* tags instead
of Vcs-* tags.

Thanks in advance for merging it.
>From fb0201a084c5e1705580bc9915b9535207e76acf Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <[email protected]>
Date: Wed, 14 Aug 2013 13:58:14 +0200
Subject: [PATCH] use Vcs-Upstream-* when --upstream is used

---
 scripts/debcheckout.pl |   30 ++++++++++++++++++++++--------
 1 file changed, 22 insertions(+), 8 deletions(-)

diff --git a/scripts/debcheckout.pl b/scripts/debcheckout.pl
index 8e1dd61..6bed620 100755
--- a/scripts/debcheckout.pl
+++ b/scripts/debcheckout.pl
@@ -80,6 +80,11 @@ for Subversion repositories hosted on alioth this means that
 S<I<svn+ssh://svn.debian.org/...>> will be used instead of
 S<I<svn://svn.debian.org/...>>.
 
+=item B<-U>, B<--upstream>
+
+Instead of looking for Vcs-* tags, look for Vcs-Upstream-* tags. If set, these
+point to the upstream repository/browser.
+
 =item B<-d>, B<--details>
 
 Only print a list of detailed information about the package
@@ -316,8 +321,8 @@ sub recurs_mkdir {
 
 # Find the repository URL (and type) for a given package name, parsing Vcs-*
 # fields.  Returns (version, type, url, origtgz_name) tuple.
-sub find_repo($$) {
-    my ($pkg, $desired_ver) = @_;
+sub find_repo($$$) {
+    my ($pkg, $desired_ver, $upstream) = @_;
     my @repo = ("", 0, "", "");
     my $found = 0;
     my ($nonepoch_version, $version) = ("", "");
@@ -330,7 +335,10 @@ sub find_repo($$) {
     while (my $line = <APT>) {
 	$found = 1;
 	chomp($line);
-	if ($line =~ /^(x-)?vcs-(\w+):\s*(.*)$/i) {
+	if ($upstream && $line =~ /^(x-)?vcs-upstream-(\w+):\s*(.*)$/i) {
+	    next if lc($2) eq "browser";
+	    ($type, $url) = (lc($2), $3);
+	} elsif (!$upstream && $line =~ /^(x-)?vcs-(\w+):\s*(.*)$/i) {
 	    next if lc($2) eq "browser";
 	    ($type, $url) = (lc($2), $3);
 	} elsif ($line =~ /^Version:\s*(.*)$/i) {
@@ -359,8 +367,8 @@ sub find_repo($$) {
 }
 
 # Find the browse URL for a given package name, parsing Vcs-* fields.
-sub find_browse($$) {
-    my ($pkg, $desired_ver) = @_;
+sub find_browse($$$) {
+    my ($pkg, $desired_ver, $upstream) = @_;
     my $browse = "";
     my $found = 0;
     my $version = "";
@@ -370,7 +378,11 @@ sub find_browse($$) {
     while (my $line = <APT>) {
 	$found = 1;
 	chomp($line);
-	if ($line =~ /^(x-)?vcs-(\w+):\s*(.*)$/i) {
+	if ($upstream && $line =~ /^(x-)?vcs-upstream-(\w+):\s*(.*)$/i) {
+	    if (lc($2) eq "browser") {
+		$browse = $3;
+	    }
+	} elsif (!$upstream && $line =~ /^(x-)?vcs-(\w+):\s*(.*)$/i) {
 	    if (lc($2) eq "browser") {
 		$browse = $3;
 	    }
@@ -982,6 +994,7 @@ sub main() {
     my $user = "";	  # login name (authenticated mode only)
     my $browse_url = "";    # online browsable repository URL
     my $git_track = "";     # list of remote GIT branches to --track
+    my $upstream = 0;       # whether to check out the upstream git
     my $unpack_source = $config_vars{DEBCHECKOUT_SOURCE}; # retrieve and unpack orig.tar.gz
     GetOptions(
 	"auth|a" => \$auth,
@@ -994,6 +1007,7 @@ sub main() {
 	"file|f=s" => sub { push(@files, $_[1]); },
 	"git-track=s" => \$git_track,
 	"source=s" => \$unpack_source,
+	"upstream|U" => \$upstream,
 	) or pod2usage({-exitval => 3});
     pod2usage({-exitval => 3}) if ($#ARGV < 0 or $#ARGV > 1);
     pod2usage({-exitval => 3,
@@ -1033,7 +1047,7 @@ sub main() {
 	}
 
     } else {  # package name passed on the command line
-	($version, $repo_type, $repo_url, $origtgz_name) = find_repo($pkg, $version);
+	($version, $repo_type, $repo_url, $origtgz_name) = find_repo($pkg, $version, $upstream);
 	unless ($repo_type) {
 	    my $vermsg = "";
 	    $vermsg = ", version $version" if length $version;
@@ -1058,7 +1072,7 @@ and it will not be possible to commit them directly.
 EOF
             exit(1);
 	}
-	$browse_url = find_browse($pkg, $version) if @files;
+	$browse_url = find_browse($pkg, $version, $upstream) if @files;
     }
 
     $repo_url = munge_url($repo_type, $repo_url);
-- 
1.7.10.4


--- End Message ---
--- Begin Message ---
Hi Guillem,

Guillem Jover <[email protected]> writes:

> On Wed, 2013-08-14 at 15:08:16 +0200, Michael Stapelberg wrote:
>> Guillem Jover <[email protected]> writes:
>> > Currently there's already several possible places this information can
>> > be listed, adding yet another one does not help matters. There's also
>> > proposals around to unify upstream information in a single place,
>> > either
>
>> Can you point me to these proposals please?
>
> The information currently could be found in debian/copyright,
> debian/README.source, debian/rules get-orig-source target, the
> proposal to extend the debian/watch file [0] and the draft proposal
> of debian/upstream (DEP12) [1].
>
> [0] <https://lists.debian.org/debian-devel/2009/04/msg00087.html>
> [1] <https://lists.debian.org/debian-project/2013/01/msg00004.html>
>
> Also while looking for these I stumbled over an old proposal for
> exactly this which I had forgotten:
>
>   <http://lists.debian.org/debian-devel/2011/04/msg00356.html>
>
> Given the above I'm tempted to just tag this wontfix for now and close
> it as long as there's no consensus on the project about the best place
> to put this. Meanwhile, for experimenting purposes one can always use
> XS- field specifiers.
Agreed, thus closing the relevant bugs. Thanks.

-- 
Best regards,
Michael

--- End Message ---
_______________________________________________
devscripts-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/devscripts-devel

Reply via email to