Ensure that version numbers begin with well, a number, when building a deb, otherwise dpkg-deb will refuse to build it.

This commit is contained in:
Joey Hess
2012-08-09 14:14:59 -04:00
parent 363deec1c6
commit 2fb28d27d2
2 changed files with 12 additions and 6 deletions

View File

@@ -594,14 +594,13 @@ sub version {
# get
return unless defined wantarray; # optimization
$_=$this->{version};
# Make sure the version contains a digit at the start, as required
# by dpkg-deb.
unless (/^[0-9]/) {
$_="0".$_;
}
# filter out some characters not allowed in debian versions
s/[^-.+~:A-Za-z0-9]//g; # see lib/dpkg/parsehelp.c parseversion
# Make sure the version contains digets.
unless (/[0-9]/) {
# Drat. Well, add some. dpkg-deb won't work
# on a version w/o numbers!
return $_."0";
}
return $_;
}

7
debian/changelog vendored
View File

@@ -1,3 +1,10 @@
alien (8.88) UNRELEASED; urgency=low
* Ensure that version numbers begin with well, a number, when building a
deb, otherwise dpkg-deb will refuse to build it.
-- Joey Hess <joeyh@debian.org> Thu, 09 Aug 2012 14:13:16 -0400
alien (8.87) unstable; urgency=low
* Use lsb-rpmbuild, not lsb-rpm. Closes: #667044