summaryrefslogtreecommitdiff
path: root/lib/DhMakeELPA/Command
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2016-07-04 13:58:37 +0900
committerSean Whitton <spwhitton@spwhitton.name>2016-07-04 13:58:37 +0900
commit1fdb83ff0486775cb4156dd1027392989d83c37d (patch)
treed6f2dfb3123bca79d59ce9460784043960c6b325 /lib/DhMakeELPA/Command
parent84856ce73313fcca281bc4333ed3f3f98f877415 (diff)
check foo-pkg.el for version before foo.el
Diffstat (limited to 'lib/DhMakeELPA/Command')
-rw-r--r--lib/DhMakeELPA/Command/Packaging.pm16
1 files changed, 8 insertions, 8 deletions
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;
}
}