+compress.sh
authorJan Kratochvil <jan.kratochvil@redhat.com>
Tue, 8 Sep 2020 17:12:37 +0000 (19:12 +0200)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Tue, 8 Sep 2020 17:12:37 +0000 (19:12 +0200)
compress.sh [new file with mode: 0755]

diff --git a/compress.sh b/compress.sh
new file mode 100755 (executable)
index 0000000..d9e32fd
--- /dev/null
@@ -0,0 +1,23 @@
+#! /bin/bash
+# echo build/*.dt5.rpm.rpms/*.rpm|xargs -P192 -n64 ./compress.sh >compress.out
+# perl -ne <compress.out '/^(\d+) (\d+) / or die;$a+=$1;$b+=$2;END{print "$a $b ".$b/$a."\n"}'
+for i in "$@";do
+  mkdir work$$
+  cd work$$
+  ln ../$i
+  j=`basename $i`
+  rpm2archive $j
+  rm -f $j
+  tar xzf $j.tgz
+  rm -f $j.tgz
+  for k in `find -type f`;do
+    orig="$(find $k -printf "%s")"
+    eu-elfcompress -p -t zlib $k >>../err1 2>>../err2
+    new="$(find $k -printf "%s")"
+    if [ $orig -ne $new ];then
+      echo "$orig $new $i $k"
+    fi
+  done
+  cd ..
+  rm -rf work$$
+done