From d002866b9f38035f7847b4f1b79282edfb6b0594 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Tue, 13 Oct 2009 17:00:07 +0000 Subject: add df function to urpm/sys.pm --- urpm/sys.pm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'urpm') diff --git a/urpm/sys.pm b/urpm/sys.pm index 248880ce..51b6b771 100644 --- a/urpm/sys.pm +++ b/urpm/sys.pm @@ -92,6 +92,14 @@ sub _find_a_mntpoint { undef; } +#- return the size of the partition and its free space in KiB +sub df { + my ($mntpoint) = @_; + require Filesys::Df; + my $df = Filesys::Df::df("/", 1024); # ask 1kb values + @$df{qw(blocks bfree)}; +} + sub _expand_symlink { my ($pdir) = @_; -- cgit v1.2.1