/[gentoo]/src/packages/gentoo.py
Gentoo

Diff of /src/packages/gentoo.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.15 Revision 1.16
1#!/usr/bin/python -O 1#!/usr/bin/python -O
2"""These functions mainly take ebuild info (grabbed from the database and 2"""These functions mainly take ebuild info (grabbed from the database and
3 convert it to HTML. See the "main" function at the bottom.""" 3 convert it to HTML. See the "main" function at the bottom."""
4 4
5__revision__ = "$Revision: 1.15 $" 5__revision__ = "$Revision: 1.16 $"
6# $Source: /var/cvsroot/gentoo/src/packages/gentoo.py,v $ 6# $Source: /var/cvsroot/gentoo/src/packages/gentoo.py,v $
7 7
8import config 8import config
9import os 9import os
10import time 10import time
100 ) 100 )
101 rows = [] 101 rows = []
102 ebuilds.sort(cmp_ebuilds) 102 ebuilds.sort(cmp_ebuilds)
103 ebuilds.reverse() 103 ebuilds.reverse()
104 for ebuild in ebuilds: 104 for ebuild in ebuilds:
105 archs = ebuild['arch'].split() 105 archs = ebuild['arch'].split(',')
106 row_start = ('<tr>\n\t<th class="releases"><a href="%sebuilds/?%s-%s"' 106 row_start = ('<tr>\n\t<th class="releases"><a href="%sebuilds/?%s-%s"'
107 ' title="%s">%s</a></th>\n' % (config.FEHOME, 107 ' title="%s">%s</a></th>\n' % (config.FEHOME,
108 ebuild['name'], ebuild['version'], ebuild['time'], 108 ebuild['name'], ebuild['version'], ebuild['time'],
109 ebuild['version'])) 109 ebuild['version']))
110 row_data = [] 110 row_data = []
283 283
284def get_most_recent(db, max=config.MAXPERPAGE, arch="", branch="", new = False): 284def get_most_recent(db, max=config.MAXPERPAGE, arch="", branch="", new = False):
285 c = db.cursor() 285 c = db.cursor()
286 extra = '' 286 extra = ''
287 if arch: 287 if arch:
288 stable_extra = ('ebuild.arch REGEXP "^%s[[:>:]]|[[:blank:]]%s[[:>:]]" ' 288 stable_extra = ('FIND_IN_SET("%s", ebuild.arch) > 0 AND '
289 % (arch,arch)) 289 'FIND_IN_SET("%s", ebuild.prevarch) = 0 ' % (arch, arch))
290 testing_extra = ('ebuild.arch REGEXP "[~]%s[[:>:]]" ' % arch) 290 testing_extra = ('FIND_IN_SET("~%s", ebuild.arch) > 0 AND '
291 'FIND_IN_SET("~%s", ebuild.prevarch) = 0 ' % (arch, arch))
291 if branch == 'stable': 292 if branch == 'stable':
292 extra = ' AND (%s) ' % stable_extra 293 extra = ' AND (%s) ' % stable_extra
293 elif branch == 'testing': 294 elif branch == 'testing':
294 extra = ' AND (%s) ' % testing_extra 295 extra = ' AND (%s) ' % testing_extra
295 else: 296 else:

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.20