#!/usr/bin/env python
# Manipulate suite tags
-# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org>
-# $Id: heidi,v 1.15 2002-10-16 02:47:32 troup Exp $
+# Copyright (C) 2000, 2001, 2002, 2003, 2004 James Troup <james@nocrew.org>
+# $Id: heidi,v 1.18 2004-03-11 00:20:51 troup 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
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)
# 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;
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;
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:
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:
if not Cnf.has_key("Suite::%s" % (suite)):
utils.fubar("Unknown suite '%s'." %(suite));
else:
- if action != None:
+ if action:
utils.fubar("Can only perform one action at a time.");
action = i;