From: Zooko O'Whielacronx Date: Sun, 14 Nov 2010 07:35:32 +0000 (-0800) Subject: setup: David-Sarah's new gen-package-table.py plus my patch to put the newer versions... X-Git-Url: https://git.rkrishnan.org/(%5B%5E?a=commitdiff_plain;h=c14e20c2f828eb8b562a2c6696531c875c88b895;p=tahoe-lafs%2Ftahoe-lafs.git setup: David-Sarah's new gen-package-table.py plus my patch to put the newer versions of Python first fixes #1247 --- diff --git a/misc/build_helpers/gen-package-table.py b/misc/build_helpers/gen-package-table.py index 19f9d071..461696ef 100644 --- a/misc/build_helpers/gen-package-table.py +++ b/misc/build_helpers/gen-package-table.py @@ -7,14 +7,17 @@ import re, os, sys extensions = ('.egg', '.tar.bz2', '.tar.gz', '.exe') platform_aliases = [('i686','x86'), ('i386','x86'), ('i86pc','x86'), ('win32','windows-x86'), ('win-amd64','windows-x86_64'), ('amd64','x86_64')] -python_versions = ((2,4), (2,5), (2,6), (2,7)) FILENAME_RE = re.compile(r'([a-zA-Z_0-9]*)-([0-9\.a-vx-z_]*)(-py[0-9\.]*)?(-.*)?') FILENAME_RE2 = re.compile(r'([a-zA-Z_0-9]*)-([0-9\.a-vx-z_]*)(win32|win-amd64)?(-py[0-9\.]*)?') matrix = {} +platforms = set() +pkgs = set() +platform_dependent_pkgs = set() +python_versions = set() depdir = '.' -if len(sys.argv) >= 1: +if len(sys.argv) > 1: depdir = sys.argv[1] filenames = os.listdir(depdir) @@ -50,9 +53,20 @@ for fname in filenames: platform = platform[:-len(alias)] + replacement break - add(matrix, (pkg, platform), (pythonver, fname)) + platforms.add(platform) + pkgs.add(pkg) + if platform: + platform_dependent_pkgs.add(pkg) + if pythonver not in matrix: + python_versions.add(pythonver) + matrix[pythonver] = {} + add(matrix[pythonver], platform, (pkg, fname)) break +platform_independent_pkgs = pkgs - platform_dependent_pkgs + +width = 100 / (len(platform_independent_pkgs) + 1) + print '' print '' print '' @@ -62,36 +76,33 @@ print '' print '' print '

Software packages that Tahoe-LAFS depends on

' print -print '

Packages that have compiled C/C++ code:

' -print '' -print ' ' -print ' ' -for pyver in python_versions: - print ' ' % pyver -print ' ' - -platform_dependent_pkgs = set() - -last_pkg = None -for (pkg, platform) in sorted(matrix): - if platform: - platform_dependent_pkgs.add(pkg) - row_files = sorted(matrix[(pkg, platform)]) - style1 = pkg != last_pkg and 'border-top: 2px solid #000000; background-color: #FFFFF0' or 'border: 0;' - style2 = pkg != last_pkg and 'border-top: 2px solid #000000; background-color: #FFFFF0' or 'background-color: #FFFFF0;' - style3 = pkg != last_pkg and 'border-top: 2px solid #000000;' or '' +for pyver in reversed(sorted(python_versions)): + if pyver: + print '

Packages for Python %s that have compiled C/C++ code:

' % (pyver,) + print '
 Package  Python %d.%d 
' print ' ' - print ' ' % (style1, pkg != last_pkg and pkg or '',) - print ' ' % (style2, platform,) - for pyver in python_versions: - files = [n for (v, n) in row_files if v == '%d.%d' % pyver] - print ' ' % (style3, - '
 '.join(['%s' % (f, f) for f in files])) + print ' ' % (width,) + for pkg in sorted(platform_dependent_pkgs): + print ' ' % (width, pkg) print ' ' - last_pkg = pkg -print '
 %s  %s  %s Platform  %s 
' -print + first = True + for platform in sorted(matrix[pyver]): + row_files = sorted(matrix[pyver][platform]) + style1 = first and 'border-top: 2px solid #000000; background-color: #FFFFF0' or 'background-color: #FFFFF0' + style2 = first and 'border-top: 2px solid #000000' or '' + print ' ' + print '  %s ' % (style1, platform,) + for pkg in sorted(platform_dependent_pkgs): + files = [n for (p, n) in row_files if pkg == p] + print '  %s' % (style2, + '
 '.join(['%s' % (f, f) for f in files])) + print ' ' + first = False + + print '' + print + print '

Packages that are platform-independent or source-only:

' print '' print ' ' @@ -101,13 +112,13 @@ print ' ' style1 = 'border-top: 2px solid #000000; background-color:#FFFFF0;' style2 = 'border-top: 2px solid #000000;' -for (pkg, platform) in sorted(matrix): - if pkg not in platform_dependent_pkgs: - print ' ' - print ' ' % (style1, pkg) - files = [n for (v, n) in sorted(matrix[(pkg, platform)]) if not v] - print ' ' % (style2, '
 '.join(['%s' % (f, f) for f in files])) - print ' ' +m = matrix[''][''] +for pkg in sorted(platform_independent_pkgs): + print ' ' + print ' ' % (style1, pkg) + files = [n for (p, n) in m if pkg == p] + print ' ' % (style2, '
 '.join(['%s' % (f, f) for f in files])) + print ' ' print '
 %s  %s
 %s  %s
'