]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blobdiff - tools/quality-agent.d/095-directory-layout
Merge branch 'master' of ssh://git.ipfire.org/pub/git/ipfire-3.x
[people/amarx/ipfire-3.x.git] / tools / quality-agent.d / 095-directory-layout
index 7d3ddb24e683240483b9e1858978d3123edb119a..14f600d7bcf2c7f3d580f53f74c2ff15bbe506a8 100755 (executable)
@@ -2,27 +2,22 @@
 
 . $(dirname ${0})/qa-include
 
-function check() {
-       local dir=${1}
+DESC="The filelayout should comply to the FHS."
 
-       log "    ...${dir}"
+DIRS="/etc/init.d /etc/rc.d /lib/pkgconfig /usr/etc /usr/libexec /usr/local /usr/man /usr/usr /usr/var"
 
-       if [ -d "${BUILDROOT}/${dir}" ]; then
-               log "ERROR: This directory should not be there: ${dir}"
-               exit 1
-       fi
-}
+function check() {
+       local failed=0
 
-log "Check directory layout"
+       local dir
+       for dir in ${DIRS}; do
+               if [ -d "${BUILDROOT}${dir}" ]; then
+                       log_error "Bad directory: ${dir}"
+                       failed=1
+               fi
+       done
 
-log "  Checking for directories that should not be there"
-check /etc/init.d
-check /etc/rc.d
-check /lib/pkgconfig
-check /usr/etc
-check /usr/local
-check /usr/man
-check /usr/usr
-check /usr/var
+       return ${failed}
+}
 
-exit 0
+run