summaryrefslogtreecommitdiff
path: root/scripts/Dpkg
diff options
context:
space:
mode:
authorRaphaël Hertzog <hertzog@debian.org>2010-03-29 12:36:20 +0200
committerRaphaël Hertzog <hertzog@debian.org>2010-03-29 12:36:20 +0200
commitc5d44e22a98b09414619a06723a05e85c944ea12 (patch)
treec5820eac38aa68886855e5383890217e80bcbdec /scripts/Dpkg
parent1cba260ee1e98cc9c160d7487d720ab795ce76c8 (diff)
downloaddpkg-c5d44e22a98b09414619a06723a05e85c944ea12.tar.gz
Dpkg::Source::Package: do not overwrite debian/source/format if it already exists
Diffstat (limited to 'scripts/Dpkg')
-rw-r--r--scripts/Dpkg/Source/Package.pm10
1 files changed, 6 insertions, 4 deletions
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