diff options
author | Thierry Vignaud <tv@mandriva.org> | 2007-08-27 09:31:03 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2007-08-27 09:31:03 +0000 |
commit | a3c7b1c49228ebcb07f8fffdecf3cfaf0035e53b (patch) | |
tree | e8d761858135905cd1b2969210d42700a3230fe0 /Rpmdrake/init.pm | |
parent | bd6d17563ff72a3777da12955dd0f87a30e0be79 (diff) | |
download | rpmdrake-a3c7b1c49228ebcb07f8fffdecf3cfaf0035e53b.tar rpmdrake-a3c7b1c49228ebcb07f8fffdecf3cfaf0035e53b.tar.gz rpmdrake-a3c7b1c49228ebcb07f8fffdecf3cfaf0035e53b.tar.bz2 rpmdrake-a3c7b1c49228ebcb07f8fffdecf3cfaf0035e53b.tar.xz rpmdrake-a3c7b1c49228ebcb07f8fffdecf3cfaf0035e53b.zip |
rename options as rpmdrake_options so that we can reuse urpm::args someday
Diffstat (limited to 'Rpmdrake/init.pm')
-rwxr-xr-x | Rpmdrake/init.pm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Rpmdrake/init.pm b/Rpmdrake/init.pm index efa3d094..0dfb467b 100755 --- a/Rpmdrake/init.pm +++ b/Rpmdrake/init.pm @@ -31,7 +31,7 @@ BEGIN { $::no_global_argv_parsing = 1 } use Exporter; our @ISA = qw(Exporter); -our @EXPORT = qw(init warn_about_user_mode $changelog_first $default_list_mode %options $MODE); +our @EXPORT = qw(init warn_about_user_mode $changelog_first $default_list_mode %rpmdrake_options $MODE); BEGIN { #- we want to run this code before the Gtk->init of the use-my_gtk my $basename = sub { local $_ = shift; s|/*\s*$||; s|.*/||; $_ }; @@ -84,31 +84,31 @@ if ($collation_locale) { } my $version = 1; -our %options; +our %rpmdrake_options; foreach (@ARGV) { /^-?-(\S+)$/ or next; my $val = $1; if ($val =~ /=/) { my ($name, $values) = split /=/, $val; my @values = split /,/, $values; - $options{$name} = \@values if @values; + $rpmdrake_options{$name} = \@values if @values; } else { if ($val eq 'version') { print "$0 $version\n"; exit(0); } - $options{$val} = 1; + $rpmdrake_options{$val} = 1; } } foreach my $option (qw(media mode parallel pkg-nosel pkg-sel search)) { - if (defined $options{$option} && !ref($options{$option})) { + if (defined $rpmdrake_options{$option} && !ref($rpmdrake_options{$option})) { warn "wrong usage of \"$option\" option!\n"; exit(-1); # too early for my_exit() } } -our $MODE = ref $options{mode} ? $options{mode}[0] : undef; +our $MODE = ref $rpmdrake_options{mode} ? $rpmdrake_options{mode}[0] : undef; unless ($MODE) { $MODE = 'install'; $0 =~ m|remove$| and $MODE = 'remove'; @@ -123,11 +123,11 @@ if ($MODE eq 'remove') { $default_list_mode = 'all_updates'; } -$MODE eq 'update' || $options{root} and require_root_capability(); +$MODE eq 'update' || $rpmdrake_options{root} and require_root_capability(); $::noborderWhenEmbedded = 1; our $changelog_first = $changelog_first_config->[0]; -$changelog_first = 1 if $options{'changelog-first'}; +$changelog_first = 1 if $rpmdrake_options{'changelog-first'}; sub warn_about_user_mode() { $> and (interactive_msg(N("Running in user mode"), |