[pacman-dev] [PATCH] makepkg: Disallow forward slashes in pkgver
Allan McRae
allan at archlinux.org
Tue Dec 6 05:45:02 UTC 2016
From: Steef Hegeman <steefhegeman at hotmail.com>
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 at hotmail.com>
---
>From bugtracker (FS#51481)
doc/PKGBUILD.5.txt | 2 +-
scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt
index 08ef3e4..4c1ef4b 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 09041d1..8d22a11 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
}
--
2.10.0
More information about the pacman-dev
mailing list