From dcb9d9bafc9f0587011d8ff84a1f1837d66b4bdc Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 21 Jul 2017 14:39:35 -0700 Subject: generate d/watch for GitHub projects recommended by uscan(1) --- debian/changelog | 4 ++++ lib/DhMakeELPA/Command/Packaging.pm | 22 +++++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index ab82835..d164a70 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,10 @@ dh-make-elpa (0.9) UNRELEASED; urgency=medium * Stop generating binary dependency on 'emacsen-common'. dh-elpa adds to ${misc:Depends}. + * When the 'upstream' remote is GitHub, generate a watch file using + the GitHub releases page, rather than using mode=git. + This is less taxing on the QA servers checking for new upstream + releases (see uscan(1)). -- Sean Whitton Fri, 21 Jul 2017 14:14:22 -0700 diff --git a/lib/DhMakeELPA/Command/Packaging.pm b/lib/DhMakeELPA/Command/Packaging.pm index 24dcf40..d2737ac 100644 --- a/lib/DhMakeELPA/Command/Packaging.pm +++ b/lib/DhMakeELPA/Command/Packaging.pm @@ -306,7 +306,7 @@ sub create_docs { # TODO again, assumes tags are of the form v1.0.0 sub create_watch { my $self = shift; - my ( $repo, $upstream_url ); + my ( $repo, $upstream_url, $watch_file_content ); try { $repo = Git::Repository->new( git_dir => $self->main_file('.git') ); @@ -316,9 +316,25 @@ sub create_watch { return; }; + # try to take advantage of GitHub's release page, since mode=git + # is much more taxing for QA team's servers + if ( $upstream_url =~ /github\.com\/([^\/]+)\/([^\/]+)/ ) { + my $user = $1; + my $project = $2; + $watch_file_content = <_file_w( $self->debian_file("watch") ); - $fh->printf("version=4\nopts=\"mode=git\" %s refs/tags/v([\\d\\.\\d\\.]+) debian\n", - $upstream_url); + $fh->printf($watch_file_content); $fh->close; } -- cgit v1.2.3