[sysadmin/release-tools] /: create_sources_inc: Change how size is calculated

Albert Astals Cid <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit a8990d3da2ba7621a3ec6b16edd2e6e69d080c8c by Albert Astals Cid, on behalf of Heiko Becker.
Committed on 03/08/2026 at 20:36.
Pushed by aacid into branch 'master'.

create_sources_inc: Change how size is calculated

M  +2    -11   create_sources_inc

https://invent.kde.org/sysadmin/release-tools/-/commit/a8990d3da2ba7621a3ec6b16edd2e6e69d080c8c

diff --git a/create_sources_inc b/create_sources_inc
index 6f550ef..37d6ef3 100755
--- a/create_sources_inc
+++ b/create_sources_inc
@@ -10,17 +10,8 @@ process_folder()
         l=`echo $filename | sed -e "s#.tar.xz##"`
         echo '   <td><a href="http://download.kde.org/unstable/release-service/'$version'/'$2'/'$filename'">'$l'</a></td>'
         size=`stat -c "%s" $i`
-        size=`echo "$size / 1024" | bc`
-        if test "$size" -lt 1024; then
-            size="$size"kB
-        else
-            size=`echo "($size * 10) / 1024" | bc`
-            if test "$size" -lt 100; then
-                size=`echo "$size"MB | sed -e "s#\(.\)MB#.\1MB#"`
-            else
-               size=`echo "$size"MB | sed -e "s#\(.\)MB#MB#"`
-            fi
-        fi
+        size=$(($size / 1024))
+        size="$size"kB
         echo '   <td align="right">'$size'</td>'
         sha256=`sha256sum $i | cut -f1 -d' '`
         echo '   <td><tt>'$sha256'</tt></td>'
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.