From 96396d2b9c1626cbb1bb4afc74a2517e51832802 Mon Sep 17 00:00:00 2001 From: Florent Villard Date: Thu, 29 Dec 2005 16:03:38 +0000 Subject: Perform a basic check of the architecture before running --- iurt2 | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'iurt2') diff --git a/iurt2 b/iurt2 index 673f1c1..399a317 100755 --- a/iurt2 +++ b/iurt2 @@ -43,6 +43,18 @@ my $media = shift @argv; my @special_srpm_dir = @argv; $my_arch or usage(); +my $real_arch = `uname -m`; +chomp $real_arch; +my %arch_comp = ( + 'i586' => { 'i386' => 1, 'i486' => 1, 'i586' => 1 }, + 'i686' => { 'i386' => 1, 'i486' => 1, 'i586' => 1, 'i686' => 1 }, + 'x86_64' => { 'i386' => 1, 'i486' => 1, 'i586' => 1, 'i686' => 1, 'x86_64' => 1 }, + 'ppc' => { 'ppc' => 1 }, + 'ppc64' => { 'ppc' => 1, 'ppc64' => 1 }, +); +if (!$arch_comp{$real_arch}{$my_arch}) { + die "FATAL iurt: could not compile $my_arch binaries on a $real_arch" +} my $HOME = $ENV{HOME}; my $configfile = "$HOME/.iurt.$distro_tag.conf"; -- cgit v1.2.1