| 1 |
#/usr/bin/env python |
#/usr/bin/env python |
| 2 |
# Last-Modified: <Sat Jul 26 12:59:30 2008> |
# Last-Modified: <Fri Aug 8 12:45:43 2008> |
| 3 |
# This file is a part of the Ultimate Debian Database project |
# This file is a part of the Ultimate Debian Database project |
| 4 |
|
|
| 5 |
import debian_bundle.deb822 |
import debian_bundle.deb822 |
| 92 |
raise ConfigException('release not specified for source %s' % |
raise ConfigException('release not specified for source %s' % |
| 93 |
(src_name)) |
(src_name)) |
| 94 |
|
|
| 95 |
|
if not 'sources-table' in src_cfg: |
| 96 |
|
raise ConfigException('sources-table not specifed for source %s' % |
| 97 |
|
(src_name)) |
| 98 |
|
|
| 99 |
|
table = src_cfg['sources-table'] |
| 100 |
|
|
| 101 |
|
|
| 102 |
aux.debug = self.config['general']['debug'] |
aux.debug = self.config['general']['debug'] |
| 103 |
|
|
| 104 |
cur = self.cursor() |
cur = self.cursor() |
| 105 |
|
|
| 106 |
for comp in src_cfg['components']: |
for comp in src_cfg['components']: |
| 107 |
path = os.path.join(src_cfg['directory'], comp, 'source', 'Sources.gz') |
path = os.path.join(src_cfg['directory'], comp, 'source', 'Sources.gz') |
| 108 |
cur.execute("DELETE from sources WHERE Distribution = '%s' AND\ |
cur.execute("DELETE from %s WHERE Distribution = '%s' AND\ |
| 109 |
release = '%s' AND component = '%s'"\ |
release = '%s' AND component = '%s'"\ |
| 110 |
% (src_cfg['distribution'], src_cfg['release'], comp)) |
% (table, src_cfg['distribution'], src_cfg['release'], comp)) |
| 111 |
try: |
try: |
| 112 |
query = """PREPARE source_insert as INSERT INTO sources |
query = """PREPARE source_insert as INSERT INTO %s |
| 113 |
(Package, Version, Maintainer, Format, Files, Uploaders, Bin, |
(Package, Version, Maintainer, Format, Files, Uploaders, Bin, |
| 114 |
Architecture, Standards_Version, Homepage, Build_Depends, |
Architecture, Standards_Version, Homepage, Build_Depends, |
| 115 |
Build_Depends_Indep, Build_Conflicts, Build_Conflicts_Indep, Priority, |
Build_Depends_Indep, Build_Conflicts, Build_Conflicts_Indep, Priority, |
| 120 |
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, |
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, |
| 121 |
$17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, '%s', '%s', |
$17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, '%s', '%s', |
| 122 |
'%s')"""\ |
'%s')"""\ |
| 123 |
% (src_cfg['distribution'], src_cfg['release'], comp) |
% (table, src_cfg['distribution'], src_cfg['release'], comp) |
| 124 |
cur.execute(query) |
cur.execute(query) |
| 125 |
|
|
| 126 |
aux.print_debug("Reading file " + path) |
aux.print_debug("Reading file " + path) |