[buildd-tools-devel] [PATCH] Fix Sbuild::df to report free space on partition, not occupied one
Mikhail Gusarov
dottedmag at dottedmag.net
Wed Nov 25 03:04:59 UTC 2009
Sbuild::df is used for checking free space (see Buildd::Daemon::do_build
and Sbuild::Build::build), so it is really unconvenient that it returns
occupied space instead :)
This obvious patch fixes the problem, so it is now possible to run sbuild
with tmpfs mounted over /build (which obviously does not have enough
garbage to pass the free space check).
Signed-off-by: Mikhail Gusarov <dottedmag at dottedmag.net>
---
lib/Sbuild.pm | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/Sbuild.pm b/lib/Sbuild.pm
index bf5db27..fe6f978 100644
--- a/lib/Sbuild.pm
+++ b/lib/Sbuild.pm
@@ -480,7 +480,7 @@ sub df {
my $stat = Filesys::Df::df($dir);
- return $stat->{used} if (defined($stat));
+ return $stat->{bfree} if (defined($stat));
# This only happens if $dir was not a valid file or directory.
return 0;
--
1.6.3.3
More information about the Buildd-tools-devel
mailing list