summaryrefslogtreecommitdiffstats
path: root/etc/inc/pkg-utils.inc
diff options
context:
space:
mode:
Diffstat (limited to 'etc/inc/pkg-utils.inc')
-rw-r--r--etc/inc/pkg-utils.inc13
1 files changed, 12 insertions, 1 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc
index 21d1cd3..3ecf4f2 100644
--- a/etc/inc/pkg-utils.inc
+++ b/etc/inc/pkg-utils.inc
@@ -778,7 +778,6 @@ function walk_depend($depend, $pkgdb = "", $alreadyseen = "") {
continue;
}
}
- print $size;
return $size;
}
@@ -794,4 +793,16 @@ function get_package_install_size($pkg = 'all', $pkg_info = "") {
}
return $toreturn;
}
+
+function squash_from_bytes($size) {
+ $conv = array(1 => "B", "K", "M", "G");
+ print_r($conv);
+ foreach($conv as $div => $suffix) {
+ $sizeorig = $size;
+ if(($size /= 1024) < 1) {
+ return $sizeorig . $suffix;
+ }
+ }
+ return;
+}
?>
OpenPOWER on IntegriCloud