summaryrefslogtreecommitdiff
path: root/source/e/emacspeak/prune-unneeded-files.sh
diff options
context:
space:
mode:
authorPatrick J Volkerding <volkerdi@slackware.com>2020-07-29 04:46:21 +0000
committerEric Hameleers <alien@slackware.com>2020-07-29 17:59:53 +0200
commit9faa0e110ecf14ad2a82d6c7fd2c72a78a49ea0d (patch)
tree04b5ad5aa57320f5ba81b3f03f18a3e9f697856f /source/e/emacspeak/prune-unneeded-files.sh
parent3df47c8baadd98f1a0572144353c056b5ea7357f (diff)
downloadcurrent-e491bd994e794f17e37c60c3007f9f91ddba017e.tar.gz
Wed Jul 29 04:46:21 UTC 202020200729044621
d/git-2.28.0-x86_64-1.txz: Upgraded. e/emacspeak-52.0-x86_64-1.txz: Added. l/espeak-ng-1.50-x86_64-1.txz: Added. l/pcaudiolib-1.1-x86_64-1.txz: Added. l/xxHash-0.8.0-x86_64-1.txz: Upgraded. xap/xaos-4.1-x86_64-1.txz: Upgraded.
Diffstat (limited to 'source/e/emacspeak/prune-unneeded-files.sh')
-rwxr-xr-xsource/e/emacspeak/prune-unneeded-files.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/source/e/emacspeak/prune-unneeded-files.sh b/source/e/emacspeak/prune-unneeded-files.sh
new file mode 100755
index 00000000..6acef88d
--- /dev/null
+++ b/source/e/emacspeak/prune-unneeded-files.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+# Repacks the emacspeak tarball to remove some large/unused files.
+
+PKGNAM=emacspeak
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.bz2 | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+
+# Unpack original .tar.bz2:
+rm -rf ${PKGNAM}-${VERSION}
+tar xf ${PKGNAM}-${VERSION}.tar.bz2 || exit 1
+
+# I have no idea what these are useful for. They aren't referenced anywhere
+# else. If .json weren't such a bloated format I might keep them just in case,
+# but let's strip them out for now. If it would be better to keep them (perhaps
+# compressed as .gz or .xz), let me know.
+( cd ${PKGNAM}-${VERSION}/etc && rm -f CompSciFact.json TVRaman.json UnixToolTip.json )
+
+# Get rid of support files used to build .html:
+( cd ${PKGNAM}-${VERSION}/etc
+ for file in *.html ; do
+ for supportfile in $(basename $file .html).* ; do
+ if [ ! "$file" = "$supportfile" ]; then
+ rm -f $supportfile
+ fi
+ done
+ done
+)
+
+# Keep the last 6 NEWS files:
+( cd ${PKGNAM}-${VERSION}/etc
+ mkdir news-tmp
+ mv $(ls -t NEWS* | head -n 6) news-tmp
+ rm -f NEWS*
+ mv news-tmp/* .
+ rmdir news-tmp
+)
+
+# Drop the Makefile in etc/:
+rm -f ${PKGNAM}-${VERSION}/etc/Makefile
+
+# Repack as .tar.lz:
+rm -f ${PKGNAM}-${VERSION}.tar
+tar cf ${PKGNAM}-${VERSION}.tar ${PKGNAM}-${VERSION}
+rm -f ${PKGNAM}-${VERSION}.tar.lz
+plzip -9 ${PKGNAM}-${VERSION}.tar
+touch -r ${PKGNAM}-${VERSION}.tar.bz2 ${PKGNAM}-${VERSION}.tar.lz
+rm -r ${PKGNAM}-${VERSION}