]> err.no Git - dak/commitdiff
undoing changes I shouldn't have made
authorMike O'Connor <stew@vireo.org>
Wed, 28 Oct 2009 19:57:34 +0000 (20:57 +0100)
committerMike O'Connor <stew@vireo.org>
Wed, 28 Oct 2009 19:57:34 +0000 (20:57 +0100)
Signed-off-by: Mike O'Connor <stew@vireo.org>
daklib/dbconn.py
daklib/utils.py

index 3c0bc50d38750c3dbecebb0280f1eb620aaf2fce..6809aaef350666e4731432bc7a3e160a6ccf28d3 100755 (executable)
@@ -230,17 +230,6 @@ __all__.append('BinAssociation')
 
 ################################################################################
 
-class BinContents(object):
-    def __init__(self, *args, **kwargs):
-        pass
-
-    def __repr__(self):
-        return '<BinContents (%s, %s)>' % (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 '<ContentFilename %s>' % 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))
 
index 25b16125a86fd08051ba82a6b2737979181e184b..b0b71c0169d413e32d5a6c0b1aa009dd76f4211d 100755 (executable)
@@ -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())
 
 ###############################################################################