Преглед изворни кода

build: Do not copy 200_Dpkg_Shlibs data files to t.tmp

The copy was done to make the relative paths inside the ld.so.conf
fragments work even in out of tree builds. We now switch the current
directory to $srcdir in 200_Dpkg_Shlibs.t when loading the fragments
and then go back.
Guillem Jover пре 16 година
родитељ
комит
6d7c80bafa

+ 0 - 3
scripts/Makefile.am

@@ -169,13 +169,10 @@ TEST_FILES= $(srcdir)/t/*.t
 TEST_VERBOSE= 0
 
 clean-local:
-	[ ! -d t.tmp ] || chmod -R +w t.tmp
 	rm -fr t.tmp
 
 check: $(TEST_FILES) $(wildcard $(srcdir)/t/200_Dpkg_Shlibs/ld.so.conf*)
 	$(mkdir_p) t.tmp
-# a bit hacky...
-	cp -dRl $(srcdir)/t/200_Dpkg_Shlibs/ld.so.conf* t.tmp/
 	PATH="$(top_builddir)/src:$(top_builddir)/scripts:$(PATH)" srcdir=$(srcdir) PERL5LIB=$(srcdir) DPKG_DATADIR=$(srcdir)/.. PERL_DL_NONLAZY=1 $(PERL) -I$(srcdir) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '.')" $(TEST_FILES)
 
 objdump_lib_name = lib`basename $@`.so

+ 8 - 1
scripts/t/200_Dpkg_Shlibs.t

@@ -14,6 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 use Test::More tests => 63;
+use Cwd;
 use IO::String;
 
 use strict;
@@ -29,7 +30,13 @@ my @save_paths = @Dpkg::Shlibs::librarypaths;
 my $srcdir = $ENV{srcdir} || '.';
 my $datadir = $srcdir . '/t/200_Dpkg_Shlibs';
 
-Dpkg::Shlibs::parse_ldso_conf("t.tmp/ld.so.conf");
+# We want relative paths inside the ld.so.conf fragments to work, and $srcdir
+# is usually a relative path, so let's temporarily switch directory.
+# XXX: An alternative would be to make parse_ldso_conf relative path aware.
+my $cwd = cwd();
+chdir($srcdir);
+Dpkg::Shlibs::parse_ldso_conf("$datadir/ld.so.conf");
+chdir($cwd);
 
 use Data::Dumper;
 is_deeply([qw(/nonexistant32 /nonexistant/lib64

+ 1 - 1
scripts/t/200_Dpkg_Shlibs/ld.so.conf

@@ -5,5 +5,5 @@
 /nonexistant/lib64
 
 include /nonexistant/*.conf
-include t.tmp/ld.so.conf.d/*.conf
+include t/200_Dpkg_Shlibs/ld.so.conf.d/*.conf
 

+ 1 - 1
scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/inf_recurse.conf

@@ -1 +1 @@
-include t.tmp/ld.so.conf
+include t/200_Dpkg_Shlibs/ld.so.conf

+ 1 - 1
scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/recursive.conf

@@ -1 +1 @@
-include t.tmp/ld.so.conf_2
+include t/200_Dpkg_Shlibs/ld.so.conf_2