summaryrefslogtreecommitdiffstats
path: root/scripts/libmakepkg/lint_package
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2015-02-01 13:32:51 +0100
committerAllan McRae <allan@archlinux.org>2015-02-12 05:00:57 +0100
commitadc6ca1f2c08bb01a29f5247bfa5ee3bd30ee727 (patch)
tree87348647a322bbf8bcd2e696be8eed4dc4a57689 /scripts/libmakepkg/lint_package
parent00da25a5ea3413e128c455fd711cf46692df6159 (diff)
downloadpacman-adc6ca1f2c08bb01a29f5247bfa5ee3bd30ee727.tar.gz
pacman-adc6ca1f2c08bb01a29f5247bfa5ee3bd30ee727.tar.xz
libmakepkg: make package checking functions extendable
To add a new package check, drop a file in libmakepkg/lint and add the function to the "lint_functions" array. Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts/libmakepkg/lint_package')
-rw-r--r--scripts/libmakepkg/lint_package/build_references.sh.in2
-rw-r--r--scripts/libmakepkg/lint_package/missing_backup.sh.in2
2 files changed, 4 insertions, 0 deletions
diff --git a/scripts/libmakepkg/lint_package/build_references.sh.in b/scripts/libmakepkg/lint_package/build_references.sh.in
index f6de2900..6b03e484 100644
--- a/scripts/libmakepkg/lint_package/build_references.sh.in
+++ b/scripts/libmakepkg/lint_package/build_references.sh.in
@@ -26,6 +26,8 @@ LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
+lint_package_functions+=('warn_build_references')
+
warn_build_references() {
if find "${pkgdir}" -type f -print0 | xargs -0 grep -q -I "${srcdir}" ; then
warning "$(gettext "Package contains reference to %s")" "\$srcdir"
diff --git a/scripts/libmakepkg/lint_package/missing_backup.sh.in b/scripts/libmakepkg/lint_package/missing_backup.sh.in
index d1008749..64d5a64a 100644
--- a/scripts/libmakepkg/lint_package/missing_backup.sh.in
+++ b/scripts/libmakepkg/lint_package/missing_backup.sh.in
@@ -26,6 +26,8 @@ LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
+lint_package_functions+=('warn_missing_backup')
+
warn_missing_backup() {
local file
for file in "${backup[@]}"; do