/[collab-qa]/udd/udd/sources_gatherer.py
ViewVC logotype

Diff of /udd/udd/sources_gatherer.py

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

revision 936 by neronus-guest, Sat Jul 26 13:06:58 2008 UTC revision 998 by neronus-guest, Fri Aug 8 13:51:14 2008 UTC
# Line 1  Line 1 
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
# Line 92  class sources_gatherer(gatherer): Line 92  class sources_gatherer(gatherer):
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,
# Line 113  class sources_gatherer(gatherer): Line 120  class sources_gatherer(gatherer):
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)

Legend:
Removed from v.936  
changed lines
  Added in v.998

  ViewVC Help
Powered by ViewVC 1.1.5