makepkg: Disallow forward slashes in pkgver

scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in now raises an error when
pkgver contains forward slashes.

pkgver containing a forward slash results in a package filename
containing a forward slash, which isn't a valid filename.

Signed-off-by: Steef Hegeman <steefhegeman@hotmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Steef Hegeman 2016-10-23 02:27:21 +02:00 committed by Allan McRae
parent 9a4d616220
commit 5dfa3c8f6a
2 changed files with 3 additions and 3 deletions

View file

@ -48,7 +48,7 @@ similar to `$_basekernver`.
*pkgver*:: *pkgver*::
The version of the software as released from the author (e.g., '2.7.1'). The version of the software as released from the author (e.g., '2.7.1').
The variable is not allowed to contain colons or hyphens. The variable is not allowed to contain colons, forward slashes or hyphens.
+ +
The `pkgver` variable can be automatically updated by providing a `pkgver()` The `pkgver` variable can be automatically updated by providing a `pkgver()`
function in the PKGBUILD that outputs the new package version. function in the PKGBUILD that outputs the new package version.

View file

@ -35,8 +35,8 @@ check_pkgver() {
return 1 return 1
fi fi
if [[ $1 = *[[:space:]:-]* ]]; then if [[ $1 = *[[:space:]/:-]* ]]; then
error "$(gettext "%s is not allowed to contain colons, hyphens or whitespace.")" "pkgver" error "$(gettext "%s is not allowed to contain colons, forward slashes, hyphens or whitespace.")" "pkgver"
return 1 return 1
fi fi
} }