dist: strip some pointless code

This commit is contained in:
ed
2024-10-01 18:35:36 +00:00
parent 44f2b63e43
commit f1646b96ca
5 changed files with 26 additions and 3 deletions

View File

@@ -27,14 +27,14 @@ help() { exec cat <<'EOF'
#
# `no-ftp` saves ~30k by removing the ftp server, disabling --ftp
#
# `no-pf` saves ~12k by removing the option to download partyfuse
#
# `no-tfp` saves ~10k by removing the tftp server, disabling --tftp
#
# `no-zm` saves ~7k by removing the zeroconf mDNS server
#
# `no-smb` saves ~3.5k by removing the smb / cifs server
#
# `no-pf` saves ~2.8k by removing the option to download partyfuse
#
# _____________________________________________________________________
# web features:
#
@@ -109,7 +109,7 @@ pybin=$(command -v python3 || command -v python) || {
langs=
use_gz=
zopf=2560
zopf=2000
while [ ! -z "$1" ]; do
case $1 in
clean) clean=1 ; ;;

View File

@@ -61,11 +61,21 @@ def uh2(fp):
# remove expensive imports too
lns = []
on = True
on2 = True
for ln in cs.split("\n"):
if ln.startswith("if True:"):
on = False
continue
if ln.endswith("# !rm.yes>"):
on2 = False
continue
if not on2:
if ln.endswith("# !rm.no>"):
on2 = True
continue
if not on and (not ln.strip() or ln.startswith(" ")):
continue