Fix test-suite root population wrt "optional" directories
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 5 Apr 2012 10:27:51 +0000 (13:27 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 5 Apr 2012 10:31:17 +0000 (13:31 +0300)
- /proc, /sys and especially selinux directories are mostly Linux
  creatures and even those vary between versions. Use if to avoid
  the error code "leaking" in case the last directory is not present.
(cherry picked from commit 6cc1680082a34037b889d824b80a006081b97363)

tests/Makefile.am

index ff7e498..dca36b2 100644 (file)
@@ -98,7 +98,7 @@ testing$(bindir)/rpmbuild: ../rpmbuild
        for node in stdin stderr stdout null; do ln -s /dev/$${node} testing/dev/$${node}; done
        for cf in hosts resolv.conf passwd shadow group gshadow mtab fstab; do [ -f /etc/$${cf} ] && ln -s /etc/$${cf} testing/etc/$${cf}; done
        for prog in gzip cat patch tar sh ln chmod rm mkdir uname grep sed find file mktemp cut sort diff; do p=`which $${prog}`; ln -s $${p} testing/$${p}; done
-       for d in /proc /sys /selinux /etc/selinux; do [ -d $${d} ] && ln -s $${d} testing/$${d}; done
+       for d in /proc /sys /selinux /etc/selinux; do if [ -d $${d} ]; then ln -s $${d} testing/$${d}; fi; done
        (cd testing/magic && file -C)
 
 check_DATA = atconfig atlocal $(TESTSUITE)