From: Guillem Jover Date: Wed, 15 Mar 2006 20:19:52 +0000 (+0000) Subject: Do not expand architecture aliases anymore in .dsc files. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08ab174fb2c4c165db0d5fc11d79bb45feb119bf;p=dpkg Do not expand architecture aliases anymore in .dsc files. --- diff --git a/ChangeLog b/ChangeLog index c69f91ac..724fce43 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-03-15 Guillem Jover + + * 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 * scripts/controllib.pl.in (quiet_warnings): New variable. diff --git a/debian/changelog b/debian/changelog index ae8bf4da..31914e69 100644 --- a/debian/changelog +++ b/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 * Don't try to compile in SELinux support on GNU/kFreeBSD amd64. * 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 ] * Polish (Robert Luberda). Closes: #353782 diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 5034a735..d900d87a 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -70,11 +70,6 @@ do_shell_subst = sed -e "s:version=\"[^\"]*\":version=\"$(PACKAGE_VERSION)\":" $(do_perl_subst) <$< >$@ chmod +x $@ -%.pl: %.pl.in Makefile - @test -d `dirname $@` || $(mkdir_p) `dirname $@` - $(do_perl_subst) <$< >$@ - chmod +x $@ - %: %.sh Makefile @test -d `dirname $@` || $(mkdir_p) `dirname $@` $(do_shell_subst) <$< >$@ diff --git a/scripts/controllib.pl.in b/scripts/controllib.pl similarity index 90% rename from scripts/controllib.pl.in rename to scripts/controllib.pl index 794cc34d..5a06d516 100755 --- a/scripts/controllib.pl.in +++ b/scripts/controllib.pl @@ -11,8 +11,6 @@ # "S key" where S is the source and key is the packagename # %substvar - map with substitution variables -$pkgdatadir="."; - $parsechangelog= 'dpkg-parsechangelog'; @pkg_dep_fields = qw(Replaces Provides Depends Pre-Depends Recommends Suggests @@ -79,32 +77,6 @@ sub findarch { $substvar{'Arch'}= $arch; } -sub read_cputable { - open CPUTABLE, "$pkgdatadir/cputable" - or &syserr("unable to open cputable"); - while () { - 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 () { - if (m/^(?!\#)(\S+)\s+(\S+)\s+(\S+)/) { - $ostable{$1} = $2; - $ostable_re{$1} = $3; - push @os, $1; - } - } - close OSTABLE; -} - sub debian_arch_fix { local ($os, $cpu) = @_; @@ -154,39 +126,6 @@ sub debian_arch_is { 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 { my ($v) = @_; my ($lhs,$vn,$rhs,$count); @@ -336,9 +275,7 @@ sub showdep { my @or_list = (); foreach my $dep_or (@$dep_and) { 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); } diff --git a/scripts/dpkg-architecture.pl b/scripts/dpkg-architecture.pl index 82abb4c6..607fbe4c 100755 --- a/scripts/dpkg-architecture.pl +++ b/scripts/dpkg-architecture.pl @@ -26,6 +26,8 @@ $dpkglibdir="/usr/lib/dpkg"; push(@INC,$dpkglibdir); require 'controllib.pl'; +$pkgdatadir="."; + sub usageversion { print STDERR "Debian $0 $version. @@ -52,6 +54,32 @@ Actions: "; } +sub read_cputable { + open CPUTABLE, "$pkgdatadir/cputable" + or &syserr("unable to open cputable"); + while () { + 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 () { + if (m/^(?!\#)(\S+)\s+(\S+)\s+(\S+)/) { + $ostable{$1} = $2; + $ostable_re{$1} = $3; + push @os, $1; + } + } + close OSTABLE; +} + sub split_debian { local ($_) = @_; @@ -101,6 +129,9 @@ sub gnu_to_debian { return debian_arch_fix($os, $cpu); } +&read_cputable; +&read_ostable; + # Check for -L if (grep { m/^-L$/ } @ARGV) { foreach $os (@os) { diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl index 35d547f8..1b90f4c4 100755 --- a/scripts/dpkg-source.pl +++ b/scripts/dpkg-source.pl @@ -202,10 +202,7 @@ if ($opmode eq 'build') { if (grep($sourcearch[0] eq $_, 'any','all')) { @sourcearch= ('any'); } 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") unless $a =~ /^[\w-]+$/; &error("architecture $a only allowed on its own".