[Mageia-dev] Automatically determining all "GNOME" packages

Olav Vitters olav at vitters.nl
Thu Feb 9 15:30:01 CET 2012


On Thu, Feb 09, 2012 at 11:19:00AM +0000, Pascal Terjan wrote:
> It is in files.xml.lzma, you can extract it from there or request it from urpmf

Cool!

Wrote an initial script for matching GNOME with the packages.

In case interested, see attached for the script. This is just to match
the things together. The matching is the basic requirement. I now want
to make it actually do something useful ;)

You get output like:
libgee libgee0.6        libgee  libgee0.8

meaning: libgree is upstream, downstream as:
  libgee0.6
  libgee
  libgee0.8

This so I can integrate things like "mgarepo co $DOWNSTREAM", etc.


-- 
Regards,
Olav
-------------- next part --------------
#!/usr/bin/python

import os
import os.path
import sys
import re
import subprocess
import urllib2
import urlparse
from sgmllib import SGMLParser

MEDIA="Core Release Source"
URL="http://download.gnome.org/sources/"

class urllister(SGMLParser):
    def reset(self):
        SGMLParser.reset(self)
        self.urls = []

    def start_a(self, attrs):
        href = [v for k, v in attrs if k=='href']
        if href:
            self.urls.extend(href)

def get_upstream_names():
    urlopen = urllib2.build_opener()

    good_dir = re.compile('^[-A-Za-z0-9_]+/$')

    # Get the files
    usock = urlopen.open(URL)
    parser = urllister()
    parser.feed(usock.read())
    usock.close()
    parser.close()
    files = parser.urls

    tarballs = set([filename.replace('/', '') for filename in files if good_dir.search(filename)])

    return tarballs

def get_downstream_names():
    re_file = re.compile(r'^(?P<module>.*?)[_-](?:(?P<oldversion>([0-9]+[\.])*[0-9]+)-)?(?P<version>([0-9]+[\.\-])*[0-9]+)\.(?P<format>(?:tar\.|diff\.)?[a-z][a-z0-9]*)$')

    p = subprocess.Popen(['urpmf', '--files', '.', "--media", MEDIA], stdout=subprocess.PIPE, close_fds=True)
    contents = p.stdout.read().strip("\n").splitlines()
    ecode = p.wait()
    if ecode != 0:
        sys.exit(1)

    FILES = {}
    TARBALLS = {}

    for line in  contents:
        try:
            srpm, filename = line.split(":")
        except ValueError:
            print line
            continue

        if '.tar' in filename:
            r = re_file.match(filename)
            if r:
                fileinfo = r.groupdict()
                module = fileinfo['module']

                if module not in TARBALLS:
                    TARBALLS[module] = set()
                TARBALLS[module].add(srpm)

        if srpm not in FILES:
            FILES[srpm] = set()
        FILES[srpm].add(filename)

    return TARBALLS, FILES

if __name__ == "__main__":
    upstream = get_upstream_names()
    downstream, downstream_files = get_downstream_names()

    matches = upstream & set(downstream.keys())

    for module in matches:
        print module, "\t".join(downstream[module])

