Explorar el Código

Dpkg::Source::Package: do not overwrite debian/source/format if it already exists

Raphaël Hertzog hace 16 años
padre
commit
c5d44e22a9
Se han modificado 1 ficheros con 6 adiciones y 4 borrados
  1. 6 4
      scripts/Dpkg/Source/Package.pm

+ 6 - 4
scripts/Dpkg/Source/Package.pm

@@ -339,10 +339,12 @@ sub extract {
     {
         my $srcdir = File::Spec->catdir($newdirectory, "debian", "source");
         my $format_file = File::Spec->catfile($srcdir, "format");
-        mkdir($srcdir) unless -e $srcdir;
-        open(FORMAT, ">", $format_file) || syserr(_g("cannot write %s"), $format_file);
-        print FORMAT $self->{'fields'}{'Format'} . "\n";
-        close(FORMAT);
+	unless (-e $format_file) {
+	    mkdir($srcdir) unless -e $srcdir;
+	    open(FORMAT, ">", $format_file) || syserr(_g("cannot write %s"), $format_file);
+	    print FORMAT $self->{'fields'}{'Format'} . "\n";
+	    close(FORMAT);
+	}
     }
 
     # Make sure debian/rules is executable