Improve parsing of tgz filenames, to avoid confusion when the filename includes the package type (ie, "noarch"). Patch from Andrej Ricnik-Bay.

This commit is contained in:
Joey Hess
2008-04-29 18:26:16 -04:00
parent 7893ffb4ed
commit b2421b584a
2 changed files with 3 additions and 1 deletions

View File

@@ -95,7 +95,7 @@ sub scan {
# Strip out any tar extentions.
$basename=~s/\.(tgz|tar\.(gz|Z))$//;
if ($basename=~m/(.*)-(.*?[0-9]+.*)/) {
if ($basename=~m/([\w-]+)-([0-9\.?]+).*/) {
$this->name($1);
$this->version($2);
}