[pacman-dev] [PATCH] makepkg: extend test for hyphen prefixes to pkgbase and all pkgnames
Allan McRae
allan at archlinux.org
Mon Oct 26 07:48:06 EDT 2009
Cedric Staniewski wrote:
> Since commit fb97d32, which brought in this test, support for split
> PKGBUILDs was added, and therefore, all values of pkgname and also
> pkgbase have to be checked now.
>
> Signed-off-by: Cedric Staniewski <cedric at gmx.ca>
> ---
>
> Last patch before the big freeze...
>
> scripts/makepkg.sh.in | 12 ++++++++++--
> 1 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index 9cd7f2e..c451a36 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -1139,8 +1139,8 @@ check_sanity() {
> error "$(gettext "%s is not allowed to be empty.")" "pkgrel"
> return 1
> fi
> - if [ "${pkgname:0:1}" == "-" ]; then
> - error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgname"
> + if [[ ${pkgbase:0:1} = "-" ]]; then
> + error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgbase"
> return 1
> fi
>
Unless I am missing something, pkgbase can start with anything. It is
only used informationally in makepkg so does not cause problems with
other tools.
> if [ "$pkgver" != "${pkgver//-/}" ]; then
> @@ -1152,6 +1152,14 @@ check_sanity() {
> return 1
> fi
>
> + local name
> + for name in "${pkgname[@]}"; do
> + if [[ ${name:0:1} = "-" ]]; then
> + error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgname"
> + return 1
> + fi
> + done
> +
>
Why not keep this in the same place as the previous check on pkgname?
> if [ "$arch" != 'any' ]; then
> if ! in_array $CARCH ${arch[@]}; then
> if [ "$IGNOREARCH" -eq 0 ]; then
>
Allan
More information about the pacman-dev
mailing list