Просмотр исходного кода

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.
Raphael Hertzog лет назад: 18
Родитель
Сommit
ccc7a64b07
3 измененных файлов с 4 добавлено и 2 удалено
  1. 2 0
      scripts/Dpkg/Source/Package/V1_0.pm
  2. 1 1
      scripts/Dpkg/Source/Patch.pm
  3. 1 1
      scripts/Makefile.am

+ 2 - 0
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'"),

+ 1 - 1
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 _) {

+ 1 - 1
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):" \