diff options
author | Scott James Remnant <scott@netsplit.com> | 2005-03-29 13:31:15 +0100 |
---|---|---|
committer | Scott James Remnant <scott@netsplit.com> | 2005-03-29 13:31:15 +0100 |
commit | f508767236142541861ece120a5822d77cdb58e5 (patch) | |
tree | b864397ee9f30871f68d3f98ce51ad061755477e /scripts/dpkg-architecture.pl | |
parent | 4cc3ae4b3a3abda38828926b589d422596af81a8 (diff) | |
download | dpkg-f508767236142541861ece120a5822d77cdb58e5.tar.gz |
dpkg (1.13.4) experimental; urgency=low
The "Or the Wabbit gets it" Release
* Add -L option to dpkg-architecture to list architecture strings
we can accept.
-- Scott James Remnant <scott@netsplit.com> Tue, 29 Mar 2005 13:31:15 +0100
Diffstat (limited to 'scripts/dpkg-architecture.pl')
-rwxr-xr-x | scripts/dpkg-architecture.pl | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/scripts/dpkg-architecture.pl b/scripts/dpkg-architecture.pl index 63005b7bc..508b36d2e 100755 --- a/scripts/dpkg-architecture.pl +++ b/scripts/dpkg-architecture.pl @@ -41,6 +41,7 @@ Usage: Options: -a<debian-arch> set Debian architecture -t<gnu-system> set GNU system type + -L list valid architectures -f force flag (override variables set in environment) Actions: -l list variables (default) @@ -58,6 +59,7 @@ sub read_cputable { if (m/^(?!\#)(\S+)\s+(\S+)\s+(\S+)/) { $cputable{$1} = $2; $cputable_re{$1} = $3; + push @cpu, $1; } } close CPUTABLE; @@ -70,6 +72,7 @@ sub read_ostable { if (m/^(?!\#)(\S+)\s+(\S+)\s+(\S+)/) { $ostable{$1} = $2; $ostable_re{$1} = $3; + push @os, $1; } } close OSTABLE; @@ -96,13 +99,8 @@ sub debian_to_gnu { sub split_gnu { local ($_) = @_; - # Nuke the vendor bit - if (/^([^-]*)-([^-]*)-([^-]*-.*)/) { - return ($1, $3); - } else { - /^([^-]*)-(.*)/; - return ($1, $2); - } + /^([^-]*)-(.*)/; + return ($1, $2); } sub gnu_to_debian { @@ -119,7 +117,7 @@ sub gnu_to_debian { } foreach $a (keys %ostable_re) { - if ($gnu_os =~ /^$ostable_re{$a}$/) { + if ($gnu_os =~ /^(.*-)?$ostable_re{$a}$/) { $os = $a; last; } @@ -136,6 +134,20 @@ sub gnu_to_debian { &read_cputable; &read_ostable; +# Check for -L +if (grep { m/^-L$/ } @ARGV) { + foreach $os (@os) { + foreach $cpu (@cpu) { + if ($os eq "linux") { + print "$cpu\n" + } else { + print "$os-$cpu\n"; + } + } + } + exit unless $#ARGV; +} + # Set default values: chomp ($deb_build_arch = `dpkg --print-architecture`); @@ -190,6 +202,8 @@ while (@ARGV) { } elsif (m/^-c$/) { $action = 'c'; last; + } elsif (m/^-L$/) { + # Handled already } else { usageerr("unknown option \`$_'"); } |