On Tue, Feb 12, 2002 at 10:17:16PM +0000, Julian Gilbey wrote: > On Mon, Feb 11, 2002 at 10:19:56PM +1100, Donovan Baarda wrote: > > > > Why not take the emacsen-common method and code and use this for > > > > python? It probably won't work for C-extension modules, but it could > > > > make life easier for pure Python ones. > > > > Just a thought; since we already have a database of packages in the form of > > the dpkg database, is it possible to do something simple using it instead of > > introducing some other database? As an example, can a python package call > > "dpkg-reconfigure" for all installed packages that depend on "python" in > > its postinst script? > > You have two cases to consider: > > (1) Installing/removing pythonX.Y package > > (2) Installing/removing a python-depending package > > Your suggestion will perhaps work for the former but not for the > latter: every python package which wishes to use this scheme will have > to have postinst code anyway. [...]
This was just an off-the cuff suggestion intended to prompt some thinking... Since doing some more thinking about it, I think I can see a way that it can be done for both cases, but not easily or efficiently. The trick is to have multi-version python modules have "Depends: (pythonX.Y | pythonX.Y+1 | ...)" including every version of python they are compatible with. This can be used to indicate what versions of python the module should be sym-linked and compiled for when/if they are installed. When a new python-<foo> is installed/removed, it's .post(inst/rm) script calles a python-central style "register-python-package" to symlink+compile/remove its .py's for all the currently installed versions of pythonX.Y. When a new pythonX.Y is installed/removed, it must find every package with a pythonX.Y dependancy and symlink+compile/remove all files matching /usr/lib/python/site-packages/*.py. Perhaps something like; # get_modules <python version> # return all packages that have multi-version python modules that work for # the specified <python version> get_modules() { VER=$1 RET="" for p in dpkg -S /usr/lib/python/site-packages | sed 's#,##g; s#:.*$##'; do if `dpkg -s $p | grep "^Depends:.*python$VER" >/dev/null 2>&1`; then RET="$RET $p" fi done } > It may be that as python is simpler, we can simply have a script in a > python-common package which does something like (pardon me if I get [... sample scripts...] It's funny how minds think alike... did you write these before or after python-central, or did you base them on it. There is a lot in common :-) -- ---------------------------------------------------------------------- ABO: finger [EMAIL PROTECTED] for more info, including pgp key ----------------------------------------------------------------------