summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteef Hegeman <steefhegeman@hotmail.com>2016-10-23 02:27:21 +0200
committerAllan McRae <allan@archlinux.org>2017-01-04 13:59:14 +1000
commit5dfa3c8f6a0b1c170feac564b1fca51a33f78723 (patch)
treea8fe0fe23d500476bd7ea88c9173e63dad251de9
parent9a4d61622066d5d30c649f1c958b26526a4ceddf (diff)
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>
-rw-r--r--doc/PKGBUILD.5.txt2
-rw-r--r--scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in4
2 files changed, 3 insertions, 3 deletions
diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt
index 08ef3e4d..4c1ef4bd 100644
--- a/doc/PKGBUILD.5.txt
+++ b/doc/PKGBUILD.5.txt
@@ -48,7 +48,7 @@ similar to `$_basekernver`.
*pkgver*::
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()`
function in the PKGBUILD that outputs the new package version.
diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in
index 09041d17..8d22a115 100644
--- a/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in
+++ b/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in
@@ -35,8 +35,8 @@ check_pkgver() {
return 1
fi
- if [[ $1 = *[[:space:]:-]* ]]; then
- error "$(gettext "%s is not allowed to contain colons, hyphens or whitespace.")" "pkgver"
+ if [[ $1 = *[[:space:]/:-]* ]]; then
+ error "$(gettext "%s is not allowed to contain colons, forward slashes, hyphens or whitespace.")" "pkgver"
return 1
fi
}