Optimized installed scripts.

Added a script to create a postinst script that compiles all the
sources that doesn't use macros.
This commit is contained in:
Salvador E. Tropea 2020-07-11 20:24:51 -03:00
parent a23477d8c2
commit c04d190d01
3 changed files with 30 additions and 11 deletions

View File

@ -7,6 +7,8 @@ USER_ID=$(shell id -u)
GROUP_ID=$(shell id -g)
deb:
perl debian/make_postinst.pl > debian/postinst
chmod +x debian/postinst
fakeroot dpkg-buildpackage -uc -b
lint: doc

14
debian/make_postinst.pl vendored Normal file
View File

@ -0,0 +1,14 @@
#!/usr/bin/perl
@l=glob('kiplot/*.py');
print("#!/bin/sh\n");
print("set -e\n");
foreach $v (@l)
{
$a = `grep "import macros" $v`;
if ($?)
{
$v = "/usr/lib/python3/dist-packages/$v";
$cmd = "py3compile -V 3.2- $v";
print("$cmd\n");
}
}

25
debian/postinst vendored
View File

@ -1,13 +1,16 @@
#!/bin/sh
set -e
# Disabled because macros will fail.
# Automatically added by dh_python3:
#if which py3compile >/dev/null 2>&1; then
# py3compile -p kiplot.inti-cmnb -V 3.2-
#fi
#if which pypy3compile >/dev/null 2>&1; then
# pypy3compile -p kiplot.inti-cmnb -V 3.2- || true
#fi
# End automatically added section
py3compile -V 3.2- /usr/lib/python3/dist-packages/kiplot/__init__.py
py3compile -V 3.2- /usr/lib/python3/dist-packages/kiplot/__main__.py
py3compile -V 3.2- /usr/lib/python3/dist-packages/kiplot/__version__.py
py3compile -V 3.2- /usr/lib/python3/dist-packages/kiplot/config_reader.py
py3compile -V 3.2- /usr/lib/python3/dist-packages/kiplot/docopt.py
py3compile -V 3.2- /usr/lib/python3/dist-packages/kiplot/error.py
py3compile -V 3.2- /usr/lib/python3/dist-packages/kiplot/gs.py
py3compile -V 3.2- /usr/lib/python3/dist-packages/kiplot/kiplot.py
py3compile -V 3.2- /usr/lib/python3/dist-packages/kiplot/log.py
py3compile -V 3.2- /usr/lib/python3/dist-packages/kiplot/macros.py
py3compile -V 3.2- /usr/lib/python3/dist-packages/kiplot/misc.py
py3compile -V 3.2- /usr/lib/python3/dist-packages/kiplot/optionable.py
py3compile -V 3.2- /usr/lib/python3/dist-packages/kiplot/pre_base.py
py3compile -V 3.2- /usr/lib/python3/dist-packages/kiplot/reg_out.py