summaryrefslogtreecommitdiffstats
path: root/urpm/args.pm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm/args.pm')
-rw-r--r--urpm/args.pm19
1 files changed, 11 insertions, 8 deletions
diff --git a/urpm/args.pm b/urpm/args.pm
index efe0349e..6bb25f20 100644
--- a/urpm/args.pm
+++ b/urpm/args.pm
@@ -134,14 +134,7 @@ my %options_spec = (
'test!' => \$::test,
'skip=s' => \$options{skip},
'prefer=s' => \$options{prefer},
- 'root=s' => sub {
- require File::Spec;
- $urpm->{root} = File::Spec->rel2abs($_[1]);
- if (!-d $urpm->{root}) {
- $urpm->{fatal}->(9, N("chroot directory doesn't exist"));
- }
- $options{nolock} = 1;
- },
+ 'root=s' => sub { set_root($urpm, $_[1]) },
'use-distrib=s' => \$options{usedistrib},
'probe-synthesis' => sub { $options{probe_with} = 'synthesis' },
'probe-hdlist' => sub { $options{probe_with} = 'hdlist' },
@@ -406,6 +399,16 @@ foreach my $k ("help|h", "version") {
$options_spec{'urpmi.recover'}{$k} = $options_spec{urpmi}{$k};
}
+sub set_root {
+ my ($urpm, $root) = @_;
+ require File::Spec;
+ $urpm->{root} = File::Spec->rel2abs($root);
+ if (!-d $urpm->{root}) {
+ $urpm->{fatal}->(9, N("chroot directory doesn't exist"));
+ }
+ $options{nolock} = 1;
+ }
+
sub parse_cmdline {
my %args = @_;
$urpm = $args{urpm};