After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 488111 - Add support for checking for distro packages
Add support for checking for distro packages
Status: RESOLVED WONTFIX
Product: jhbuild
Classification: Infrastructure
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on:
Blocks:
 
 
Reported: 2007-10-19 01:36 UTC by Diego Escalante Urrelo (not reading bugmail)
Modified: 2007-12-15 21:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Draft of a check for already installed .deb packages (7.60 KB, patch)
2007-10-19 01:37 UTC, Diego Escalante Urrelo (not reading bugmail)
none Details | Review

Description Diego Escalante Urrelo (not reading bugmail) 2007-10-19 01:36:42 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.
Comment 1 Diego Escalante Urrelo (not reading bugmail) 2007-10-19 01:37:58 UTC
Created attachment 97456 [details] [review]
Draft of a check for already installed .deb packages

Abracadabra!
Comment 2 John Stowers 2007-12-15 00:30:20 UTC
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
Comment 3 Frederic Peters 2007-12-15 21:08:29 UTC
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.