summaryrefslogtreecommitdiff
path: root/Build/Deb.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Build/Deb.pm')
-rw-r--r--Build/Deb.pm40
1 files changed, 33 insertions, 7 deletions
diff --git a/Build/Deb.pm b/Build/Deb.pm
index 2620873..7f1f7ec 100644
--- a/Build/Deb.pm
+++ b/Build/Deb.pm
@@ -1,3 +1,23 @@
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
package Build::Deb;
use strict;
@@ -9,6 +29,18 @@ eval {
$have_zlib = 1;
};
+sub basearch {
+ my ($arch) = @_;
+ $arch = 'all' if !defined($arch) || $arch eq 'noarch';
+ $arch = 'i386' if $arch =~ /^i[456]86$/;
+ $arch = 'powerpc' if $arch eq 'ppc';
+ $arch = 'ppc64el' if $arch eq 'ppc64le';
+ $arch = 'amd64' if $arch eq 'x86_64';
+ $arch = 'armel' if $arch =~ /^armv[4567]l$/;
+ $arch = 'armhf' if $arch eq 'armv7hl';
+ return $arch;
+}
+
sub parse {
my ($bconf, $fn) = @_;
my $ret;
@@ -22,13 +54,7 @@ sub parse {
}
# map to debian names
$os = 'linux' if !defined($os);
- $arch = 'all' if !defined($arch) || $arch eq 'noarch';
- $arch = 'i386' if $arch =~ /^i[456]86$/;
- $arch = 'powerpc' if $arch eq 'ppc';
- $arch = 'ppc64el' if $arch eq 'ppc64le';
- $arch = 'amd64' if $arch eq 'x86_64';
- $arch = 'armel' if $arch =~ /^armv[4567]l$/;
- $arch = 'armhf' if $arch eq 'armv7hl';
+ $arch = basearch($arch);
if (ref($fn) eq 'ARRAY') {
@control = @$fn;