[pacman-dev] [PATCH] lint_pkgbuild: explicitly return value
Allan McRae
allan at archlinux.org
Fri Nov 13 04:39:34 UTC 2015
Set the return value to be local and always explictly returns it.
Signed-off-by: Allan McRae <allan at archlinux.org>
---
WHO WROTE THIS?!
scripts/libmakepkg/lint_pkgbuild/arch.sh.in | 2 +-
scripts/libmakepkg/lint_pkgbuild/changelog.sh.in | 4 +++-
scripts/libmakepkg/lint_pkgbuild/install.sh.in | 4 +++-
scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in | 4 ++++
scripts/libmakepkg/lint_pkgbuild/util.sh.in | 2 +-
5 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/scripts/libmakepkg/lint_pkgbuild/arch.sh.in b/scripts/libmakepkg/lint_pkgbuild/arch.sh.in
index b8a8c30..f217515 100644
--- a/scripts/libmakepkg/lint_pkgbuild/arch.sh.in
+++ b/scripts/libmakepkg/lint_pkgbuild/arch.sh.in
@@ -31,7 +31,7 @@ lint_pkgbuild_functions+=('lint_arch')
lint_arch() {
- local a name list
+ local a name list ret=0
if [[ $arch == 'any' ]]; then
return 0
diff --git a/scripts/libmakepkg/lint_pkgbuild/changelog.sh.in b/scripts/libmakepkg/lint_pkgbuild/changelog.sh.in
index 72300a4..70959d0 100644
--- a/scripts/libmakepkg/lint_pkgbuild/changelog.sh.in
+++ b/scripts/libmakepkg/lint_pkgbuild/changelog.sh.in
@@ -41,5 +41,7 @@ lint_changelog() {
fi
done
- check_files_exist 'changelog' "${changelog_list[@]}"
+ check_files_exist 'changelog' "${changelog_list[@]}" || ret=1
+
+ return $ret
}
diff --git a/scripts/libmakepkg/lint_pkgbuild/install.sh.in b/scripts/libmakepkg/lint_pkgbuild/install.sh.in
index 21e0bfb..8e5c115 100644
--- a/scripts/libmakepkg/lint_pkgbuild/install.sh.in
+++ b/scripts/libmakepkg/lint_pkgbuild/install.sh.in
@@ -40,5 +40,7 @@ lint_install() {
install_list+=("$file")
done
- check_files_exist 'install' "${install_list[@]}"
+ check_files_exist 'install' "${install_list[@]}" || ret=1
+
+ return $ret
}
diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in
index 0d4361c..53f89ce 100644
--- a/scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in
+++ b/scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in
@@ -30,6 +30,8 @@ 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
@@ -43,4 +45,6 @@ lint_pkgbase() {
'pkgbase' "${i//[[:alnum:]+_. at -]}"
ret=1
fi
+
+ return $ret
}
diff --git a/scripts/libmakepkg/lint_pkgbuild/util.sh.in b/scripts/libmakepkg/lint_pkgbuild/util.sh.in
index 448abc8..8760eb6 100644
--- a/scripts/libmakepkg/lint_pkgbuild/util.sh.in
+++ b/scripts/libmakepkg/lint_pkgbuild/util.sh.in
@@ -27,7 +27,7 @@ source "$LIBRARY/util/message.sh"
check_files_exist() {
- local kind=$1 files=("${@:2}") file ret
+ local kind=$1 files=("${@:2}") file ret=0
for file in "${files[@]}"; do
if [[ $file && ! -f $file ]]; then
--
2.6.2
More information about the pacman-dev
mailing list