]> git.donarmstrong.com Git - dak.git/commitdiff
Merge branch 'master' into dbtests
authorTorsten Werner <twerner@debian.org>
Mon, 21 Mar 2011 17:21:16 +0000 (18:21 +0100)
committerTorsten Werner <twerner@debian.org>
Mon, 21 Mar 2011 17:22:18 +0000 (18:22 +0100)
Conflicts:
dak/update_db.py

Signed-off-by: Torsten Werner <twerner@debian.org>
1  2 
daklib/dbconn.py
daklib/queue.py

diff --combined daklib/dbconn.py
index 4f6b02d8fdfec3fd640551e63070fc893c3e8436,fb2cc3b0d6a91808df8d393fd41edf884dc922dc..1bf5a0f997c7bb84aa5821aa4f9ab3c074ec3422
@@@ -77,6 -77,9 +77,6 @@@ import warning
  warnings.filterwarnings('ignore', \
      "The SQLAlchemy PostgreSQL dialect has been renamed from 'postgres' to 'postgresql'.*", \
      SADeprecationWarning)
 -# TODO: sqlalchemy needs some extra configuration to correctly reflect
 -# the ind_deb_contents_* indexes - we ignore the warnings at the moment
 -warnings.filterwarnings("ignore", 'Predicate of partial index', SAWarning)
  
  
  ################################################################################
