X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=heidi;h=2454b23478c54c81c8556acf16d1a825aba2e065;hb=4d40ad73b577700f97128cdea5e2e177baf38e6a;hp=8b3579af7d1743b7857f137a83843223fd2dbacc;hpb=c846e77a848d60dd115f00faa0d9a854161d99eb;p=dak.git diff --git a/heidi b/heidi index 8b3579af..2454b234 100755 --- a/heidi +++ b/heidi @@ -1,8 +1,8 @@ #!/usr/bin/env python # Manipulate suite tags -# Copyright (C) 2000, 2001, 2002 James Troup -# $Id: heidi,v 1.15 2002-10-16 02:47:32 troup Exp $ +# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 James Troup +# $Id: heidi,v 1.19 2005-11-15 09:50:32 ajt Exp $ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -59,10 +59,10 @@ def usage (exit_code=0): Display or alter the contents of a suite using FILE(s), or stdin. -a, --add=SUITE add to SUITE + -h, --help show this help and exit -l, --list=SUITE list the contents of SUITE -r, --remove=SUITE remove from SUITE - -s, --set=SUITE set SUITE - -h, --help show this help and exit""" + -s, --set=SUITE set SUITE""" sys.exit(exit_code) @@ -107,7 +107,7 @@ def set_suite (file, suite_id): # Build up a dictionary of what should be in the suite desired = {}; for line in lines: - split_line = line[:-1].strip().split(); + split_line = line.strip().split(); if len(split_line) != 3: utils.warn("'%s' does not break into 'package version architecture'." % (line[:-1])); continue; @@ -155,7 +155,7 @@ def process_file (file, suite, action): projectB.query("BEGIN WORK"); for line in lines: - split_line = line[:-1].strip().split(); + split_line = line.strip().split(); if len(split_line) != 3: utils.warn("'%s' does not break into 'package version architecture'." % (line[:-1])); continue; @@ -176,7 +176,7 @@ def process_file (file, suite, action): assoication_id = ql[0][0]; # Take action if action == "add": - if assoication_id != None: + if assoication_id: utils.warn("'%s~%s~%s' already exists in suite %s." % (package, version, architecture, suite)); continue; else: @@ -197,7 +197,7 @@ def process_file (file, suite, action): assoication_id = ql[0][0]; # Take action if action == "add": - if assoication_id != None: + if assoication_id: utils.warn("'%s~%s~%s' already exists in suite %s." % (package, version, architecture, suite)); continue; else: @@ -259,10 +259,10 @@ def main (): for i in ("add", "list", "remove", "set"): if Cnf["Heidi::Options::%s" % (i)] != "": suite = Cnf["Heidi::Options::%s" % (i)]; - if not Cnf.has_key("Suite::%s" % (suite)): + if db_access.get_suite_id(suite) == -1: utils.fubar("Unknown suite '%s'." %(suite)); else: - if action != None: + if action: utils.fubar("Can only perform one action at a time."); action = i;