newapkbuild: allow for underscore version separator

This commit is contained in:
ptrcnull 2022-01-09 16:26:32 +01:00 committed by Natanael Copa
parent b224407821
commit e261a84f2d
1 changed files with 2 additions and 2 deletions

View File

@ -208,7 +208,7 @@ __EOF__
# Create new aport from templates
newaport() {
local newname="${1##*/}"
local pn=${newname%-[0-9]*}
local pn=${newname%[-_][0-9]*}
local pv
local source=
is_url "$1" && source="$1"
@ -222,7 +222,7 @@ newaport() {
pv=${pv#*[a-z]}
source="${source%.t*}/$pkgname-$pv.tar.gz"
elif [ "$pn" != "$newname" ]; then
pv=${newname#$pn-}
pv=${newname#$pn[-_]}
pv=${pv%.t*} #strip .tar.gz .tgz .tar.bz2 etc
fi
if [ -z "$pkgname" ]; then