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

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

create_sources_inc: Change how size is calculated

(cherry picked from commit a8990d3da2ba7621a3ec6b16edd2e6e69d080c8c)

M  +2    -11   create_sources_inc

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

diff --git a/create_sources_inc b/create_sources_inc
index abf8d53..d071260 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/stable/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.