diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2016-07-04 13:58:37 +0900 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2016-07-04 13:58:37 +0900 |
commit | 1fdb83ff0486775cb4156dd1027392989d83c37d (patch) | |
tree | d6f2dfb3123bca79d59ce9460784043960c6b325 | |
parent | 84856ce73313fcca281bc4333ed3f3f98f877415 (diff) |
check foo-pkg.el for version before foo.el
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | lib/DhMakeELPA/Command/Packaging.pm | 16 |
2 files changed, 12 insertions, 10 deletions
diff --git a/debian/changelog b/debian/changelog index 20a3b1a..1400a0c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,13 +2,15 @@ dh-make-elpa (0.4.0) UNRELEASED; urgency=medium * Improve package version detection regexs (Closes: #829095). Thanks to Lev Lamberov for providing the test case. + * If foo-pkg.el exists, prefer it to foo.el for determining the upstream + version. * create_watch no longer emits an error if .git is not present (Closes: #829096). - New dependency: libtrycatch-perl * create_docs no longer emits an error if it can't find any docs (Closes: #829096). - * When generating watch files, check whether upstream prepends their - release tags with 'v'. + * Check whether upstream prepends their release tags with 'v' and adjust + gbp.conf accordingly. * Generated watch files now have trailing newline. * Add TIPS section to manpage. diff --git a/lib/DhMakeELPA/Command/Packaging.pm b/lib/DhMakeELPA/Command/Packaging.pm index 1de00e9..f9714b4 100644 --- a/lib/DhMakeELPA/Command/Packaging.pm +++ b/lib/DhMakeELPA/Command/Packaging.pm @@ -206,21 +206,21 @@ sub extract_version { my $self = shift; my $version; foreach my $bin ( keys %{$self->bins} ) { - if ( -f $self->main_file("$bin.el") ) { - my $fh = $self->_file_r("$bin.el"); + if ( -f $self->main_file("$bin-pkg.el") ) { + my $fh = $self->_file_r("$bin-pkg.el"); while (my $line = $fh->getline) { - if ( $line =~ /^;; (Package-)*Version\s*:\s+([0-9.a-zA-Z~+-]*)$/ ) { - $version = "$2"; + if ( $line =~ /.*\(define-package\s+"[^"]+"\s+"([0-9.a-zA-Z~+-]*)"/ ) { + $version = "$1"; last; } } $fh->close; last; - } elsif ( -f $self->main_file("$bin-pkg.el") ) { - my $fh = $self->_file_r("$bin-pkg.el"); + } elsif ( -f $self->main_file("$bin.el") ) { + my $fh = $self->_file_r("$bin.el"); while (my $line = $fh->getline) { - if ( $line =~ /.*\(define-package\s+"[^"]+"\s+"([0-9.a-zA-Z~+-]*)"/ ) { - $version = "$1"; + if ( $line =~ /^;; (Package-)*Version\s*:\s+([0-9.a-zA-Z~+-]*)$/ ) { + $version = "$2"; last; } } |