From 0fc0fcebc9086b7f3c0e67c3fc0fc70e2eae1363 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Mon, 29 Nov 2004 18:24:54 +0000 Subject: Factorize code that sets default values for some options --- urpm.pm | 5 +++++ urpmi | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/urpm.pm b/urpm.pm index a3672066..ce5d7074 100644 --- a/urpm.pm +++ b/urpm.pm @@ -181,6 +181,11 @@ sub read_config { $urpm->probe_medium($medium, %options) and push @{$urpm->{media}}, $medium; } + #- load default values + foreach (qw(post-clean verify-rpm)) { + exists $urpm->{options}{$_} or $urpm->{options}{$_} = 1; + } + $urpm->{media} = [ sort { $a->{priority} <=> $b->{priority} } @{$urpm->{media}} ]; #- keep in mind when an hdlist/list file is already used diff --git a/urpmi b/urpmi index c1ca8969..2e85d6d9 100755 --- a/urpmi +++ b/urpmi @@ -332,9 +332,6 @@ $urpm->configure(nocheck_access => $env || $< != 0, usedistrib => $usedistrib, ); #- get back activated default values of boolean options. -foreach (qw(post-clean verify-rpm)) { - exists $urpm->{options}{$_} or $urpm->{options}{$_} = 1; -} exists $urpm->{options}{'split-level'} or $urpm->{options}{'split-level'} = $split_level; exists $urpm->{options}{'split-length'} or $urpm->{options}{'split-length'} = $split_length; # comma-separated list of packages that should be installed first, -- cgit v1.2.1