Ver código fonte

Do not expand architecture aliases anymore in .dsc files.

Guillem Jover 20 anos atrás
pai
commit
08ab174fb2

+ 9 - 0
ChangeLog

@@ -1,3 +1,12 @@
+2006-03-15  Guillem Jover  <guillem@debian.org>
+
+	* scripts/controllib.pl.in: Rename to ...
+	* scripts/controllib.pl: ... this.
+	(debian_arch_expand): Remove function. Fix all callers.
+	(pkgdatadir, read_cputable, read_ostable): Move to ...
+	* scripts/dpkg-architecture.pl: ... here.
+	* scripts/Makefile.am (%.pl): Remove rule.
+
 2006-03-05  Guillem Jover  <guillem@debian.org>
 2006-03-05  Guillem Jover  <guillem@debian.org>
 
 
 	* scripts/controllib.pl.in (quiet_warnings): New variable.
 	* scripts/controllib.pl.in (quiet_warnings): New variable.

+ 1 - 0
debian/changelog

@@ -16,6 +16,7 @@ dpkg (1.13.17~) UNRELEASED; urgency=low
   * Add dpkg-query(1) in the SEE ALSO section in dpkg(1). Closes: #354643
   * Add dpkg-query(1) in the SEE ALSO section in dpkg(1). Closes: #354643
   * Don't try to compile in SELinux support on GNU/kFreeBSD amd64.
   * Don't try to compile in SELinux support on GNU/kFreeBSD amd64.
   * Add new quiet option to dpkg-source to supress warnings. Closes: #355065
   * Add new quiet option to dpkg-source to supress warnings. Closes: #355065
+  * Do not expand architecture aliases anymore in .dsc files.
 
 
   [ Updated man pages translations ]
   [ Updated man pages translations ]
   * Polish (Robert Luberda). Closes: #353782
   * Polish (Robert Luberda). Closes: #353782

+ 0 - 5
scripts/Makefile.am

@@ -70,11 +70,6 @@ do_shell_subst = sed -e "s:version=\"[^\"]*\":version=\"$(PACKAGE_VERSION)\":"
 	$(do_perl_subst) <$< >$@
 	$(do_perl_subst) <$< >$@
 	chmod +x $@
 	chmod +x $@
 
 
-%.pl: %.pl.in Makefile
-	@test -d `dirname $@` || $(mkdir_p) `dirname $@`
-	$(do_perl_subst) <$< >$@
-	chmod +x $@
-
 %: %.sh Makefile
 %: %.sh Makefile
 	@test -d `dirname $@` || $(mkdir_p) `dirname $@`
 	@test -d `dirname $@` || $(mkdir_p) `dirname $@`
 	$(do_shell_subst) <$< >$@
 	$(do_shell_subst) <$< >$@

+ 1 - 64
scripts/controllib.pl.in

@@ -11,8 +11,6 @@
 #                     "S key" where S is the source and key is the packagename
 #                     "S key" where S is the source and key is the packagename
 # %substvar         - map with substitution variables
 # %substvar         - map with substitution variables
 
 
