aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Matsuoka <claudio@mandriva.com>2006-11-06 16:48:39 +0000
committerClaudio Matsuoka <claudio@mandriva.com>2006-11-06 16:48:39 +0000
commit2c49ff0e36feca0ae5e505efd6e878d816211506 (patch)
treede04f8fd61d2738ed04924acd783df6ac851f74d
parent0aa7000627e5b1088a8a2ee75798f17ff0095635 (diff)
downloadiurt-2c49ff0e36feca0ae5e505efd6e878d816211506.tar
iurt-2c49ff0e36feca0ae5e505efd6e878d816211506.tar.gz
iurt-2c49ff0e36feca0ae5e505efd6e878d816211506.tar.bz2
iurt-2c49ff0e36feca0ae5e505efd6e878d816211506.tar.xz
iurt-2c49ff0e36feca0ae5e505efd6e878d816211506.zip
Cosmetics: minor indentation changes
-rwxr-xr-xiurt228
1 files changed, 20 insertions, 8 deletions
diff --git a/iurt2 b/iurt2
index 0efe583..62b0fac 100755
--- a/iurt2
+++ b/iurt2
@@ -235,30 +235,38 @@ open(my $LOG, ">&STDERR");
$run{LOG} = $LOG;
print "$program_name version $VERSION\n";
-plog_init($program_name, $LOG, $run{verbose});
-
my $todo = parseCommandLine($program_name, \@ARGV, \@params);
@ARGV and usage($program_name, \@params, "@ARGV, too many arguments");
+
+plog_init($program_name, $LOG, $run{verbose});
+
foreach my $t (@$todo) {
plog(6, "$t->[2]");
- &{$t->[0]}(@{$t->[1]}) or print {$run{LOG}} "ERROR: $t->[2]\n";
+ &{$t->[0]}(@{$t->[1]}) or plog("ERROR: $t->[2]");
}
+
$run{distro_tag} = $run{distro};
$run{distro_tag} =~ s,/,-,g;
-my $real_arch = `uname -m`;
-chomp $real_arch;
+chomp(my $real_arch = `uname -m`);
my $HOME = $ENV{HOME};
my $configfile = "$HOME/.iurt.$run{distro_tag}.conf";
+
plog(2, "loading config file $configfile");
my $config;
if (-f $configfile) {
- $config = do $configfile or die "FATAL $program_name: syntax error in $configfile";
+ $config = do $configfile or
+ die "FATAL $program_name: syntax error in $configfile";
} else {
$config = {}
}
-my $urpmi = Iurt::Urpmi->new(run => \%run, config => $config, urpmi_options => "-v --no-verify-rpm --nolock --auto --ignoresize");
+
+my $urpmi = Iurt::Urpmi->new(
+ run => \%run,
+ config => $config,
+ urpmi_options => "-v --no-verify-rpm --nolock --auto --ignoresize"
+);
$run{urpmi} = $urpmi;
if (!$run{chrooted_urpmi} && $run{group}) {
@@ -294,12 +302,16 @@ my %config_usage = (
supported_arch => { desc => 'Table of supported architecture', default => ['i586', 'x86_64'] },
upload => { desc => 'Where to copy build packages', default => "$HOME/uploads/" },
vendor => { desc => 'Name of the packages vendor', default => 'Mandriva' },
- );
+);
+
config_usage() if $run{config_usage};
+
$run{my_arch} or usage($program_name, \@params, "no architecture given (media $run{media}, run{my_arch} $run{my_arch}, todo @{$run{todo}})");
+
if (!$arch_comp{$real_arch}{$run{my_arch}}) {
die "FATAL $program_name: could not compile $run{my_arch} binaries on a $real_arch"
}
+
config_init(\%config_usage, $config, \%run);
$config->{upload} .= $run{distro};