mirror of
https://github.com/Gator96100/ProxSpace.git
synced 2025-08-20 05:13:25 -07:00
Updated msys2
This commit is contained in:
parent
6a85995508
commit
f0dc1ea8b0
13308 changed files with 689276 additions and 46605 deletions
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# arch.sh - Check the 'arch' array conforms to requirements.
|
||||
#
|
||||
# Copyright (c) 2014-2016 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# backup.sh - Check the 'backup' array conforms to requirements.
|
||||
#
|
||||
# Copyright (c) 2014-2016 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# changelog.sh - Check the files in the 'changelog' array exist.
|
||||
#
|
||||
# Copyright (c) 2014-2016 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
58
msys2/usr/share/makepkg/lint_pkgbuild/checkdepends.sh
Normal file
58
msys2/usr/share/makepkg/lint_pkgbuild/checkdepends.sh
Normal file
|
@ -0,0 +1,58 @@
|
|||
#!/usr/bin/bash
|
||||
#
|
||||
# checkdepends.sh - Check the 'checkdepends' array conforms to requirements.
|
||||
#
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_CHECKDEPENDS_SH" ]] && return
|
||||
LIBMAKEPKG_LINT_PKGBUILD_CHECKDEPENDS_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'/usr/share/makepkg'}
|
||||
|
||||
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
|
||||
source "$LIBRARY/lint_pkgbuild/pkgver.sh"
|
||||
source "$LIBRARY/util/message.sh"
|
||||
source "$LIBRARY/util/pkgbuild.sh"
|
||||
|
||||
|
||||
lint_pkgbuild_functions+=('lint_checkdepends')
|
||||
|
||||
|
||||
lint_checkdepends() {
|
||||
local checkdepends_list checkdepend name ver ret=0
|
||||
|
||||
get_pkgbuild_all_split_attributes checkdepends checkdepends_list
|
||||
|
||||
# this function requires extglob - save current status to restore later
|
||||
local shellopts=$(shopt -p extglob)
|
||||
shopt -s extglob
|
||||
|
||||
for checkdepend in "${checkdepends_list[@]}"; do
|
||||
name=${checkdepend%%@(<|>|=|>=|<=)*}
|
||||
# remove optional epoch in version specifier
|
||||
ver=${checkdepend##$name@(<|>|=|>=|<=)?(+([0-9]):)}
|
||||
lint_one_pkgname checkdepends "$name" || ret=1
|
||||
if [[ $ver != $checkdepend ]]; then
|
||||
# remove optional pkgrel in version specifier
|
||||
check_pkgver "${ver%-+([0-9])?(.+([0-9]))}" checkdepends || ret=1
|
||||
fi
|
||||
done
|
||||
|
||||
eval "$shellopts"
|
||||
|
||||
return $ret
|
||||
}
|
58
msys2/usr/share/makepkg/lint_pkgbuild/conflicts.sh
Normal file
58
msys2/usr/share/makepkg/lint_pkgbuild/conflicts.sh
Normal file
|
@ -0,0 +1,58 @@
|
|||
#!/usr/bin/bash
|
||||
#
|
||||
# conflicts.sh - Check the 'conflicts' array conforms to requirements.
|
||||
#
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_CONFLICTS_SH" ]] && return
|
||||
LIBMAKEPKG_LINT_PKGBUILD_CONFLICTS_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'/usr/share/makepkg'}
|
||||
|
||||
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
|
||||
source "$LIBRARY/lint_pkgbuild/pkgver.sh"
|
||||
source "$LIBRARY/util/message.sh"
|
||||
source "$LIBRARY/util/pkgbuild.sh"
|
||||
|
||||
|
||||
lint_pkgbuild_functions+=('lint_conflicts')
|
||||
|
||||
|
||||
lint_conflicts() {
|
||||
local conflicts_list conflict name ver ret=0
|
||||
|
||||
get_pkgbuild_all_split_attributes conflicts conflicts_list
|
||||
|
||||
# this function requires extglob - save current status to restore later
|
||||
local shellopts=$(shopt -p extglob)
|
||||
shopt -s extglob
|
||||
|
||||
for conflict in "${conflicts_list[@]}"; do
|
||||
name=${conflict%%@(<|>|=|>=|<=)*}
|
||||
# remove optional epoch in version specifier
|
||||
ver=${conflict##$name@(<|>|=|>=|<=)?(+([0-9]):)}
|
||||
lint_one_pkgname conflicts "$name" || ret=1
|
||||
if [[ $ver != $conflict ]]; then
|
||||
# remove optional pkgrel in version specifier
|
||||
check_pkgver "${ver%-+([0-9])?(.+([0-9]))}" conflicts || ret=1
|
||||
fi
|
||||
done
|
||||
|
||||
eval "$shellopts"
|
||||
|
||||
return $ret
|
||||
}
|
59
msys2/usr/share/makepkg/lint_pkgbuild/depends.sh
Normal file
59
msys2/usr/share/makepkg/lint_pkgbuild/depends.sh
Normal file
|
@ -0,0 +1,59 @@
|
|||
#!/usr/bin/bash
|
||||
#
|
||||
# depends.sh - Check the 'depends' array conforms to requirements.
|
||||
#
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_DEPENDS_SH" ]] && return
|
||||
LIBMAKEPKG_LINT_PKGBUILD_DEPENDS_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'/usr/share/makepkg'}
|
||||
|
||||
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
|
||||
source "$LIBRARY/lint_pkgbuild/pkgver.sh"
|
||||
source "$LIBRARY/util/message.sh"
|
||||
source "$LIBRARY/util/pkgbuild.sh"
|
||||
|
||||
|
||||
lint_pkgbuild_functions+=('lint_depends')
|
||||
|
||||
|
||||
lint_depends() {
|
||||
local depends_list depend name ver ret=0
|
||||
|
||||
get_pkgbuild_all_split_attributes depends depends_list
|
||||
|
||||
# this function requires extglob - save current status to restore later
|
||||
local shellopts=$(shopt -p extglob)
|
||||
shopt -s extglob
|
||||
|
||||
for depend in "${depends_list[@]}"; do
|
||||
name=${depend%%@(<|>|=|>=|<=)*}
|
||||
# remove optional epoch in version specifier
|
||||
ver=${depend##$name@(<|>|=|>=|<=)?(+([0-9]):)}
|
||||
lint_one_pkgname depends "$name" || ret=1
|
||||
# Don't validate empty version because of https://bugs.archlinux.org/task/58776
|
||||
if [[ $ver != $depend && -n $ver ]]; then
|
||||
# remove optional pkgrel in version specifier
|
||||
check_pkgver "${ver%-+([0-9])?(.+([0-9]))}" depends || ret=1
|
||||
fi
|
||||
done
|
||||
|
||||
eval "$shellopts"
|
||||
|
||||
return $ret
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# epoch.sh - Check the 'epoch' variable conforms to requirements.
|
||||
#
|
||||
# Copyright (c) 2014-2016 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# install.sh - Check the files in the 'install' array exist.
|
||||
#
|
||||
# Copyright (c) 2014-2016 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
58
msys2/usr/share/makepkg/lint_pkgbuild/makedepends.sh
Normal file
58
msys2/usr/share/makepkg/lint_pkgbuild/makedepends.sh
Normal file
|
@ -0,0 +1,58 @@
|
|||
#!/usr/bin/bash
|
||||
#
|
||||
# makedepends.sh - Check the 'makedepends' array conforms to requirements.
|
||||
#
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_MAKEDEPENDS_SH" ]] && return
|
||||
LIBMAKEPKG_LINT_PKGBUILD_MAKEDEPENDS_SH=1
|
||||
|
||||
LIBRARY=${LIBRARY:-'/usr/share/makepkg'}
|
||||
|
||||
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
|
||||
source "$LIBRARY/lint_pkgbuild/pkgver.sh"
|
||||
source "$LIBRARY/util/message.sh"
|
||||
source "$LIBRARY/util/pkgbuild.sh"
|
||||
|
||||
|
||||
lint_pkgbuild_functions+=('lint_makedepends')
|
||||
|
||||
|
||||
lint_makedepends() {
|
||||
local makedepends_list makedepend name ver ret=0
|
||||
|
||||
get_pkgbuild_all_split_attributes makedepends makedepends_list
|
||||
|
||||
# this function requires extglob - save current status to restore later
|
||||
local shellopts=$(shopt -p extglob)
|
||||
shopt -s extglob
|
||||
|
||||
for makedepend in "${makedepends_list[@]}"; do
|
||||
name=${makedepend%%@(<|>|=|>=|<=)*}
|
||||
# remove optional epoch in version specifier
|
||||
ver=${makedepend##$name@(<|>|=|>=|<=)?(+([0-9]):)}
|
||||
lint_one_pkgname makedepends "$name" || ret=1
|
||||
if [[ $ver != $makedepend ]]; then
|
||||
# remove optional pkgrel in version specifier
|
||||
check_pkgver "${ver%-+([0-9])?(.+([0-9]))}" makedepends || ret=1
|
||||
fi
|
||||
done
|
||||
|
||||
eval "$shellopts"
|
||||
|
||||
return $ret
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# optdepends.sh - Check the 'optdepends' array conforms to requirements.
|
||||
#
|
||||
# Copyright (c) 2014-2016 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -31,32 +31,22 @@ lint_pkgbuild_functions+=('lint_optdepends')
|
|||
|
||||
|
||||
lint_optdepends() {
|
||||
local a list name optdepends_list ret=0
|
||||
local optdepends_list optdepend name ver ret=0
|
||||
|
||||
optdepends_list=("${optdepends[@]}")
|
||||
for a in "${arch[@]}"; do
|
||||
array_build list "optdepends_$a"
|
||||
optdepends_list+=("${list[@]}")
|
||||
done
|
||||
get_pkgbuild_all_split_attributes optdepends optdepends_list
|
||||
|
||||
for name in "${pkgname[@]}"; do
|
||||
if extract_function_variable "package_$name" optdepends 1 list; then
|
||||
optdepends_list+=("${list[@]}")
|
||||
fi
|
||||
# this function requires extglob - save current status to restore later
|
||||
local shellopts=$(shopt -p extglob)
|
||||
shopt -s extglob
|
||||
|
||||
for a in "${arch[@]}"; do
|
||||
if extract_function_variable "package_$name" "optdepends_$a" 1 list; then
|
||||
optdepends_list+=("${list[@]}")
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
for name in "${optdepends_list[@]}"; do
|
||||
local pkg=${name%%:[[:space:]]*}
|
||||
# the '-' character _must_ be first or last in the character range
|
||||
if [[ $pkg != +([-[:alnum:]><=.+_:]) ]]; then
|
||||
error "$(gettext "Invalid syntax for %s: '%s'")" "optdepend" "$name"
|
||||
ret=1
|
||||
for optdepend in "${optdepends_list[@]%%:[[:space:]]*}"; do
|
||||
name=${optdepend%%@(<|>|=|>=|<=)*}
|
||||
# remove optional epoch in version specifier
|
||||
ver=${optdepend##$name@(<|>|=|>=|<=)?(+([0-9]):)}
|
||||
lint_one_pkgname optdepends "$name" || ret=1
|
||||
if [[ $ver != $optdepend ]]; then
|
||||
# remove optional pkgrel in version specifier
|
||||
check_pkgver "${ver%-+([0-9])?(.+([0-9]))}" optdepends || ret=1
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# options.sh - Check the 'options' array conforms to requirements.
|
||||
#
|
||||
# Copyright (c) 2014-2016 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# package_function.sh - Check that required package functions exist.
|
||||
#
|
||||
# Copyright (c) 2014-2016 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# pkgbase.sh - Check the 'pkgbase' variable conforms to requirements.
|
||||
#
|
||||
# Copyright (c) 2014-2016 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -23,6 +23,7 @@ LIBMAKEPKG_LINT_PKGBUILD_PKGBASE_SH=1
|
|||
|
||||
LIBRARY=${LIBRARY:-'/usr/share/makepkg'}
|
||||
|
||||
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
|
||||
source "$LIBRARY/util/message.sh"
|
||||
|
||||
|
||||
|
@ -30,21 +31,9 @@ lint_pkgbuild_functions+=('lint_pkgbase')
|
|||
|
||||
|
||||
lint_pkgbase() {
|
||||
local ret=0
|
||||
|
||||
if [[ ${pkgbase:0:1} = "-" ]]; then
|
||||
error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgname"
|
||||
return 1
|
||||
fi
|
||||
if [[ ${pkgbase:0:1} = "." ]]; then
|
||||
error "$(gettext "%s is not allowed to start with a dot.")" "pkgbase"
|
||||
ret=1
|
||||
fi
|
||||
if [[ $pkgbase = *[^[:alnum:]+_.@-]* ]]; then
|
||||
error "$(gettext "%s contains invalid characters: '%s'")" \
|
||||
'pkgbase' "${i//[[:alnum:]+_.@-]}"
|
||||
ret=1
|
||||
if [[ -z $pkgbase ]]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
return $ret
|
||||
lint_one_pkgname "pkgbase" "$pkgbase"
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# pkglist.sh - Check the packages selected to build exist.
|
||||
#
|
||||
# Copyright (c) 2014-2016 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# pkgname.sh - Check the 'pkgname' variable conforms to requirements.
|
||||
#
|
||||
# Copyright (c) 2014-2016 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,29 +29,42 @@ source "$LIBRARY/util/message.sh"
|
|||
lint_pkgbuild_functions+=('lint_pkgname')
|
||||
|
||||
|
||||
lint_pkgname() {
|
||||
local ret=0 i
|
||||
lint_one_pkgname() {
|
||||
local type=$1 name=$2 ret=0
|
||||
|
||||
for i in "${pkgname[@]}"; do
|
||||
if [[ -z $i ]]; then
|
||||
error "$(gettext "%s is not allowed to be empty.")" "pkgname"
|
||||
ret=1
|
||||
continue
|
||||
fi
|
||||
if [[ ${i:0:1} = "-" ]]; then
|
||||
error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgname"
|
||||
ret=1
|
||||
fi
|
||||
if [[ ${i:0:1} = "." ]]; then
|
||||
error "$(gettext "%s is not allowed to start with a dot.")" "pkgname"
|
||||
ret=1
|
||||
fi
|
||||
if [[ $i = *[^[:alnum:]+_.@-]* ]]; then
|
||||
error "$(gettext "%s contains invalid characters: '%s'")" \
|
||||
'pkgname' "${i//[[:alnum:]+_.@-]}"
|
||||
ret=1
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -z $name ]]; then
|
||||
error "$(gettext "%s is not allowed to be empty.")" "$type"
|
||||
return 1
|
||||
fi
|
||||
if [[ ${name:0:1} = "-" ]]; then
|
||||
error "$(gettext "%s is not allowed to start with a hyphen.")" "$type"
|
||||
ret=1
|
||||
fi
|
||||
if [[ ${name:0:1} = "." ]]; then
|
||||
error "$(gettext "%s is not allowed to start with a dot.")" "$type"
|
||||
ret=1
|
||||
fi
|
||||
if [[ $name = *[^[:alnum:]+_.@-]* ]]; then
|
||||
error "$(gettext "%s contains invalid characters: '%s'")" \
|
||||
"$type" "${name//[[:alnum:]+_.@-]}"
|
||||
ret=1
|
||||
fi
|
||||
|
||||
return $ret
|
||||
}
|
||||
|
||||
lint_pkgname() {
|
||||
local ret=0 i
|
||||
|
||||
if [[ -z ${pkgname[@]} ]]; then
|
||||
error "$(gettext "%s is not allowed to be empty.")" "pkgname"
|
||||
ret=1
|
||||
else
|
||||
for i in "${pkgname[@]}"; do
|
||||
lint_one_pkgname "pkgname" "$i" || ret=1
|
||||
done
|
||||
fi
|
||||
|
||||
return $ret
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# pkgrel.sh - Check the 'pkgrel' variable conforms to requirements.
|
||||
#
|
||||
# Copyright (c) 2014-2016 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# pkgver.sh - Check the 'pkgver' variable conforms to requirements.
|
||||
#
|
||||
# Copyright (c) 2014-2016 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -30,13 +30,15 @@ lint_pkgbuild_functions+=('lint_pkgver')
|
|||
|
||||
|
||||
check_pkgver() {
|
||||
if [[ -z $1 ]]; then
|
||||
error "$(gettext "%s is not allowed to be empty.")" "pkgver"
|
||||
local ver=$1 type=$2
|
||||
|
||||
if [[ -z $ver ]]; then
|
||||
error "$(gettext "%s is not allowed to be empty.")" "pkgver${type:+ in $type}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ $1 = *[[:space:]:-]* ]]; then
|
||||
error "$(gettext "%s is not allowed to contain colons, hyphens or whitespace.")" "pkgver"
|
||||
if [[ $ver = *[[:space:]/:-]* ]]; then
|
||||
error "$(gettext "%s is not allowed to contain colons, forward slashes, hyphens or whitespace.")" "pkgver${type:+ in $type}"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
@ -47,5 +49,5 @@ lint_pkgver() {
|
|||
return 0
|
||||
fi
|
||||
|
||||
check_pkgver $pkgver
|
||||
check_pkgver "$pkgver"
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# provides.sh - Check the 'provides' array conforms to requirements.
|
||||
#
|
||||
# Copyright (c) 2014-2016 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -23,6 +23,8 @@ LIBMAKEPKG_LINT_PKGBUILD_PROVIDES_SH=1
|
|||
|
||||
LIBRARY=${LIBRARY:-'/usr/share/makepkg'}
|
||||
|
||||
source "$LIBRARY/lint_pkgbuild/pkgname.sh"
|
||||
source "$LIBRARY/lint_pkgbuild/pkgver.sh"
|
||||
source "$LIBRARY/util/message.sh"
|
||||
source "$LIBRARY/util/pkgbuild.sh"
|
||||
|
||||
|
@ -31,32 +33,31 @@ lint_pkgbuild_functions+=('lint_provides')
|
|||
|
||||
|
||||
lint_provides() {
|
||||
local a list name provides_list ret=0
|
||||
local provides_list provide name ver ret=0
|
||||
|
||||
provides_list=("${provides[@]}")
|
||||
for a in "${arch[@]}"; do
|
||||
array_build list "provides_$a"
|
||||
provides_list+=("${list[@]}")
|
||||
done
|
||||
get_pkgbuild_all_split_attributes provides provides_list
|
||||
|
||||
for name in "${pkgname[@]}"; do
|
||||
if extract_function_variable "package_$name" provides 1 list; then
|
||||
provides_list+=("${list[@]}")
|
||||
fi
|
||||
|
||||
for a in "${arch[@]}"; do
|
||||
if extract_function_variable "package_$name" "provides_$a" 1 list; then
|
||||
provides_list+=("${list[@]}")
|
||||
fi
|
||||
done
|
||||
done
|
||||
# this function requires extglob - save current status to restore later
|
||||
local shellopts=$(shopt -p extglob)
|
||||
shopt -s extglob
|
||||
|
||||
for provide in "${provides_list[@]}"; do
|
||||
if [[ $provide == *['<>']* ]]; then
|
||||
error "$(gettext "%s array cannot contain comparison (< or >) operators.")" "provides"
|
||||
ret=1
|
||||
continue
|
||||
fi
|
||||
name=${provide%=*}
|
||||
# remove optional epoch in version specifier
|
||||
ver=${provide##$name=?(+([0-9]):)}
|
||||
lint_one_pkgname provides "$name" || ret=1
|
||||
if [[ $ver != $provide ]]; then
|
||||
# remove optional pkgrel in version specifier
|
||||
check_pkgver "${ver%-+([0-9])?(.+([0-9]))}" provides || ret=1
|
||||
fi
|
||||
done
|
||||
|
||||
eval "$shellopts"
|
||||
|
||||
return $ret
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# source.sh - Check the 'source' array is not sparse.
|
||||
#
|
||||
# Copyright (c) 2014-2016 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# util.sh - utility functions for pkgbuild linting.
|
||||
#
|
||||
# Copyright (c) 2014-2016 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# variable.sh - Check that variables are or are not arrays as appropriate
|
||||
#
|
||||
# Copyright (c) 2014-2016 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
# Copyright (c) 2014-2018 Pacman Development Team <pacman-dev@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -34,7 +34,8 @@ lint_variable() {
|
|||
local array=(arch backup checkdepends groups license noextract options
|
||||
validpgpkeys)
|
||||
local arch_array=(conflicts depends makedepends md5sums optdepends provides
|
||||
replaces sha1sums sha256sums sha384sums sha512sums source)
|
||||
replaces sha1sums sha224sums sha256sums sha384sums sha512sums
|
||||
source)
|
||||
local string=(changelog epoch install pkgdesc pkgrel pkgver url)
|
||||
|
||||
local i a v pkg keys out bad ret=0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue