X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fadmin.py;h=7400a1e715ec36998773fd6bd71b3efe34b8b4e3;hb=bd60c2dbb261e14c041df794e7fa1461921a06f8;hp=4923234bb3f945168f23657769e28e4b8b81769b;hpb=278c336540a48829f0d0b6ae81968640f40aab21;p=dak.git diff --git a/dak/admin.py b/dak/admin.py index 4923234b..7400a1e7 100755 --- a/dak/admin.py +++ b/dak/admin.py @@ -261,6 +261,23 @@ def __suite_add(d, args, addallarches=False): s.commit() +def __suite_rm(d, args): + die_arglen(args, 3, "E: removing a suite requires at least a name") + name = args[2] + print "Removing suite {0}".format(name) + if not dryrun: + try: + s = d.session() + su = get_suite(name.lower()) + if su is None: + die("E: Cannot find suite {0}".format(name)) + s.delete(su) + s.commit() + except IntegrityError as e: + die("E: Integrity error removing suite {0} (suite-arch entries probably still exist)".format(name)) + except SQLAlchemyError as e: + die("E: Error removing suite {0} ({1})".format(name, e)) + print "Suite {0} removed".format(name) def suite(command): args = [str(x) for x in command] @@ -275,6 +292,8 @@ def suite(command): __suite_list(d, args) elif mode == 'show': __suite_show(d, args) + elif mode == 'rm': + __suite_rm(d, args) elif mode == 'add': __suite_add(d, args, False) elif mode == 'add-all-arches':