Source
xxxxxxxxxx
print FORMAT_STRING % (pkgname, br_version.center(15), xorg_version.center(15), action)
#!/usr/bin/python
# This script generates a report on the packaging status of X.org
# releases in Buildroot. It does so by downloading the list of
# tarballs that are part of a given X.org release, and compare that
# with the packages that are available in Buildroot.
import BeautifulSoup
import re
import os
import urllib
from distutils.version import LooseVersion
# This can be customized
XORG_VERSION = "X11R7.7"
# Key names in dictionaries
XORG_VERSION_KEY = "xorg-version"
BR_VERSION_KEY = "br-version"
BR_NAME_KEY = "br-name"
# Packages part of X.org releases that we do not want to package in
# Buildroot (old drivers for hardware unlikely to be used in embedded
# contexts).
XORG_EXCEPTIONS = [
'xf86-video-suncg6',
'xf86-video-sunffb',
]
# Get the list of tarballs of a X.org release, parse it, and return a
# dictionary of dictionaries, of the form:
#
# { <name_of_package> : { XORG_VERSION_KEY: <version_of_package> },
# <name_of_package2> : { XORG_VERSION_KEY: <version_of_package2> }}
#
def get_xorg_release_pkgs():
u = urllib.URLopener().open("http://www.x.org/releases/%s/src/everything/" % XORG_VERSION)
b = BeautifulSoup.BeautifulSoup()
b.feed(u.read())
links = b.findAll("a")
packages = {}
r = re.compile("(.*)-([0-9\.]*).tar.bz2")
# We now have a list of all links.
for link in links:
href = link.get("href")
# Skip everything but tarballs
if not href.endswith(".tar.bz2"):
continue
# Separate the name and the version
groups = r.match(href)
if not groups:
continue
name = groups.group(1)
version = groups.group(2)
# Skip packages we don't want to hear about
if name in XORG_EXCEPTIONS:
continue
packages[name] = { XORG_VERSION_KEY : version }
return packages
# Files and directories in package/x11r7/ that should be ignored in
# our processing.
BUILDROOT_EXCEPTIONS = [