From: Raphael Hertzog Date: Sun, 2 Mar 2008 13:08:55 +0000 (+0100) Subject: Miscellaneous fixes X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccc7a64b078e4b2c807aef3d56274e2f9178a6aa;p=dpkg Miscellaneous fixes * scripts/Dpkg/Source/Package/V1_0.pm: Remove properly the temporary file used for creating diff.gz file in case of failure during its generation. * scripts/Dpkg/Source/Patch.pm: The bad file was analyzed and lead to failure of the stat call. * scripts/Makefile.am: Add the new V3_0/git.pm file and remove the old VCS/git.pm. --- diff --git a/scripts/Dpkg/Source/Package/V1_0.pm b/scripts/Dpkg/Source/Package/V1_0.pm index 46ea4b1d..a4bd971f 100644 --- a/scripts/Dpkg/Source/Package/V1_0.pm +++ b/scripts/Dpkg/Source/Package/V1_0.pm @@ -314,6 +314,7 @@ sub do_build { $sourcepackage, $diffname); my ($ndfh, $newdiffgz) = tempfile("$diffname.new.XXXXXX", DIR => getcwd(), UNLINK => 0); + push @Dpkg::Exit::handlers, sub { unlink($newdiffgz) }; my $diff = Dpkg::Source::Patch->new(filename => $newdiffgz, compression => "gzip"); $diff->create(); @@ -321,6 +322,7 @@ sub do_build { basedirname => $basedirname, diff_ignore_regexp => $diff_ignore_regexp); $diff->finish() || $ur++; + pop @Dpkg::Exit::handlers; rename($newdiffgz, $diffname) || syserr(_g("unable to rename `%s' (newly created) to `%s'"), diff --git a/scripts/Dpkg/Source/Patch.pm b/scripts/Dpkg/Source/Patch.pm index 81974677..b272124f 100644 --- a/scripts/Dpkg/Source/Patch.pm +++ b/scripts/Dpkg/Source/Patch.pm @@ -208,7 +208,7 @@ sub add_diff_directory { my $fn = File::Spec->abs2rel($_, $old); return if &$diff_ignore($fn); return if $files_in_new{$fn}; - lstat("$new/$fn") || syserr(_g("cannot stat file %s"), "$old/$fn"); + lstat("$old/$fn") || syserr(_g("cannot stat file %s"), "$old/$fn"); if (-f _) { warning(_g("ignoring deletion of file %s"), $fn); } elsif (-d _) { diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 221c24b4..aac6e43f 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -114,8 +114,8 @@ nobase_dist_perllib_DATA = \ Dpkg/Source/Package/V1_0.pm \ Dpkg/Source/Package/V1_0/native.pm \ Dpkg/Source/Package/V2_0.pm \ + Dpkg/Source/Package/V3_0/git.pm \ Dpkg/Source/Patch.pm \ - Dpkg/Source/VCS/git.pm \ Dpkg.pm do_perl_subst = sed -e "s:^\#![:space:]*/usr/bin/perl:\#!$(PERL):" \