summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-09-08 08:01:35 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-09-08 08:01:35 +0000
commita62613490deacb59d893202c96ea79444c467968 (patch)
tree02d228958a14195113e1952b4725d54c9bd2b47f /perl-install
parentcc53d7a77f5e1630fe6c0c3661829f2df3a8da1d (diff)
downloaddrakx-backup-do-not-use-a62613490deacb59d893202c96ea79444c467968.tar
drakx-backup-do-not-use-a62613490deacb59d893202c96ea79444c467968.tar.gz
drakx-backup-do-not-use-a62613490deacb59d893202c96ea79444c467968.tar.bz2
drakx-backup-do-not-use-a62613490deacb59d893202c96ea79444c467968.tar.xz
drakx-backup-do-not-use-a62613490deacb59d893202c96ea79444c467968.zip
handle options in any order
Diffstat (limited to 'perl-install')
-rwxr-xr-xperl-install/standalone/drakupdate_fstab21
1 files changed, 17 insertions, 4 deletions
diff --git a/perl-install/standalone/drakupdate_fstab b/perl-install/standalone/drakupdate_fstab
index 89689a08b..25fa7ad1c 100755
--- a/perl-install/standalone/drakupdate_fstab
+++ b/perl-install/standalone/drakupdate_fstab
@@ -31,10 +31,23 @@ $::isStandalone = 1; #- not using standalone.pm which generates too many logs fo
log::l("drakupdate_fstab called with @ARGV\n");
-$::testing = $ARGV[0] eq '--test' && shift @ARGV;
-$::auto = $ARGV[0] eq '--auto' && shift @ARGV;
-my $no_flag = $ARGV[0] eq '--no-flag' && shift @ARGV;
-my $debug = $ARGV[0] eq '--debug' && shift @ARGV;
+my ($no_flag, $debug, $removed);
+
+my %args = (
+ '--auto' => \$::auto,
+ '--debug' => \$debug,
+ '--no-flag' => \$no_flag,
+ '--test' => \$::testing,
+ );
+
+each_index {
+ if ($args{$_}) {
+ ${$args{$_}} = 1;
+ splice @ARGV, $::i - $removed, 1;
+ $removed++;
+ }
+} @ARGV;
+
my ($raw_action, $device_name) = @ARGV;
my ($action) = $raw_action =~ /^--(add|del)/;