From: Mike O'Connor Date: Wed, 28 Oct 2009 19:57:34 +0000 (+0100) Subject: undoing changes I shouldn't have made X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e015c1abee6a37d5e40d49250e61dd9c50c203b;p=dak undoing changes I shouldn't have made Signed-off-by: Mike O'Connor --- diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 3c0bc50d..6809aaef 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -230,17 +230,6 @@ __all__.append('BinAssociation') ################################################################################ -class BinContents(object): - def __init__(self, *args, **kwargs): - pass - - def __repr__(self): - return '' % (self.binary, self.filename) - -__all__.append('BinContents') - -################################################################################ - class DBBinary(object): def __init__(self, *args, **kwargs): pass @@ -446,6 +435,15 @@ __all__.append('DBConfig') ################################################################################ +class ContentFilename(object): + def __init__(self, *args, **kwargs): + pass + + def __repr__(self): + return '' % self.filename + +__all__.append('ContentFilename') + @session_wrapper def get_or_set_contents_file_id(filename, session=None): """ @@ -614,7 +612,7 @@ def insert_content_paths(binary_id, fullpaths, session=None): for fullpath in fullpaths: if fullpath.startswith( './' ): fullpath = fullpath[2:] - + session.execute( "INSERT INTO bin_contents ( file, binary_id ) VALUES ( :filename, :id )", { 'filename': fullpath, 'id': binary_id} ) session.commit() @@ -2117,7 +2115,6 @@ class DBConn(Singleton): binary_id = self.tbl_bin_associations.c.bin, binary = relation(DBBinary))) - mapper(DBBinary, self.tbl_binaries, properties = dict(binary_id = self.tbl_binaries.c.id, package = self.tbl_binaries.c.package, @@ -2144,6 +2141,24 @@ class DBConn(Singleton): mapper(DBConfig, self.tbl_config, properties = dict(config_id = self.tbl_config.c.id)) + mapper(ContentAssociation, self.tbl_content_associations, + properties = dict(ca_id = self.tbl_content_associations.c.id, + filename_id = self.tbl_content_associations.c.filename, + filename = relation(ContentFilename), + filepath_id = self.tbl_content_associations.c.filepath, + filepath = relation(ContentFilepath), + binary_id = self.tbl_content_associations.c.binary_pkg, + binary = relation(DBBinary))) + + + mapper(ContentFilename, self.tbl_content_file_names, + properties = dict(cafilename_id = self.tbl_content_file_names.c.id, + filename = self.tbl_content_file_names.c.file)) + + mapper(ContentFilepath, self.tbl_content_file_paths, + properties = dict(cafilepath_id = self.tbl_content_file_paths.c.id, + filepath = self.tbl_content_file_paths.c.path)) + mapper(DSCFile, self.tbl_dsc_files, properties = dict(dscfile_id = self.tbl_dsc_files.c.id, source_id = self.tbl_dsc_files.c.source, @@ -2198,6 +2213,13 @@ class DBConn(Singleton): properties = dict(overridetype = self.tbl_override_type.c.type, overridetype_id = self.tbl_override_type.c.id)) + mapper(PendingContentAssociation, self.tbl_pending_content_associations, + properties = dict(pca_id = self.tbl_pending_content_associations.c.id, + filepath_id = self.tbl_pending_content_associations.c.filepath, + filepath = relation(ContentFilepath), + filename_id = self.tbl_pending_content_associations.c.filename, + filename = relation(ContentFilename))) + mapper(Priority, self.tbl_priority, properties = dict(priority_id = self.tbl_priority.c.id)) diff --git a/daklib/utils.py b/daklib/utils.py index 25b16125..b0b71c01 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -1504,8 +1504,8 @@ apt_pkg.init() Cnf = apt_pkg.newConfiguration() apt_pkg.ReadConfigFileISC(Cnf,default_config) -#if which_conf_file() != default_config: -# apt_pkg.ReadConfigFileISC(Cnf,which_conf_file()) +if which_conf_file() != default_config: + apt_pkg.ReadConfigFileISC(Cnf,which_conf_file()) ###############################################################################