-------------- next part --------------
sun-htmlmacro:sun-htmlmacro-1.0-r27-javadoc-build:xml.patch
latexila latexila
tomboy tomboy
gnome-doc-utils gnome-doc-utils
seahorse-sharing seahorse-sharing
murrine murrine
ocrfeeder ocrfeeder
devhelp devhelp
goocanvas goocanvas	goocanvas2
grilo-plugins grilo-plugins
totem totem
GConf GConf2
evince evince
gnome-system-monitor gnome-system-monitor
librsvg librsvg
medusa medusa
regexxer regexxer
gdl gnudl	gdl
libgnomeprintui libgnomeprintui
gssdp gssdp
anjuta anjuta
gnome-bluetooth gnome-bluetooth
vte vte3	vte
gupnp-ui gupnp-ui
libIDL libIDL
ghex ghex
libgnomedb libgnomedb4.0
gdk-pixbuf gdk-pixbuf2.0	gdk-pixbuf2.0-lsb
libgnome libgnome2
metacity metacity
folks folks
evolution-exchange evolution-exchange
gnome-font-viewer gnome-font-viewer
gedit-cossa gedit-cossa
epiphany-extensions epiphany-extensions
rarian rarian
glibmm glibmm2.4
hamster-applet hamster-applet
gnote gnote
goffice goffice	goffice0.8
gnome-media gnome-media
gtk-sharp gtk-sharp2
libwacom libwacom
pygtkglext python-gtkglext
gnome-shell-extensions gnome-shell-extensions
libgnomecups libgnomecups
gnome-mime-data gnome-mime-data
nautilus-actions nautilus-actions
libnotify libnotify
pessulus pessulus
pango pango
atkmm atkmm
gst-python gstreamer0.10-python
evolution evolution
gnome-speech gnome-speech
gnome-icon-theme gnome-icon-theme
gnucash gnucash
dia dia
gtkglextmm gtkglextmm
banshee banshee
gtkmm gtkmm2.4	gtkmm3.0
gst-plugins-good gstreamer0.10-plugins-good
gnome-control-center gnome-control-center
gtetrinet gtetrinet
gnome-online-accounts gnome-online-accounts
gnome-js-common gnome-js-common
rygel rygel
libgnomesu libgnomesu
pangomm pangomm
gtksourceview gtksourceview2	gtksourceview	gtksourceview1
orca orca
gnome-disk-utility gnome-disk-utility
gnome-user-docs gnome-user-docs
gupnp-av gupnp-av
vino vino
glade3 glade3
xdg-user-dirs-gtk xdg-user-dirs-gtk
nautilus-python nautilus-python
gjs gjs
gnome-backgrounds gnome-backgrounds
gnome-power-manager gnome-power-manager
libart_lgpl libart_lgpl
gtksourceviewmm gtksourceviewmm2	gtksourceviewmm
json-glib json-glib
gossip gossip
libxslt libxslt
gnome-desktop-sharp gnome-desktop-sharp
libchamplain libchamplain
gnome-tweak-tool gnome-tweak-tool
evolution-sharp evolution-sharp
glib-networking glib-networking
libgsf libgsf
gnome-desktop gnome-desktop3	gnome-desktop
intltool intltool
pinpoint pinpoint
gok gok
f-spot f-spot
libgtop libgtop2
ptlib ptlib
gnome-terminal gnome-terminal
ORBit2 ORBit2
gnome-settings-daemon gnome-settings-daemon
gnome-documents gnome-documents
gdm gdm
genius genius
tracker tracker
libgnome-media-profiles libgnome-media-profiles
gnome-screenshot gnome-screenshot
pygtksourceview python-gtksourceview
gnome-search-tool gnome-search-tool
evolution-webcal evolution-webcal
gnome-web-photo gnome-web-photo
meld meld
gnome-icon-theme-symbolic gnome-icon-theme-symbolic
labyrinth labyrinth
gnome-python-extras gnome-python-extras
gupnp-tools gupnp-tools
libgxps libgxps
gnome-dictionary gnome-dictionary
ModemManager modemmanager
libgdata libgdata
glabels glabels
vala vala
cogl cogl
at-spi2-core at-spi2-core
pygtk pygtk2.0
gnumeric gnumeric
gnome-panel gnome-panel
libgda gda2.0	libgda5.0	libgda4.0
pygobject python-gobject3	python-gobject
libgnomeprint libgnomeprint
libbonoboui libbonoboui
gtk-doc gtk-doc
xchat xchat
giggle giggle
xchat-gnome xchat-gnome
empathy empathy
evolution-data-server evolution-data-server
seahorse seahorse
gedit-plugins gedit-plugins
opal opal3
baobab baobab
atk atk1.0
glade glade
libgnomeui libgnomeui2
anjuta-extras anjuta-extras
libPropList libPropList
epiphany epiphany
libgweather libgweather
gnome-pilot gnome-pilot
pkg-config pkgconfig
ekiga ekiga
NetworkManager-pptp networkmanager-pptp
at-spi2-atk at-spi2-atk
gnome-games gnome-games
loudmouth loudmouth
cheese cheese
gitg gitg
geocode-glib geocode-glib
gnome-themes-standard gnome-themes-standard
gupnp-igd gupnp-igd
gnet gnet2
yelp-xsl yelp-xsl
libgnomecanvasmm libgnomecanvasmm2.6
gucharmap gucharmap
pitivi pitivi
gnome-shell gnome-shell
gcalctool gcalctool
libgee libgee0.6	libgee	libgee0.8
gnome-applets gnome-applets
gupnp-dlna gupnp-dlna
alacarte alacarte
gnome-python-desktop gnome-python-desktop
at-spi at-spi
gst-plugins-base gstreamer0.10-plugins-base
gtranslator gtranslator
eog-plugins eog-plugins
planner planner
gnome-python gnome-python
gupnp-vala gupnp-vala
abiword abiword
gnome-contacts gnome-contacts
startup-notification startup-notification
gob2 gob2
gtkglarea gtkglarea2
notification-daemon notification-daemon
libxml2 libxml2
gdlmm gdlmm
NetworkManager networkmanager
goobox goobox
gnome-devel-docs gnome-devel-docs
gmime gmime
firestarter firestarter
gnome-boxes gnome-boxes
kiwi python-kiwi
pygoocanvas python-pygoocanvas
libxklavier libxklavier
libcroco libcroco0.6
polkit-gnome polkit-gnome
gnome-packagekit gnome-packagekit
rest rest
bug-buddy bug-buddy
hippo-canvas hippo-canvas
emerillon emerillon
nautilus-open-terminal nautilus-open-terminal
file-roller file-roller
mutter mutter
gupnp gupnp
gnome-mag gnome-mag
clutter-gst clutter-gst
gobject-introspection gobject-introspection
clutter-gtk clutter-gtk010	clutter-gtk
accerciser accerciser
gnome-screensaver gnome-screensaver
gnome-keyring gnome-keyring
grilo grilo
mc mc
libgnomeuimm libgnomeuimm2.6
java-gnome java-gnome
gstreamer gstreamer0.10
libgnomecanvas libgnomecanvas
gnome-commander gnome-commander
network-manager-applet networkmanager-applet
NetworkManager-vpnc networkmanager-vpnc
gnome-nettool gnome-nettool
seed seed
libepc libepc
gthumb gthumb
sound-juicer sound-juicer
gnome-sharp gnome-sharp2
brasero brasero
goocanvasmm goocanvasmm
glib glib2.0
nautilus nautilus
libgtkhtml libgtkhtml2
gnome-vfs gnome-vfs2
gconf-editor gconf-editor
frogr frogr
libbtctl libbtctl
sushi sushi
gedit gedit
gnome-system-log gnome-system-log
gir-repository gir-repository
libxml libxml
nemiver nemiver
clutter clutter
vinagre vinagre
zenity zenity
gsettings-desktop-schemas gsettings-desktop-schemas
rhythmbox rhythmbox
dconf dconf
cantarell-fonts cantarell-fonts	abattis-cantarell-fonts
gimp gimp
pyorbit pyorbit
gnome-themes-extras gnome-themes-extras
pyatspi pyatspi
gnome-video-effects gnome-video-effects
gnome-common gnome-common
libgnome-keyring libgnome-keyring
mousetweaks mousetweaks
yelp-tools yelp-tools
gnome-phone-manager gnome-phone-manager
libgdamm libgdamm5.0
gtkhtml gtkhtml4	gtkhtml-3.14
gtkglext gtkglext
gcr gcr
ttf-bitstream-vera fonts-ttf-bitstream-vera
drwright drwright
gtk-engines gtk-engines2
gvfs gvfs
libsoup libsoup
pan pan
dasher dasher
sabayon sabayon
gconfmm gconfmm2.6
glom glom
mm-common mm-common
libglademm libglademm2.4
libunique libunique	libunique3
evolution-groupwise evolution-groupwise
atomix atomix
aisleriot aisleriot
gnome-games-extra-data gnome-games-extra-data
gnome-utils gnome-utils
libwnck libwnck3	libwnck
mobile-broadband-provider-info mobile-broadband-provider-info
gnome-color-manager gnome-color-manager
eog eog
gamin gamin
yelp yelp
libpeas libpeas
libbonobo libbonobo
simple-scan simple-scan
libgnomekbd libgnomekbd
moserial moserial
java-access-bridge java-1.7.0-openjdk	java-access-bridge
NetworkManager-openvpn networkmanager-openvpn
audiofile audiofile
NetworkManager-openconnect networkmanager-openconnect
gnome-menus gnome-menus
libcryptui libcryptui
libgnomemm libgnomemm2.6
gnome-session gnome-session
totem-pl-parser totem-pl-parser
libglade libglade2.0
nautilus-sendto nautilus-sendto
gtk-vnc gtk-vnc
caribou caribou
gnome-vfsmm gnome-vfsmm2.6


More information about the Mageia-dev mailing list