aboutsummaryrefslogtreecommitdiffstats
path: root/iurt_root_command
diff options
context:
space:
mode:
Diffstat (limited to 'iurt_root_command')
-rwxr-xr-xiurt_root_command15
1 files changed, 10 insertions, 5 deletions
diff --git a/iurt_root_command b/iurt_root_command
index ef90d5e..6de4785 100755
--- a/iurt_root_command
+++ b/iurt_root_command
@@ -405,13 +405,13 @@ sub useradd {
|| system('chroot', $dir, 'id', $username) == 0;
}
-sub urpmi {
- my ($_run, @options) = @_;
+sub check_urpmi_chroot_options {
+ my ($options) = @_;
# get all --something options
my %optvals;
my $current_opt;
- foreach (@options) {
+ foreach (@$options) {
if (/^--/) {
$current_opt = $_;
} else {
@@ -431,9 +431,14 @@ sub urpmi {
}
}
if (!$is_rooted) {
- plog('FAIL', "urpmi: must be rooted");
+ plog('FAIL', "urpmi commands must be rooted");
return;
}
- return !system('urpmi', @options);
+ return 1;
+}
+
+sub urpmi {
+ my ($_run, @options) = @_;
+ return check_urpmi_chroot_options(\@options) && !system('urpmi', @options);
}