From d68028890d690eefb18ac4bcf248818172883790 Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 16 Feb 2026 21:24:42 +0000 Subject: [PATCH] minify translations a little; saves 7.4 KiB after zopfli; reduction from 343.8 to 336.4 --- copyparty/web/Makefile | 5 +++++ copyparty/web/Makefile.s1 | 1 + scripts/make-pypi-release.sh | 2 +- scripts/make-sfx.sh | 10 +++++++++- 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100755 copyparty/web/Makefile.s1 diff --git a/copyparty/web/Makefile b/copyparty/web/Makefile index 2ca0f107..2f9670c5 100644 --- a/copyparty/web/Makefile +++ b/copyparty/web/Makefile @@ -6,6 +6,11 @@ pk: $(addsuffix .gz, $(wildcard tl/*.js *.js *.css) \ a/webdav-cfg.txt ) un: $(addsuffix .un, $(wildcard tl/*.gz *.gz a/*.gz)) +tl/%.js.gz: tl/%.js + ./Makefile.s1 <$< | pigz -c11 -J 34 -I 573 >$@ + touch -r $< $@ + rm $< + %.gz: % pigz -c11 -J 34 -I 573 <$< >$@ touch -r $< $@ diff --git a/copyparty/web/Makefile.s1 b/copyparty/web/Makefile.s1 new file mode 100755 index 00000000..931eb515 --- /dev/null +++ b/copyparty/web/Makefile.s1 @@ -0,0 +1 @@ +sed -r 's/^\t+//;s/^"([a-zA-Z][a-zA-Z0-9_]*)": /\1:/; /^\/\//d; s/([^\]["'\''],) *\/\/.*/\1/; /^$/d' \ No newline at end of file diff --git a/scripts/make-pypi-release.sh b/scripts/make-pypi-release.sh index 7ed3b8a0..23446a98 100755 --- a/scripts/make-pypi-release.sh +++ b/scripts/make-pypi-release.sh @@ -150,7 +150,7 @@ done rm -rf contrib [ $fast ] && sed -ri s/573/10/ copyparty/web/Makefile -(cd copyparty/web && make -j$(nproc) && rm Makefile) +(cd copyparty/web && make -j$(nproc) && rm Makefile*) rm -f copyparty/web/deps/README.md # build diff --git a/scripts/make-sfx.sh b/scripts/make-sfx.sh index afd12c3b..af4060b7 100755 --- a/scripts/make-sfx.sh +++ b/scripts/make-sfx.sh @@ -435,7 +435,11 @@ find -name py.typed -delete find -type f \( -name .DS_Store -or -name ._.DS_Store \) -delete find -type f -name ._\* | while IFS= read -r f; do cmp <(printf '\x00\x05\x16') <(head -c 3 -- "$f") && rm -fv -- "$f"; done -rm -f copyparty/web/deps/*.full.* copyparty/web/deps/README.md copyparty/web/dbg-* copyparty/web/Makefile +rm -f \ + copyparty/web/deps/*.full.* \ + copyparty/web/deps/README.md \ + copyparty/web/dbg-* \ + copyparty/web/Makefile* find copyparty | LC_ALL=C sort | sed -r 's/\.gz$//;s/$/,/' > have cat have | while IFS= read -r x; do @@ -599,6 +603,10 @@ gzres() { np=$(nproc) echo "$pk #$np" + find copyparty/web/tl | grep '\.js$' | while IFS= read -r f; do + /bin/sh ../copyparty/web/Makefile.s1 <"$f" >t; tmv "$f" + done + while IFS=' ' read -r _ f; do while true; do na=$(ps auxwww | grep -F "$pk" | wc -l)