]> git.decadent.org.uk Git - dak.git/commitdiff
Merge remote-tracking branch 'origin/master'
authorAnsgar Burchardt <ansgar@debian.org>
Sun, 25 Nov 2012 10:48:41 +0000 (11:48 +0100)
committerAnsgar Burchardt <ansgar@debian.org>
Sun, 25 Nov 2012 10:48:41 +0000 (11:48 +0100)
config/debian/apache.conf-incoming
dak/admin.py
daklib/archive.py
daklib/dbconn.py

index 0b6c4db287d0eaa3bd6e73b4471298eb4c2ec287..480ce0f8f285024ba94caf6c2a248da151e75642 100644 (file)
     # test access to check functionality, ganneff
     allow from 213.146.108.162
 
+    # for testing sbuild-db; rleigh@codelibre.net
+    # nagini.codelibre.net
+    allow from 80.68.93.164
+    allow from 2001:41c8:1:5750::2
+
     # Should be in DSA list
     # amd64
     # vitry (archive rebuild)
index 8ba79797bdaf6345e6d5b1c3bd0206c8c3313c08..0de7cd69751ea92336fcb780b6b3dec00f8b37ea 100755 (executable)
@@ -103,6 +103,7 @@ Perform administrative work on the dak database.
                             primary mirror MIRROR.
      archive rm NAME        remove archive NAME (will only work if there are
                             no files and no suites in the archive)
+     archive rename OLD NEW rename archive OLD to NEW
 
   version-check / v-c:
      v-c list                        show version checks for all suites
@@ -429,10 +430,23 @@ def archive_rm(name):
     else:
         session.commit()
 
+def archive_rename(oldname, newname):
+    session = DBConn().session()
+    archive = get_archive(oldname, session)
+    archive.archive_name = newname
+    session.flush()
+
+    if dryrun:
+        session.rollback()
+    else:
+        session.commit()
+
 def archive(command):
     mode = command[1]
     if mode == 'list':
         archive_list()
+    elif mode == 'rename':
+        archive_rename(command[2], command[3])
     elif mode == 'add':
         archive_add(command[2:])
     elif mode == 'rm':
index 6a424cdfdc08a91632daff29bc2785d8d7a637bf..ca58da87a2858917fda4387173f54fde3796d396 100644 (file)
@@ -86,7 +86,7 @@ class ArchiveTransaction(object):
         Will not give an error when the file is already present.
 
         @rtype:  L{daklib.dbconn.PoolFile}
-        @return: batabase object for the new file
+        @return: database object for the new file
         """
         session = self.session
 
index f2f8a9020ab7271c77e1aeddb8f765ea10424efd..413a0fdd1fcf5fc33a96c969f850bf17d9fdf1d7 100644 (file)
@@ -2892,7 +2892,7 @@ class DBConn(object):
             engine_args['pool_size'] = int(cnf['DB::PoolSize'])
         if cnf.has_key('DB::MaxOverflow'):
             engine_args['max_overflow'] = int(cnf['DB::MaxOverflow'])
-        if sa_major_version == '0.6' and cnf.has_key('DB::Unicode') and \
+        if sa_major_version in ('0.6', '0.7') and cnf.has_key('DB::Unicode') and \
             cnf['DB::Unicode'] == 'false':
             engine_args['use_native_unicode'] = False