summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-03-03 11:45:23 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-03-03 11:45:23 +0000
commit2e874f7ba0ecafe32de081da72eaab51dd20a920 (patch)
tree33b6467503a49ac90e87446954be08c1d290b51d /perl-install/standalone
parentb128756215cd5c8cddc5d17a5b4b1fd6cff1fc33 (diff)
downloaddrakx-2e874f7ba0ecafe32de081da72eaab51dd20a920.tar
drakx-2e874f7ba0ecafe32de081da72eaab51dd20a920.tar.gz
drakx-2e874f7ba0ecafe32de081da72eaab51dd20a920.tar.bz2
drakx-2e874f7ba0ecafe32de081da72eaab51dd20a920.tar.xz
drakx-2e874f7ba0ecafe32de081da72eaab51dd20a920.zip
- device_name_to_entry() will not fail anymore so that removing a device works
- log calls to drakupdate_fstab - use "find" instead of "grep" where possible
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-xperl-install/standalone/drakupdate_fstab10
1 files changed, 7 insertions, 3 deletions
diff --git a/perl-install/standalone/drakupdate_fstab b/perl-install/standalone/drakupdate_fstab
index ced536698..8bc72aacc 100755
--- a/perl-install/standalone/drakupdate_fstab
+++ b/perl-install/standalone/drakupdate_fstab
@@ -29,6 +29,8 @@ use fs;
$::isStandalone = 1; #- not using standalone.pm which generates too many logs for drakupdate_fstab purpose
+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;
@@ -61,13 +63,13 @@ sub device_name_to_entry {
my ($e, $nb);
if ((my $devfs_prefix, $nb) = $name =~ m,(.*)/(?:cd|disc|part(\d+))$,) {
- ($e) = grep { $_->{devfs_prefix} eq $devfs_prefix } @l or return;
+ $e = find { $_->{devfs_prefix} eq $devfs_prefix } @l;
} else {
- if (($e) = grep { $name eq $_->{device} } @l) {
+ if ($e = find { $name eq $_->{device} } @l) {
$nb = '';
} else {
(my $prefix, $nb) = $name =~ m/^(.*?)(\d*)$/;
- ($e) = grep { $prefix eq ($_->{prefix} || $_->{device}) } @l or return;
+ $e = find { $prefix eq ($_->{prefix} || $_->{device}) } @l;
}
}
@@ -75,6 +77,8 @@ sub device_name_to_entry {
$e->{devfs_device} = $e->{devfs_prefix} . '/part' . $nb;
$e->{device} = ($e->{prefix} || $e->{device}) . $nb;
}
+ $e ||= {};
+ $e->{device} = $name; #- keeping the exact name given (often is the devfs name)
$e;
}