From c253ed45481f410603acd8c17e79c2027a7ddd05 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 4 May 2008 14:44:34 -0400 Subject: [PATCH] Put in a workaround for bug #479317, an incompatability in perl 5.10 that causes nonzero exit if a program exits while chdired into a subdirectory of a File::Temp temp directory. --- debian/changelog | 3 +++ pristine-tar | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index ec266b5..65790b5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,9 @@ pristine-tar (0.14) UNRELEASED; urgency=low * Use debhelper v7; rules file minimisation. * Add build and install targets to Makefile. + * Put in a workaround for bug #479317, an incompatability in perl 5.10 + that causes nonzero exit if a program exits while chdired into a + subdirectory of a File::Temp temp directory. -- Joey Hess Thu, 24 Apr 2008 02:05:47 -0400 diff --git a/pristine-tar b/pristine-tar index 920069e..5456436 100755 --- a/pristine-tar +++ b/pristine-tar @@ -178,6 +178,11 @@ sub tempdir { TMPDIR => 1, CLEANUP => !$keep); } +# Workaround for bug #479317 in perl 5.10. +sub END { + chdir("/"); +} + sub recreatetarball { my $tempdir=shift; my $source=shift; @@ -240,7 +245,7 @@ sub recreatetarball { doit("cp", "-a", $source, "$tempdir/workdir$subdir"); } else { - doit("cp", "-a", $source, "$tempdir/workdir$subdir"); + doit("mv", $source, "$tempdir/workdir$subdir"); } # It's important that this create an identical tarball each time @@ -712,7 +717,6 @@ sub commit { sub checkout { my $tarball=shift; - my $tempdir=tempdir(); my ($delta, $id)=checkoutdelta($tarball); my ($sourcedir, undef)=export($id); my $pid = open(GENTAR, "|-"); -- 2.7.4