diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-01-27 20:32:19 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-01-27 20:32:19 +0000 |
commit | b952046fe76751a3456921a6cd163ee84e8f3f49 (patch) | |
tree | f75c67b620270bd33d0c10ff11f4655cb8d8c90f /perl-install/standalone | |
parent | c8cc8dc7a98850ae409f975f2ff530972ea5ffc6 (diff) | |
download | drakx-backup-do-not-use-b952046fe76751a3456921a6cd163ee84e8f3f49.tar drakx-backup-do-not-use-b952046fe76751a3456921a6cd163ee84e8f3f49.tar.gz drakx-backup-do-not-use-b952046fe76751a3456921a6cd163ee84e8f3f49.tar.bz2 drakx-backup-do-not-use-b952046fe76751a3456921a6cd163ee84e8f3f49.tar.xz drakx-backup-do-not-use-b952046fe76751a3456921a6cd163ee84e8f3f49.zip |
handle --removable=<dev>
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-x | perl-install/standalone/diskdrake | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/perl-install/standalone/diskdrake b/perl-install/standalone/diskdrake index fd61ba6be..5578abd1f 100755 --- a/perl-install/standalone/diskdrake +++ b/perl-install/standalone/diskdrake @@ -43,20 +43,22 @@ if ($::isEmbedded) { print "mcc pid\t$::CCPID\n"; } -my %options = map { /-?-?(.*)/ => 1 } @ARGV; +my %options = map { /(.*?)=(.*)/ ? ($1,$2) : ($_,'') } map { if_(/--?(.*)/, $1) } @ARGV; $::expert = delete $options{expert}; $::testing = delete $options{testing}; my @types = qw(hd nfs smb removable fileshare); -my $type = 'hd'; +my ($type, $para) = ('hd', ''); foreach (@types) { - if (delete $options{$_}) { + if (exists $options{$_}) { + $para = delete $options{$_}; $type = $_; last; } } %options and die "usage: diskdrake [--expert] [--testing] [--{" . join(",", @types) . "}]\n"; +$type ne 'removable' || $para or die "usage: diskdrake --removable=<dev>\n"; if ($>) { $ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}"; @@ -101,7 +103,9 @@ if ($type eq 'hd') { diskdrake::interactive::main($in, $all_hds); } elsif ($type eq 'removable') { require diskdrake::removable; - diskdrake::removable::main($in, $all_hds); + $para =~ s|^/dev/||; + my ($raw_hd) = grep { $para eq $_->{device} } @{$all_hds->{raw_hds}} or die "unknown removable $para\n"; + diskdrake::removable::main($in, $all_hds, $raw_hd); } else { $in->ask_warn('', "Sorry only a gtk frontend is available") if !$in->isa('interactive_gtk'); require diskdrake::smbnfs_gtk; |