Hi folks,

While I know DJ is hard at work doing the Xorg 7.1 update I thought I'd share a script that I just wrote to automatically generate the wget files for downloading all those packages. It's written in Python (the only scripting language I know, other than shell scripting which would have been painful to write this in, IMO).

Also note that http://www.linuxfromscratch.org/blfs/view/svn/x/xorg7.html says you may need to download up to 280 files. There are indeed 280 files in the distribution but there are .tar.gz and .tar.bz2 versions of each package. Oh, and there's a separate copy of all modules in the 'everything/' folder on the FTP site too, just for good measure!. So, I'd suggest that the figure be changed to 140.

Regards,

Matt.
#!/usr/bin/env python
#
# File: xorg-wget.py
#
# Author: Matthew Burgess <[EMAIL PROTECTED]>
#
# Description: Produces wget files for the various modules in the Xorg
#              distribution.  The wget files are in a format suitable for use
#              alongside the instructions in the BLFS book.
#

import formatter
import htmllib
import urllib2

xorg_version = '7.1'
base_url = 'http://xorg.freedesktop.org/releases/X11R' + xorg_version + '/src/'

parser = htmllib.HTMLParser(formatter.NullFormatter())
html = urllib2.urlopen(base_url).read()
parser.feed(html)
parser.close()

modules = []
for a in parser.anchorlist:
    if a.count('/') == 1 and a.count('everything') == 0:
        modules.append(a)

for module in modules:
    wget_file = file(module[0:len(module) - 1] + '.wget', 'w')
    html = urllib2.urlopen(base_url + module).read()
    parser.reset()
    parser.feed(html)
    parser.close()
    for a in parser.anchorlist:
      if a.count('.tar.bz2') == 1:
         wget_file.write(a + '\n')
    wget_file.close()
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to