Forráskód Böngészése

Rename DSP::V1_0::native to DSP::V3_0::native

* scripts/Dpkg/Source/Package/V1_0/native.pm: This file got
renamed into...
* scripts/Dpkg/Source/Package/V3_0/native.pm: The goal is to
not pollute the namespace of versions 1.0 and 2.0. The usage
of the format specifier between parenthesis is thus limited
to version 3.0.
* scripts/dpkg-source.pl: Updated to take into account the
previous renaming.
* scripts/Dpkg/Source/Package/V1_0.pm: Adapt to the name change
and two small bug fixes that affect building of native packages.
* scripts/Makefile.am, scripts/po/POTFILES.in: Register the new
file and remove the old one.
Raphael Hertzog 18 éve
szülő
commit
e8017dbfa9

+ 5 - 5
scripts/Dpkg/Source/Package/V1_0.pm

@@ -30,7 +30,7 @@ use Dpkg::Source::Patch;
 use Dpkg::Version qw(check_version);
 use Dpkg::Exit;
 use Dpkg::Source::Functions qw(erasedir);
-use Dpkg::Source::Package::V1_0::native;
+use Dpkg::Source::Package::V3_0::native;
 use Dpkg::Path qw(check_files_are_the_same);
 
 use POSIX;
@@ -73,11 +73,11 @@ sub do_extract {
     my $native = $difffile ? 0 : 1;
     if ($native and ($tarfile =~ /\.orig\.tar\.gz$/)) {
         warning(_g("native package with .orig.tar"));
-        $native = 0; # V1_0::native doesn't handle orig.tar
+        $native = 0; # V3_0::native doesn't handle orig.tar
     }
 
     if ($native) {
-        Dpkg::Source::Package::V1_0::native::do_extract($self, $newdirectory);
+        Dpkg::Source::Package::V3_0::native::do_extract($self, $newdirectory);
     } else {
         my $expectprefix = $newdirectory;
         $expectprefix .= '.orig';
@@ -254,7 +254,7 @@ sub do_build {
     }
 
     if ($sourcestyle eq "n") {
-        Dpkg::Source::Package::V1_0::native::build($self, $dir);
+        Dpkg::Source::Package::V3_0::native::do_build($self, $dir);
     } elsif ($sourcestyle =~ m/[nurUR]/) {
         if (stat($tarname)) {
             unless ($sourcestyle =~ m/[nUR]/) {
@@ -286,7 +286,7 @@ sub do_build {
 	     $sourcepackage, $tarname);
     }
 
-    $self->add_file($tarname);
+    $self->add_file($tarname) if $tarname;
 
     if ($sourcestyle =~ m/[kpKP]/) {
         if (stat($origdir)) {

+ 2 - 3
scripts/Dpkg/Source/Package/V1_0/native.pm

@@ -14,7 +14,7 @@
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-package Dpkg::Source::Package::V1_0::native;
+package Dpkg::Source::Package::V3_0::native;
 
 use strict;
 use warnings;
@@ -89,10 +89,9 @@ sub do_build {
 
     $self->add_file($tarname);
 
+    # For backward compatibility, drop version to 1.0 if we can
     if ($self->{'options'}{'compression'} eq "gzip") {
         $self->{'fields'}{'Format'} = "1.0";
-    } else {
-        $self->{'fields'}{'Format'} = "1.0 (native)";
     }
 }
 

+ 1 - 1
scripts/Makefile.am

@@ -112,8 +112,8 @@ nobase_dist_perllib_DATA = \
 	Dpkg/Source/Functions.pm \
 	Dpkg/Source/Package.pm \
 	Dpkg/Source/Package/V1_0.pm \
-	Dpkg/Source/Package/V1_0/native.pm \
 	Dpkg/Source/Package/V2_0.pm \
+	Dpkg/Source/Package/V3_0/native.pm \
 	Dpkg/Source/Package/V3_0/git.pm \
 	Dpkg/Source/Patch.pm \
 	Dpkg.pm

+ 1 - 1
scripts/dpkg-source.pl

@@ -82,7 +82,7 @@ _darcs
 {arch}
 );
 
-my @build_formats = ("1.0", "1.0 (native)");
+my @build_formats = ("1.0", "3.0 (native)");
 my %options = (
     # Compression related
     compression => 'gzip',

+ 1 - 1
scripts/po/POTFILES.in

@@ -34,8 +34,8 @@ scripts/Dpkg/Source/Functions.pm
 scripts/Dpkg/Source/Patch.pm
 scripts/Dpkg/Source/Package.pm
 scripts/Dpkg/Source/Package/V1_0.pm
-scripts/Dpkg/Source/Package/V1_0/native.pm
 scripts/Dpkg/Source/Package/V2_0.pm
+scripts/Dpkg/Source/Package/V3_0/native.pm
 scripts/Dpkg/Source/Package/V3_0/git.pm
 scripts/Dpkg/Substvars.pm
 scripts/Dpkg/Vars.pm