X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fadmin.py;h=0de7cd69751ea92336fcb780b6b3dec00f8b37ea;hb=5413d5ecb8bb3a11751b4684a35ee4ad65bc64c9;hp=8ba79797bdaf6345e6d5b1c3bd0206c8c3313c08;hpb=1274df1d98f7004042768c9e2650f5ae9dd79e41;p=dak.git diff --git a/dak/admin.py b/dak/admin.py index 8ba79797..0de7cd69 100755 --- a/dak/admin.py +++ b/dak/admin.py @@ -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':