diff options
author | Đoàn Trần Công Danh <congdanhqx@gmail.com> | 2022-09-06 03:31:17 +0000 |
---|---|---|
committer | Đoàn Trần Công Danh <congdanhqx@gmail.com> | 2022-09-06 10:43:20 +0000 |
commit | c22acb3072a79c841ad16a333deae42731e3b8fc (patch) | |
tree | f8e421b9abea66a2f02978f24bcbb5a46158446f | |
parent | 8dbdd0699be3192234838d925f82266a9812d869 (diff) | |
download | void-packages-c22acb3072a79c841ad16a333deae42731e3b8fc.tar void-packages-c22acb3072a79c841ad16a333deae42731e3b8fc.tar.gz void-packages-c22acb3072a79c841ad16a333deae42731e3b8fc.tar.bz2 void-packages-c22acb3072a79c841ad16a333deae42731e3b8fc.tar.lz void-packages-c22acb3072a79c841ad16a333deae42731e3b8fc.tar.xz void-packages-c22acb3072a79c841ad16a333deae42731e3b8fc.tar.zst void-packages-c22acb3072a79c841ad16a333deae42731e3b8fc.zip |
99-pkglint: forbid /usr/etc
data files should go to /usr/share, config files should go to /etc
-rw-r--r-- | common/hooks/pre-pkg/99-pkglint.sh | 2 | ||||
-rw-r--r-- | common/wrappers/which.sh | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/common/hooks/pre-pkg/99-pkglint.sh b/common/hooks/pre-pkg/99-pkglint.sh index 325938f5d54..7e40e81f2b4 100644 --- a/common/hooks/pre-pkg/99-pkglint.sh +++ b/common/hooks/pre-pkg/99-pkglint.sh @@ -22,7 +22,7 @@ hook() { fi done - for f in var/run usr/local; do + for f in var/run usr/local usr/etc; do if [ -d ${PKGDESTDIR}/${f} ]; then msg_red "${pkgver}: /${f} directory is not allowed, remove it!\n" error=1 diff --git a/common/wrappers/which.sh b/common/wrappers/which.sh new file mode 100644 index 00000000000..3dc47063b2e --- /dev/null +++ b/common/wrappers/which.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +ret=0 + +while test $# != 0; do + case "$1" in + -*) ;; + *) command -v "$1" || ret=1 ;; + esac + shift +done + +exit "$ret" |