From c5d44e22a98b09414619a06723a05e85c944ea12 Mon Sep 17 00:00:00 2001 From: Raphaƫl Hertzog Date: Mon, 29 Mar 2010 12:36:20 +0200 Subject: Dpkg::Source::Package: do not overwrite debian/source/format if it already exists --- scripts/Dpkg/Source/Package.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'scripts/Dpkg') diff --git a/scripts/Dpkg/Source/Package.pm b/scripts/Dpkg/Source/Package.pm index 6f3e77963..c7c455423 100644 --- a/scripts/Dpkg/Source/Package.pm +++ b/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 -- cgit v1.2.3