Packaging .py files
Jakub Bogusz
qboosh at pld-linux.org
Thu Jul 17 18:06:23 CEST 2008
On Thu, Jul 17, 2008 at 04:50:24PM +0200, Mariusz Mazur wrote:
> Dnia czwartek, 17 lipca 2008, Bartosz Taudul napisał:
> > The number of sane developers without inferiority complex is very low
> > and I don't like to talk with idiots if I don't have to.
>
> That's why I prefer not to have too many pld specific changes, since it's
> easier to merge something upstream when you can point at a major distro and
> say that the current way also breaks on e.g. Fedora.
>
> > > Doing it 'our way' is simply pointless
> >
> > Our way? https://wiki.ubuntu.com/DashAsBinSh
>
> Ok, that's enough for me if there are other mainstream distros that don't use
> bash.
And remember that most of software we use (except some system tools)
could be used on UNIX, not just Linux.
Is there any other OS (beside some Linux distros and Hurd) which uses
bash as sh?
On *BSD, Solaris, AIX etc. there is even no /bin/bash (in most cases you
can find it in /usr/local/bin, if GNU tools are installed).
> Regarding original thread, I'm still in favor of packaging *.py files in base
> packages.
>
> One other option to consider. According to this document:
> http://www.debian.org/doc/packaging-manuals/python-policy/ch-module_packages.html
>
> Debian does the following:
>
> "If a package provides any binary-independent modules (foo.py files), the
> corresponding bytecompiled modules (foo.pyc files) and optimized modules
> (foo.pyo files) must not ship in the package. Instead, they should be
> generated in the package's postinst, and removed in the package's prerm. The
> package's prerm has to make sure that both foo.pyc and foo.pyo are removed."
>
> This obviously makes installation a bit slower, but has the advantage of being
> python-version independent, meaning when you upgrade python, you don't have
> to rebuild all python-dependant packages and reinstall them -- postinst
> scripts just rebuild *.py{c,o} files on your system and you're done.
>
> Major problem -- it's slower.
Major problem is that there is no way to verify *.pyc consistency
against package database. One can place any malicious code in *.pyc
leaving *.py untouched and it's hard to detect.
That's why I don't like the Debian way.
--
Jakub Bogusz http://qboosh.pl/
More information about the pld-devel-en
mailing list