The following commit has been merged in the master branch:
commit 3d2e2cbed0c72f423577dbf4cbefb3d72df3bbfa
Author: Colin Watson <[email protected]>
Date: Tue Mar 16 12:14:16 2010 +0100
dpkg-source: support unpacking old source packages lacking the Format field
.dsc files haven't always had a Format field. It was introduced in dpkg
1.6.13, in May 2000. This means that it's still not entirely
implausible to run across source packages without Format, for example
when importing the history of a source package into revision control.
Thus, dpkg-source should treat a missing Format field as 1.0, for
compatibility with these old packages.
diff --git a/debian/changelog b/debian/changelog
index 5d46e5a..dbf31c4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,11 +1,17 @@
dpkg (1.15.6.1) UNRELEASED; urgency=low
+ [ Guillem Jover ]
* Fix two memory leaks introduced in 1.15.6.
* Always use C99 variadic macros, as the build requires them anyway, we
avoid exposing the configure variable HAVE_C99 on installed headers.
* Use __attribute__ keyword depending on compiler support, we avoid
exposing the configure variable HAVE_C_ATTRIBUTE on installed headers.
+ [ Raphaël Hertzog ]
+ * Accept source packages without "Format" field for compatibility with very
+ old source packages. Thanks to Colin Watson for the report and the patch.
+ Closes: #574097
+
[ Updated dpkg translations ]
* Swedish (Peter Krefting).
diff --git a/scripts/Dpkg/Source/Package.pm b/scripts/Dpkg/Source/Package.pm
index 3ebfc56..fb57359 100644
--- a/scripts/Dpkg/Source/Package.pm
+++ b/scripts/Dpkg/Source/Package.pm
@@ -144,7 +144,7 @@ sub initialize {
$fields->load($filename);
$self->{'fields'} = $fields;
- foreach my $f (qw(Source Format Version Files)) {
+ foreach my $f (qw(Source Version Files)) {
unless (defined($fields->{$f})) {
error(_g("missing critical source control field %s"), $f);
}
@@ -158,6 +158,8 @@ sub initialize {
sub upgrade_object_type {
my ($self, $update_format) = @_;
$update_format = 1 unless defined $update_format;
+ $self->{'fields'}{'Format'} = '1.0'
+ unless exists $self->{'fields'}{'Format'};
my $format = $self->{'fields'}{'Format'};
if ($format =~ /^([\d\.]+)(?:\s+\((.*)\))?$/) {
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]