@@@ -1945,6 -1948,111 +1945,6 @@@ __all__.append('get_override_type'
  
  ################################################################################
  
 -class DebContents(object):
 -    def __init__(self, *args, **kwargs):
 -        pass
 -
 -    def __repr__(self):
 -        return '<DebConetnts %s: %s>' % (self.package.package,self.file)
 -
 -__all__.append('DebContents')
 -
 -
 -class UdebContents(object):
 -    def __init__(self, *args, **kwargs):
 -        pass
 -
 -    def __repr__(self):
 -        return '<UdebConetnts %s: %s>' % (self.package.package,self.file)
 -
 -__all__.append('UdebContents')
 -
 -class PendingBinContents(object):
 -    def __init__(self, *args, **kwargs):
 -        pass
 -
 -    def __repr__(self):
 -        return '<PendingBinContents %s>' % self.contents_id
 -
 -__all__.append('PendingBinContents')
 -
 -def insert_pending_content_paths(package,
 -                                 is_udeb,
 -                                 fullpaths,
 -                                 session=None):
 -    """
 -    Make sure given paths are temporarily associated with given
 -    package
 -
 -    @type package: dict
 -    @param package: the package to associate with should have been read in from the binary control file
 -    @type fullpaths: list
 -    @param fullpaths: the list of paths of the file being associated with the binary
 -    @type session: SQLAlchemy session
 -    @param session: Optional SQLAlchemy session.  If this is passed, the caller
 -    is responsible for ensuring a transaction has begun and committing the
 -    results or rolling back based on the result code.  If not passed, a commit
 -    will be performed at the end of the function
 -
 -    @return: True upon success, False if there is a problem
 -    """
 -
 -    privatetrans = False
 -
 -    if session is None:
 -        session = DBConn().session()
 -        privatetrans = True
 -
 -    try:
 -        arch = get_architecture(package['Architecture'], session)
 -        arch_id = arch.arch_id
 -
 -        # Remove any already existing recorded files for this package
 -        q = session.query(PendingBinContents)
 -        q = q.filter_by(package=package['Package'])
 -        q = q.filter_by(version=package['Version'])
 -        q = q.filter_by(architecture=arch_id)
 -        q.delete()
 -
 -        for fullpath in fullpaths:
 -
 -            if fullpath.startswith( "./" ):
 -                fullpath = fullpath[2:]
 -
 -            pca = PendingBinContents()
 -            pca.package = package['Package']
 -            pca.version = package['Version']
 -            pca.file = fullpath
 -            pca.architecture = arch_id
 -
 -            if isudeb:
 -                pca.type = 8 # gross
 -            else:
 -                pca.type = 7 # also gross
 -            session.add(pca)
 -
 -        # Only commit if we set up the session ourself
 -        if privatetrans:
 -            session.commit()
 -            session.close()
 -        else:
 -            session.flush()
 -
 -        return True
 -    except Exception, e:
 -        traceback.print_exc()
 -
 -        # Only rollback if we set up the session ourself
 -        if privatetrans:
 -            session.rollback()
 -            session.close()
 -
 -        return False
 -
 -__all__.append('insert_pending_content_paths')
 -
 -################################################################################
 -
  class PolicyQueue(object):
      def __init__(self, *args, **kwargs):
          pass
@@@ -2832,6 -2940,7 +2832,6 @@@ class DBConn(object)
              'maintainer',
              'new_comments',
              'override_type',
 -            'pending_bin_contents',
              'policy_queue',
              'priority',
              'section',
              'changes_pending_files_map',
              'changes_pending_source_files',
              'changes_pool_files',
 -            'deb_contents',
              # TODO: the maintainer column in table override should be removed.
              'override',
              'suite_architectures',
              'suite_src_formats',
              'suite_build_queue_copy',
 -            'udeb_contents',
          )
  
          views = (
              table = Table(table_name, self.db_meta, autoload=True)
              setattr(self, 'tbl_%s' % table_name, table)
  
-         # bin_contents needs special attention until update #41 has been
-         # applied
+         # bin_contents needs special attention until the SERIAL type is
+         # correctly detected and the workaround has been removed; see comment
+         # above
          self.tbl_bin_contents = Table('bin_contents', self.db_meta, \
              Column('file', Text, primary_key = True),
              Column('binary_id', Integer, ForeignKey('binaries.id'), \
          mapper(Archive, self.tbl_archive,
                 properties = dict(archive_id = self.tbl_archive.c.id,
                                   archive_name = self.tbl_archive.c.name))
 -
 -        mapper(PendingBinContents, self.tbl_pending_bin_contents,
 -               properties = dict(contents_id =self.tbl_pending_bin_contents.c.id,
 -                                 filename = self.tbl_pending_bin_contents.c.filename,
 -                                 package = self.tbl_pending_bin_contents.c.package,
 -                                 version = self.tbl_pending_bin_contents.c.version,
 -                                 arch = self.tbl_pending_bin_contents.c.arch,
 -                                 otype = self.tbl_pending_bin_contents.c.type))
 -
 -        mapper(DebContents, self.tbl_deb_contents,
 -               properties = dict(binary_id=self.tbl_deb_contents.c.binary_id,
 -                                 package=self.tbl_deb_contents.c.package,
 -                                 suite=self.tbl_deb_contents.c.suite,
 -                                 arch=self.tbl_deb_contents.c.arch,
 -                                 section=self.tbl_deb_contents.c.section,
 -                                 filename=self.tbl_deb_contents.c.filename))
 -
 -        mapper(UdebContents, self.tbl_udeb_contents,
 -               properties = dict(binary_id=self.tbl_udeb_contents.c.binary_id,
 -                                 package=self.tbl_udeb_contents.c.package,
 -                                 suite=self.tbl_udeb_contents.c.suite,
 -                                 arch=self.tbl_udeb_contents.c.arch,
 -                                 section=self.tbl_udeb_contents.c.section,
 -                                 filename=self.tbl_udeb_contents.c.filename))
  
          mapper(BuildQueue, self.tbl_build_queue,
                 properties = dict(queue_id = self.tbl_build_queue.c.id))
diff --combined daklib/queue.py
index b3e26d7bed50945dc1a47b4cf525c0fb7f309a64,7bfac44eb4487c8a4b8fbbb01189fc29406482fc..646d89c508a349193ee9ab2033af30f56098249a
@@@ -53,13 -53,14 +53,13 @@@ from dbconn import 
  from summarystats import SummaryStats
  from utils import parse_changes, check_dsc_files
  from textutils import fix_maintainer
 -from binary import Binary
  from lintian import parse_lintian_output, generate_reject_messages
  
  # suppress some deprecation warnings in squeeze related to apt_pkg
  # module
  import warnings
  warnings.filterwarnings('ignore', \
-     "apt_pkg-.ParseSection\(\) is deprecated. Please see apt_pkg\.TagSection\(\) for the replacement\.", \
+     "apt_pkg.ParseSection\(\) is deprecated. Please see apt_pkg\.TagSection\(\) for the replacement\.", \
      DeprecationWarning)
  warnings.filterwarnings('ignore', \
      "Attribute 'Find' of the 'apt_pkg\.TagSection' object is deprecated, use 'find' instead\.", \
@@@ -865,6 -866,13 +865,6 @@@ class Upload(object)
          # Check the version and for file overwrites
          self.check_binary_against_db(f, session)
  
 -        # Temporarily disable contents generation until we change the table storage layout
 -        #b = Binary(f)
 -        #b.scan_package()
 -        #if len(b.rejects) > 0:
 -        #    for j in b.rejects:
 -        #        self.rejects.append(j)
 -
      def source_file_checks(self, f, session):
          entry = self.pkg.files[f]