summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm')
-rw-r--r--urpm/sys.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/urpm/sys.pm b/urpm/sys.pm
index 97f37435..1ccc3b6e 100644
--- a/urpm/sys.pm
+++ b/urpm/sys.pm
@@ -107,4 +107,17 @@ sub find_mntpoints {
@mntpoints;
}
+#- checks if the main filesystems are writeable for urpmi to install files in
+sub check_fs_writable () {
+ open my $mounts, '/proc/mounts' or do { warn "Can't read /proc/mounts: $!\n"; return 1 };
+ local *_;
+ while (<$mounts>) {
+ (undef, our $mountpoint, undef, my $opts) = split ' ';
+ if ($opts =~ /\bro\b/ && $mountpoint =~ m!^(/|/usr|/s?bin)$!) {
+ return 0;
+ }
+ }
+ 1;
+}
+
1;