[Buildd-tools-devel] Bug#418061: please use du -k

Martin Koeppe martin at koeppe-net.de
Fri Apr 6 15:59:06 UTC 2007


Package: sbuild
Version: 0.53
Severity: wishlist
Tags: patch

To increase portability, could you please consider using
"du -k -s" instead of just "du -s" when determinating needed build 
space? I use a "du" which by default outputs the number of blocks, not 
kilobytes. You might apply the following patch:


--- /usr/bin/sbuild.orig	Thu Apr  5 13:48:52 2007
+++ /usr/bin/sbuild	Thu Apr  5 14:08:20 2007
@@ -692,7 +692,7 @@
  	}

  	$main::pkg_fail_stage = "check-space";
-	my $current_usage = `/usr/bin/du -s .`;
+	my $current_usage = `/usr/bin/du -k -s .`;
  	$current_usage =~ /^(\d+)/;
  	$current_usage = $1;
  	if ($current_usage) {
@@ -2473,9 +2473,9 @@

  		if (/^\Q$main::chroot_dir\E/) {
  			$_ =~ s/^\Q$main::chroot_dir\E//;
-			$command = get_command("/usr/bin/du -s $_ 2>/dev/null", "root", 1, 0);
+			$command = get_command("/usr/bin/du -k -s $_ 2>/dev/null", "root", 1, 0);
  		} else {
-			$command = get_command("/usr/bin/du -s $_ 2>/dev/null", $main::username, 0, 0);
+			$command = get_command("/usr/bin/du -k -s $_ 2>/dev/null", $main::username, 0, 0);
  		}

  		if (!open( PIPE, "$command |" )) {



Thanks for consideration

Martin




More information about the Buildd-tools-devel mailing list