mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-22 07:48:50 -05:00
lint_pkgbuild: explicitly return value
Set the return value to be local and always explictly returns it. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
947dfda515
commit
c26e5b81e5
@ -31,7 +31,7 @@ lint_pkgbuild_functions+=('lint_arch')
|
|||||||
|
|
||||||
|
|
||||||
lint_arch() {
|
lint_arch() {
|
||||||
local a name list
|
local a name list ret=0
|
||||||
|
|
||||||
if [[ $arch == 'any' ]]; then
|
if [[ $arch == 'any' ]]; then
|
||||||
return 0
|
return 0
|
||||||
|
@ -41,5 +41,7 @@ lint_changelog() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
check_files_exist 'changelog' "${changelog_list[@]}"
|
check_files_exist 'changelog' "${changelog_list[@]}" || ret=1
|
||||||
|
|
||||||
|
return $ret
|
||||||
}
|
}
|
||||||
|
@ -40,5 +40,7 @@ lint_install() {
|
|||||||
install_list+=("$file")
|
install_list+=("$file")
|
||||||
done
|
done
|
||||||
|
|
||||||
check_files_exist 'install' "${install_list[@]}"
|
check_files_exist 'install' "${install_list[@]}" || ret=1
|
||||||
|
|
||||||
|
return $ret
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,8 @@ lint_pkgbuild_functions+=('lint_pkgbase')
|
|||||||
|
|
||||||
|
|
||||||
lint_pkgbase() {
|
lint_pkgbase() {
|
||||||
|
local ret=0
|
||||||
|
|
||||||
if [[ ${pkgbase:0:1} = "-" ]]; then
|
if [[ ${pkgbase:0:1} = "-" ]]; then
|
||||||
error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgname"
|
error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgname"
|
||||||
return 1
|
return 1
|
||||||
@ -43,4 +45,6 @@ lint_pkgbase() {
|
|||||||
'pkgbase' "${i//[[:alnum:]+_.@-]}"
|
'pkgbase' "${i//[[:alnum:]+_.@-]}"
|
||||||
ret=1
|
ret=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
return $ret
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ source "$LIBRARY/util/message.sh"
|
|||||||
|
|
||||||
|
|
||||||
check_files_exist() {
|
check_files_exist() {
|
||||||
local kind=$1 files=("${@:2}") file ret
|
local kind=$1 files=("${@:2}") file ret=0
|
||||||
|
|
||||||
for file in "${files[@]}"; do
|
for file in "${files[@]}"; do
|
||||||
if [[ $file && ! -f $file ]]; then
|
if [[ $file && ! -f $file ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user