From 8e34f32f9f2c27fff9b0c793f8332f091ba5cc79 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 4 Apr 2011 14:00:23 +0300 Subject: [PATCH] Add more stuff to test-suite root environment - Build needs a whole bunch of utilities there, including file + its magic database. The exact location of the magic db varies between systems but file -C lets us basically make a copy of the system magicdb into the fakechroot env and then we can override the location with MAGIC --- tests/Makefile.am | 5 +++-- tests/atlocal.in | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index f6e9510..1e8a750 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -86,10 +86,11 @@ testing$(bindir)/rpmbuild: ../rpmbuild (cd ${top_builddir} && \ $(MAKE) DESTDIR=`pwd`/${subdir}/testing install) cp -r data/ testing/ - mkdir testing/{dev,etc} + mkdir testing/{dev,etc,magic,tmp} 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 chmod rm mkdir; do p=`which $${prog}`; ln -s $${p} testing/$${p}; 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 + (cd testing/magic && file -C) check_DATA = atconfig atlocal $(TESTSUITE) check_DATA += testing$(bindir)/rpmbuild diff --git a/tests/atlocal.in b/tests/atlocal.in index 3d46a7d..5ce6f4f 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -30,6 +30,6 @@ function run() function runroot() { (cd ${RPMTEST} && \ - FAKECHROOT_BASE="${RPMTEST}" fakechroot "$@" --define "_topdir /build" + MAGIC="/magic/magic" FAKECHROOT_BASE="${RPMTEST}" fakechroot "$@" --define "_topdir /build" ) } -- 2.7.4