Filter out illegal characters in version number when building a deb. Closes: #648531

This commit is contained in:
Joey Hess
2011-11-12 13:12:25 -04:00
parent 873c3606f3
commit 5e4e122d58
2 changed files with 9 additions and 0 deletions

View File

@@ -596,6 +596,8 @@ sub version {
# get
return unless defined wantarray; # optimization
$_=$this->{version};
# 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