-$pkgdatadir=".";
-
 $parsechangelog= 'dpkg-parsechangelog';
 $parsechangelog= 'dpkg-parsechangelog';
 
 
 @pkg_dep_fields = qw(Replaces Provides Depends Pre-Depends Recommends Suggests
 @pkg_dep_fields = qw(Replaces Provides Depends Pre-Depends Recommends Suggests
@@ -79,32 +77,6 @@ sub findarch {
     $substvar{'Arch'}= $arch;
     $substvar{'Arch'}= $arch;
 }
 }
 
 
-sub read_cputable {
-    open CPUTABLE, "$pkgdatadir/cputable"
-	or &syserr("unable to open cputable");
-    while (<CPUTABLE>) {
-	if (m/^(?!\#)(\S+)\s+(\S+)\s+(\S+)/) {
-	    $cputable{$1} = $2;
-	    $cputable_re{$1} = $3;
-	    push @cpu, $1;
-	}
-    }
-    close CPUTABLE;
-}
-
-sub read_ostable {
-    open OSTABLE, "$pkgdatadir/ostable"
-	or &syserr("unable to open ostable");
-    while (<OSTABLE>) {
-	if (m/^(?!\#)(\S+)\s+(\S+)\s+(\S+)/) {
-	    $ostable{$1} = $2;
-	    $ostable_re{$1} = $3;
-	    push @os, $1;
-	}
-    }
-    close OSTABLE;
-}
-
 sub debian_arch_fix
 sub debian_arch_fix
 {
 {
     local ($os, $cpu) = @_;
     local ($os, $cpu) = @_;
@@ -154,39 +126,6 @@ sub debian_arch_is {
     return 0;
     return 0;
 }
 }
 
 
-&read_cputable;
-&read_ostable;
-
-sub debian_arch_expand
-{
-    local ($_) = @_;
-
-    /^(!)?(.*)/;
-
-    local $not = $1 || '';
-    local $arch = $2;
-    local ($os, $cpu) = debian_arch_split($arch);
-    local @list;
-
-    if ("$os-$cpu" eq 'any-any') {
-	@list = 'any';
-    } elsif ($os eq 'all' or $cpu eq 'all') {
-	@list = 'all';
-    } elsif ($cpu eq 'any') {
-	foreach my $_cpu (@cpu) {
-	    push @list, $not.debian_arch_fix($os, $_cpu);
-	}
-    } elsif ($os eq 'any') {
-	foreach my $_os (@os) {
-	    push @list, $not.debian_arch_fix($_os, $cpu);
-	}
-    } else {
-	push @list, $not.debian_arch_fix($os, $cpu);
-    }
-
-    return @list;
-}
-
 sub substvars {
 sub substvars {
     my ($v) = @_;
     my ($v) = @_;
     my ($lhs,$vn,$rhs,$count);
     my ($lhs,$vn,$rhs,$count);
@@ -336,9 +275,7 @@ sub showdep {
         my @or_list = ();
         my @or_list = ();
         foreach my $dep_or (@$dep_and) {
         foreach my $dep_or (@$dep_and) {
             my ($package, $relation, $version, $arch_list) = @$dep_or; 
             my ($package, $relation, $version, $arch_list) = @$dep_or; 
-            my @arches = map(debian_arch_expand($_), @$arch_list);
-            chomp @arches;
-            push @or_list, $package . ($relation && $version ? " ($relation $version)" : '') . ($show_arch && @arches ? " [@arches]" : '');
+            push @or_list, $package . ($relation && $version ? " ($relation $version)" : '') . ($show_arch && @$arch_list ? " [@$arch_list]" : '');
         }
         }
         push @and_list, join(' | ', @or_list);
         push @and_list, join(' | ', @or_list);
     }
     }

+ 31 - 0
scripts/dpkg-architecture.pl

@@ -26,6 +26,8 @@ $dpkglibdir="/usr/lib/dpkg";
 push(@INC,$dpkglibdir);
 push(@INC,$dpkglibdir);
 require 'controllib.pl';
 require 'controllib.pl';
 
 
+$pkgdatadir=".";
+
 sub usageversion {
 sub usageversion {
     print STDERR
     print STDERR
 "Debian $0 $version.
 "Debian $0 $version.
@@ -52,6 +54,32 @@ Actions:
 ";
 ";
 }
 }
 
 
+sub read_cputable {
+    open CPUTABLE, "$pkgdatadir/cputable"
+	or &syserr("unable to open cputable");
+    while (<CPUTABLE>) {
+	if (m/^(?!\#)(\S+)\s+(\S+)\s+(\S+)/) {
+	    $cputable{$1} = $2;
+	    $cputable_re{$1} = $3;
+	    push @cpu, $1;
+	}
+    }
+    close CPUTABLE;
+}
+
+sub read_ostable {
+    open OSTABLE, "$pkgdatadir/ostable"
+	or &syserr("unable to open ostable");
+    while (<OSTABLE>) {
+	if (m/^(?!\#)(\S+)\s+(\S+)\s+(\S+)/) {
+	    $ostable{$1} = $2;
+	    $ostable_re{$1} = $3;
+	    push @os, $1;
+	}
+    }
+    close OSTABLE;
+}
+
 sub split_debian {
 sub split_debian {
     local ($_) = @_;
     local ($_) = @_;
     
     
@@ -101,6 +129,9 @@ sub gnu_to_debian {
     return debian_arch_fix($os, $cpu);
     return debian_arch_fix($os, $cpu);
 }
 }
 
 
+&read_cputable;
+&read_ostable;
+
 # Check for -L
 # Check for -L
 if (grep { m/^-L$/ } @ARGV) {
 if (grep { m/^-L$/ } @ARGV) {
     foreach $os (@os) {
     foreach $os (@os) {

+ 1 - 4
scripts/dpkg-source.pl

@@ -202,10 +202,7 @@ if ($opmode eq 'build') {
 		    if (grep($sourcearch[0] eq $_, 'any','all'))  {
 		    if (grep($sourcearch[0] eq $_, 'any','all'))  {
 			@sourcearch= ('any');
 			@sourcearch= ('any');
 		    } else {
 		    } else {
-			my @arches = map(debian_arch_expand($_),
-					 split(/\s+/, $v));
-			chomp @arches;
-			for $a (@arches) {
+			for $a (split(/\s+/, $v)) {
 			    &error("`$a' is not a legal architecture string")
 			    &error("`$a' is not a legal architecture string")
 				unless $a =~ /^[\w-]+$/;
 				unless $a =~ /^[\w-]+$/;
                             &error("architecture $a only allowed on its own".
                             &error("architecture $a only allowed on its own".