aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Shelton <stuart@shelton.me>2015-06-27 20:43:29 +0100
committerStuart Shelton <stuart@shelton.me>2015-06-27 20:43:29 +0100
commitb8ab7241d636cfc273499d06bcc98a19abadc9a7 (patch)
tree2d37763cdc471fdac27f20cbf6c737b68667710c /metadata
parentUpdate files/apcupsd.init.4, affecting sys-power/apcupsd-3.14.10-r6, sys-powe... (diff)
downloadsrcshelton-b8ab7241d636cfc273499d06bcc98a19abadc9a7.tar.gz
srcshelton-b8ab7241d636cfc273499d06bcc98a19abadc9a7.tar.bz2
srcshelton-b8ab7241d636cfc273499d06bcc98a19abadc9a7.zip
Add additional QA check for scripts containing '/run' being deployed to /etc/{init,conf}.d/
Diffstat (limited to 'metadata')
-rwxr-xr-xmetadata/install-qa-check.d/95run-directory28
1 files changed, 28 insertions, 0 deletions
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