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

Diff of /src/packages/daily.py

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

Revision 1.6 Revision 1.6.2.2
1#!/usr/bin/python -O 1#!/usr/bin/python -O
2 2
3import sys
4import config 3import config
5import ebuilddb 4import ebuilddb
6import gentoo 5import gentoo
7import os 6import os
8import time 7import time
50 branch = '' 49 branch = ''
51 50
52if branch not in ('','stable','testing'): 51if branch not in ('','stable','testing'):
53 branch = '' 52 branch = ''
54 53
55# see if we're cached, if so write the cache and exit
56if today[:3] == (year,month,day):
57 # today is always cached ;-)
58 archnav = os.path.join(config.LOCALHOME,arch,branch,'archnav.html')
59 filename = os.path.join(config.LOCALHOME,arch,branch,'main.shtml')
60 sys.stdout.write(open(archnav,'r').read())
61 sys.stdout.write('<br>\n')
62 sys.stdout.write(open(filename,'r').read())
63 sys.exit(0)
64else:
65 filename = os.path.join(config.LOCALHOME,'daily','cache',
66 '%d%02d%02d-%s-%s.html' % (year,month,day,arch,branch))
67if os.path.exists(filename):
68 sys.stdout.write(open(filename,'r').read())
69 sys.exit(0)
70
71db = ebuilddb.db_connect() 54db = ebuilddb.db_connect()
72c = db.cursor() 55c = db.cursor()
73 56
74extra = '' 57extra = ''
75if arch: 58if arch:
92 'changelog,' 75 'changelog,'
93 'arch,' 76 'arch,'
94 'homepage,' 77 'homepage,'
95 'license, is_masked ' 78 'license, is_masked '
96 'FROM ebuild,package ' 79 'FROM ebuild,package '
97 'WHERE SUBSTRING(when_found FROM 1 FOR 8) = "%s%02d%02d" ' 80 'WHERE DATE(when_found) = "%s-%02d-%02d" '
98 'AND ebuild.name = package.name ' 81 'AND ebuild.name = package.name '
99 'AND ebuild.category = package.category %s' 82 'AND ebuild.category = package.category %s'
100 'ORDER BY when_found desc' % 83 'ORDER BY when_found desc' %
101 (year, month, day,extra)) 84 (year, month, day,extra))
102 85
106s = genarchbar('%sdaily/%d/%02d/%02d/' % (config.FEHOME,year,month,day),arch,branch) + '<br>\n' 89s = genarchbar('%sdaily/%d/%02d/%02d/' % (config.FEHOME,year,month,day),arch,branch) + '<br>\n'
107for result in results: 90for result in results:
108 ebuild = gentoo.query_to_dict(result) 91 ebuild = gentoo.query_to_dict(result)
109 s = s + gentoo.ebuild_to_html(ebuild) + '<br>\n' 92 s = s + gentoo.ebuild_to_html(ebuild) + '<br>\n'
110print s 93print s
111
112# cache to file, if not todays date
113if today[:3] != (year,month,day):
114 filename = os.path.join(config.LOCALHOME,'daily','cache',
115 '%d%02d%02d-%s-%s.html' % (year,month,day,arch,branch))
116 open(filename,'w').write(s)

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.6.2.2

  ViewVC Help
Powered by ViewVC 1.1.20