From 1e13d091b1fbf019950493b6077aeba2e300ad80 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Fri, 15 Apr 2005 15:11:28 +0000 Subject: Don't die if fstab or mtab isn't present --- urpm/sys.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/urpm/sys.pm b/urpm/sys.pm index 11c7604f..02ba628b 100644 --- a/urpm/sys.pm +++ b/urpm/sys.pm @@ -9,7 +9,7 @@ sub find_mntpoints { my (%fstab, @mntpoints); local ($_); #- read /etc/fstab and check for existing mount point. - open my $f, "/etc/fstab" or die "Can't read fstab: $!\n"; + open my $f, "/etc/fstab" or return (); while (<$f>) { next if /^\s*#/; my ($device, $mntpoint, $fstype, $options) = m!^\s*(\S+)\s+(/\S+)\s+(\S+)\s+(\S+)! @@ -30,7 +30,7 @@ sub find_mntpoints { } } close $f; - open $f, "/etc/mtab" or die "Can't read mtab: $!\n"; + open $f, "/etc/mtab" or return (); while (<$f>) { my ($device, $mntpoint, $fstype, $options) = m!^\s*(\S+)\s+(/\S+)\s+(\S+)\s+(\S+)! or next; -- cgit v1.2.1