[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Packaging decompyle - policy question



* Ben Burton <benb@acm.org> [011112 18:22]:
> 
> Hi.  So I'm packaging decompyle which decompiles a .pyc bytecode file and 
> converts it back to python source.
> 
> Thing is, decompyle needs to be run with the same version of python that was 
> used to create the bytecode.
> 
> So the question arises as to what should go in /usr/bin.  Options I see are:
> 
> a) A wrapper script /usr/bin/decompyle which takes an addition argument 
> specifying the python version to run and calls the real decompyle with that 
> version of python (and defaulting to the default version of python);
> 
> b) A series of binaries /usr/bin/decompyle1.5, /usr/bin/decompyle2.1, etc 
> with the additional /usr/bin/decompyle that uses the default debian version 
> of python.

Hmm, how about an third option:

c) A wrapper that auto-detects the format of the .pyc file and calls the
according variant (detection of the .pyc format should be pretty easy,
it's just a magic number, cf. /usr/share/misc/magic).


The doesn't resolve the original problem, but then you could issue a
message to the user that he needs to install an according Python
version.

In the end, this case should be pretty rare, since in most cases, it
seems to be a reasonable expectation that a user has an according Python
version on the system.


> I'm leaning towards option (b), but this then leads to the issue of how the 
> binaries should be packaged.  Should there be a single package decompyle 
> which provides all of these binaries?  Or should there be packages 
> decompyle1.5, decompyle2.1, etc.?
> 
> If there are several packages then each package will literally contain a 
> single script and a symlink to a man page and would depend on 
> decompyle-common which contains the actual decompyle itself.  This seems a 
> bit of an overkill.  But on the other hand I don't want to provide binaries 
> that people can't run (if the appropriate python version is not installed) 
> and I don't want decompyle to depend on *every* version of python in debian.


Umm, are you talking about a *binary* or an *script* ? If binaries, how
big are they ? Would it really be an issue to include three of them in a
single package ? If you include that autodetection stuff, I would say go
on and ship them into a single package (since the user gets a meaningful
message if something doesn't work due to the lack of the correct Python
version).

    Gregor



Reply to: