summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-01-21 11:48:02 +0100
committerErich Eckner <git@eckner.net>2019-01-21 11:48:02 +0100
commit4672ce0b537fda6b28e765ed040bb3a865219b77 (patch)
treea2fdb1f1968a47f28734f836e2cad6637a104d58
parentc073878b30c5d9098c8b780834ec7fce10eefc86 (diff)
downloadarchweb32-4672ce0b537fda6b28e765ed040bb3a865219b77.tar.xz
packages/pkginfo.php: print human-readable units
-rw-r--r--packages/pkginfo.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/pkginfo.php b/packages/pkginfo.php
index d495cf0..0717aa1 100644
--- a/packages/pkginfo.php
+++ b/packages/pkginfo.php
@@ -333,6 +333,11 @@ require_once BASE . "/lib/style.php";
else
$content = array_merge($mysql_content,$json_content);
+ foreach (array("Download Size", "Installed Size") as $key) {
+ $content["Print " . $key] =
+ add_fancy_unit($content[$key], "B");
+ }
+
// query substitutes
$mysql_result = mysql_run_query(
@@ -574,7 +579,7 @@ if ($count > 1 || $content["pkgname"] != $content["pkgbase"]) {
Package Size:
</th>
<td>
- <?php print if_unset($content, "Download Size", "<font color=\"#ff0000\">not found in pkg-api</font>")."\n"; ?>
+ <?php print if_unset($content, "Print Download Size", "<font color=\"#ff0000\">not found in pkg-api</font>")."\n"; ?>
</td>
</tr>
<tr>
@@ -582,7 +587,7 @@ if ($count > 1 || $content["pkgname"] != $content["pkgbase"]) {
Installed Size:
</th>
<td>
- <?php print if_unset($content, "Installed Size", "<font color=\"#ff0000\">not found in pkg-api</font>")."\n"; ?>
+ <?php print if_unset($content, "Print Installed Size", "<font color=\"#ff0000\">not found in pkg-api</font>")."\n"; ?>
</td>
</tr>
<tr>