Not all operating systems provide a "/proc/mounts" file (for exmaple,
Darwin/OS X doesn't), so ignore this error for now ...
This doesn't solve the problem per se but makes "make clean" usable
on those systems again.
Signed-off-by: Alexander Barton <alex@barton.de>
exit_status = 0
for target in targets:
if not os.path.isdir(target):
exit_status = 0
for target in targets:
if not os.path.isdir(target):
- print >> sys.stderr, target, 'is not a directory'
+ print >> sys.stderr, target, 'is not a directory!'
top = os.path.realpath(target)
top = os.path.realpath(target)
- proc_mounts = open('/proc/mounts', 'r')
+ try:
+ proc_mounts = open('/proc/mounts', 'r')
+ except IOError:
+ print >> sys.stdout, 'Cannot open /proc/mounts!'
+ sys.exit(1)
+
for line in proc_mounts:
_, point, fstype, _ = line.split(' ', 3)
point = mntent_unescape(point)
for line in proc_mounts:
_, point, fstype, _ = line.split(' ', 3)
point = mntent_unescape(point)