Files
copyparty/scripts/rls.sh

63 lines
1.3 KiB
Bash
Raw Normal View History

2021-09-18 18:43:55 +02:00
#!/bin/bash
set -e
2022-08-15 19:11:21 +02:00
parallel=2
2022-08-18 19:24:06 +02:00
[ -e make-sfx.sh ] || cd scripts
[ -e make-sfx.sh ] && [ -e deps-docker ] || {
echo cd into the scripts folder first
exit 1
}
2021-09-18 18:43:55 +02:00
v=$1
2022-03-20 06:15:57 +01:00
[ "$v" = sfx ] || {
printf '%s\n' "$v" | grep -qE '^[0-9\.]+$' || exit 1
grep -E "(${v//./, })" ../copyparty/__version__.py || exit 1
2021-09-18 18:43:55 +02:00
2022-03-20 06:15:57 +01:00
git push all
git tag v$v
git push all --tags
2021-09-18 18:43:55 +02:00
2022-03-20 06:15:57 +01:00
rm -rf ../dist
2021-09-18 18:43:55 +02:00
2022-03-20 06:15:57 +01:00
./make-pypi-release.sh u
(cd .. && python3 ./setup.py clean2)
./make-tgz-release.sh $v
}
2021-09-18 18:43:55 +02:00
2022-08-15 19:11:21 +02:00
rm -f ../dist/copyparty-sfx*
2022-07-14 02:33:35 +02:00
shift
./make-sfx.sh "$@"
2022-08-15 19:11:21 +02:00
f=../dist/copyparty-sfx
[ -e $f.py ] ||
f=../dist/copyparty-sfx-gz
$f.py -h >/dev/null
[ $parallel -gt 1 ] && {
printf '\033[%s' s 2r H "0;1;37;44mbruteforcing sfx size -- press enter to terminate" K u "7m $* " K $'27m\n'
trap "rm -f .sfx-run; printf '\033[%s' s r u" INT TERM EXIT
touch .sfx-run
2022-08-18 19:24:06 +02:00
min=99999999
2022-08-15 19:11:21 +02:00
for ((a=0; a<$parallel; a++)); do
while [ -e .sfx-run ]; do
CSN=sfx$a ./make-sfx.sh re "$@"
2022-08-18 19:24:06 +02:00
sz=$(wc -c <$f$a.py | awk '{print$1}')
[ $sz -ge $min ] && continue
mv $f$a.py $f.py.$sz
min=$sz
2022-08-15 19:11:21 +02:00
done &
done
read
exit
}
2021-09-18 18:43:55 +02:00
while true; do
2022-08-15 19:11:21 +02:00
mv $f.py $f.$(wc -c <$f.py | awk '{print$1}').py
2022-07-14 02:33:35 +02:00
./make-sfx.sh re "$@"
2021-09-18 18:43:55 +02:00
done
# git tag -d v$v; git push --delete origin v$v