[Pkg-mozext-commits] [adblock-plus] 81/464: Handle version numbers like 1.3a correctly when creating development builds

David Prévot taffit at moszumanska.debian.org
Tue Jul 22 20:44:05 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository adblock-plus.

commit 4c3b70f3dbaebb6b2e02f41f4a631f1e2e569392
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Thu May 6 08:38:31 2010 +0200

    Handle version numbers like 1.3a correctly when creating development builds
---
 Packager.pm      |  8 ++++++--
 create_xpi.pl    |  2 +-
 make_devbuild.pl | 12 ++++++++----
 3 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/Packager.pm b/Packager.pm
index aeb0b16..486868a 100644
--- a/Packager.pm
+++ b/Packager.pm
@@ -27,8 +27,12 @@ sub readVersion
   $self->{version} =~ s/[^\w\.]//gs;
   if (exists $self->{devbuild})
   {
-    $self->{version} .= ".0" while ($self->{version} =~ tr/././ < 2);
-    $self->{version} .= $self->{devbuild};
+    unless ($self->{version} =~ /\D$/)
+    {
+      $self->{version} .= ".0" while ($self->{version} =~ tr/././ < 2);
+      $self->{version} .= "+";
+    }
+    $self->{version} .= "." . $self->{devbuild};
   }
   close(FILE);
 }
diff --git a/create_xpi.pl b/create_xpi.pl
index adf63f9..247725d 100644
--- a/create_xpi.pl
+++ b/create_xpi.pl
@@ -13,7 +13,7 @@ use Packager;
 my %params = ();
 
 my $xpiFile = shift @ARGV;
-if (@ARGV && $ARGV[0] =~ /^\+/)
+if (@ARGV && $ARGV[0] =~ /^\d+$/)
 {
   $params{devbuild} = $ARGV[0];
   shift @ARGV;
diff --git a/make_devbuild.pl b/make_devbuild.pl
index 8f4445c..36db198 100644
--- a/make_devbuild.pl
+++ b/make_devbuild.pl
@@ -31,14 +31,18 @@ $pkg->readVersion('version');
 my $baseName = $pkg->{baseName};
 my $version = $pkg->{version};
 
-# Pad the version with zeroes to get version comparisons
-# right (1.2+ > 1.2.1 but 1.2.0+ < 1.2.1)
-$version .= ".0" while ($version =~ tr/././ < 2);
+unless ($version =~ /\D$/)
+{
+  # Pad the version with zeroes to get version comparisons
+  # right (1.2+ > 1.2.1 but 1.2.0+ < 1.2.1)
+  $version .= ".0" while ($version =~ tr/././ < 2);
+  $version .= "+";
+}
 
 my ($sec, $min, $hour, $day, $mon, $year) = localtime;
 my $build = sprintf("%04i%02i%02i", $year+1900, $mon+1, $day);
 
 my $locale = (@ARGV ? "-" . join("-", @ARGV) : "");
- at ARGV = ("$baseName-$version+.$build$locale.xpi", "+.$build", @ARGV);
+ at ARGV = ("$baseName-$version.$build$locale.xpi", $build, @ARGV);
 do 'buildtools/create_xpi.pl';
 die $@ if $@;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git



More information about the Pkg-mozext-commits mailing list