diff options
-rw-r--r-- | README.md | 2 | ||||
-rwxr-xr-x | metadata/install-qa-check.d/95run-directory | 28 |
2 files changed, 30 insertions, 0 deletions
@@ -230,6 +230,8 @@ A similar configuration file could be added for all packages which fail to compi # Fixes for ebuilds using `/run` (... rather than `/var/run`) +Included as `install-qa-check.d/95run-directory` is the repo `metadata` directory is an additional QA check which reports an error if files deployed to `/etc/init.d` or `/etc/conf.d` contain references to `/run`. + * app-admin/eselect-php * app-admin/syslog-ng * app-admin/ulogd diff --git a/metadata/install-qa-check.d/95run-directory b/metadata/install-qa-check.d/95run-directory new file mode 100755 index 00000000..2227eeb3 --- /dev/null +++ b/metadata/install-qa-check.d/95run-directory @@ -0,0 +1,28 @@ +# Check for deprecated use of /run in place of /var/run + +run_check() { + if [[ -d "${D%/}"/etc ]]; then + if [[ -d "${D%/}"/etc/init.d || -d "${D%/}"/etc/conf.d ]]; then + if grep '/run/' "${D%/}"/etc/{init,conf}.d/* | grep -v '/var/run/' | grep -q '/run/'; then + local -A list=() + local -a files=() + while read -r i; do + list["${i#${D}}"]=1 + done < <(grep -H '/run/' "${D%/}"/etc/{init,conf}.d/* | grep -v '/var/run/' | cut -d':' -f 1) + files="${!list[@]}" + if (( 1 == ${#files[@]} )) && [[ "${files[*]}" =~ etc/init.d/bootmisc ]]; then + : + else + eqawarn "Repo QA Notice: files referencing /run:" + eqatag -v using-run "${files[@]/#//}" + die "Aborting due to Repo QA concerns: ${#files[@]} files reference /run" + fi + fi + fi + fi +} + +run_check +: # guarantee successful exit + +# vim:ft=sh |