GNOME Bugzilla – Bug 488111
Add support for checking for distro packages
Last modified: 2007-12-15 21:13:46 UTC
Well, it happens sometimes that you have $package-x in your distro, and it's up to date, however jhbuild still needs to install it because it has no way of knowing this. Of course you can skip it in jhbuildrc, but that's unfriendly for new users. Some days ago it was suggested that we should make jhbuild more friendly to new users or contributors. From my PVO, we should make jhbuild more disk space friendly :). If distros already pack some stuff, why bother building it too? Of course this doesn't apply to ALL use cases. I'm attaching a draft of what I so far think is the simplest way of doing it: - Add a "dpkg/debian" and/or "$pkg-system" attribute to the <module id="blah bleh">: <autotools id="libtelepathy" debian="libtelepathy2"> ... </autotools> - Check if it's installed (in this case via python-apt), if it is then pass the "skip_installed" boolean so force_$step methods can skip or not. - If the package was already installed, the steps will skip happily and you'll save some time and space :) This is just a draft patch, it's really simple so I suspect it's not the correct way to do it (however looks like it would just work). It could also check for the package version too, and it comes to my mind that this would need an option to always ignore system packages. Oh, and rpm support is of course missing :), this just does the debian magic. Let me know what do you think.
Created attachment 97456 [details] [review] Draft of a check for already installed .deb packages Abracadabra!
See http://bugzilla.gnome.org/show_bug.cgi?id=503679 for another possible way to solve this - by running arbitary scripts in the execution chain. Then deps for all distros could be maintained in one place like the following In .jhbuildrc moduleset = ['gnome.modules'] if distro == Ubuntu moduleset += ['ubuntu.modules'] elif Suse moduleset += ['suse.modules'] elif Fedora moduleset += ['fedora.modules'] modules = ['gnome-meta-desktop', 'platform-deps'] In ubuntu.modules <metamodule id="platform-deps"> <dependencies> <dep package="gnome-dev-deps"/> </dependencies> </metamodule> <binary id="gnome-dev-deps" version="7.10"> <install> <cmd execute="['sudo', 'apt-get', 'install', 'gnome-dev']"/> </install> </binary> You could put in various metamodules etc depending on what you feel like
As I wrote in bug 503679, I am sorry but I don't like this, JHBuild purpose is building sources, not installing binary packages. Also note it is not as easy as skipping a module if there is some package installed, I could have libglib2.0-dev installed on a computer running Etch and it would not help much, as way too old for most modules. And I don't believe there is manpower to track all modules and required version for their dependencies. If you really want to do this, you could provide modulesets for different versions (say debian-etch.modules, ubuntu-gutsy.modules) that would override modules for known good versions. <autotools id="ubuntu-gusty-packages"> <branch repo="whatever"/> </autotools> <metamodule id="glib"> <dependencies><dep>ubuntu-gutsy-packages</dep></dependencies> </metamodule> and have that ubuntu-gutsy-packages have a make install calling all the apt-get you want.