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

Diff of /udd/udd/packages_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:58:43 2008>  # Last-Modified: <Fri Aug  8 12:42:28 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 144  class packages_gatherer(gatherer): Line 144  class packages_gatherer(gatherer):
144        raise ConfigException('distribution not specified for source %s' %        raise ConfigException('distribution not specified for source %s' %
145            (source))            (source))
146    
147        if not 'packages-table' in src_cfg:
148          raise ConfigException('packages-table not specified for source %s' % (source))
149    
150      aux.debug = self.config['general']['debug']      aux.debug = self.config['general']['debug']
151        table = src_cfg['packages-table']
152    
153      # Get distribution ID      # Get distribution ID
154      self._distr = src_cfg['distribution']      self._distr = src_cfg['distribution']
# Line 153  class packages_gatherer(gatherer): Line 157  class packages_gatherer(gatherer):
157    
158      # For every part and every architecture, import the packages into the DB      # For every part and every architecture, import the packages into the DB
159      for comp in src_cfg['components']:      for comp in src_cfg['components']:
160        cur.execute("DELETE FROM packages WHERE distribution = '%s' AND release = '%s' AND component = '%s'" %\        cur.execute("DELETE FROM %s WHERE distribution = '%s' AND release = '%s' AND component = '%s'" %\
161          (self._distr, src_cfg['release'], comp))          (table, self._distr, src_cfg['release'], comp))
162        for arch in src_cfg['archs']:        for arch in src_cfg['archs']:
163          path = os.path.join(src_cfg['directory'], comp, 'binary-' + arch, 'Packages.gz')          path = os.path.join(src_cfg['directory'], comp, 'binary-' + arch, 'Packages.gz')
164          try:          try:
165            cur.execute("""PREPARE package_insert AS INSERT INTO Packages            cur.execute("""PREPARE package_insert AS INSERT INTO %s
166              (Package, Version, Architecture, Maintainer, Description, Source,              (Package, Version, Architecture, Maintainer, Description, Source,
167              Source_Version, Essential, Depends, Recommends, Suggests, Enhances,              Source_Version, Essential, Depends, Recommends, Suggests, Enhances,
168              Pre_Depends, Installed_Size, Homepage, Size, MD5Sum, Distribution,              Pre_Depends, Installed_Size, Homepage, Size, MD5Sum, Distribution,
# Line 166  class packages_gatherer(gatherer): Line 170  class packages_gatherer(gatherer):
170            VALUES            VALUES
171              ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15,              ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15,
172                $16, $17, '%s', '%s', '%s')                $16, $17, '%s', '%s', '%s')
173              """ %  (self._distr, src_cfg['release'], comp))              """ %  (table, self._distr, src_cfg['release'], comp))
174            aux.print_debug("Reading file " + path)            aux.print_debug("Reading file " + path)
175            # Copy content from gzipped file to temporary file, so that apt_pkg is            # Copy content from gzipped file to temporary file, so that apt_pkg is
176            # used by debian_bundle            # used by debian_bundle

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

  ViewVC Help
Powered by ViewVC 1.1.5