From 4008c4693058ce192234a4bc0a4d9b86cfe4d2b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Tue, 22 May 2007 16:34:32 +0000 Subject: [PATCH] [merge] cleanup from -catbox branch/merge quilt support/merge catbox support --- pisi/cli/commands.py | 54 +++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/pisi/cli/commands.py b/pisi/cli/commands.py index 2048a6f3..a4119aa6 100644 --- a/pisi/cli/commands.py +++ b/pisi/cli/commands.py @@ -99,9 +99,9 @@ class Command(object): @staticmethod def commands_string(): s = '' - list = [x.name[0] for x in Command.cmd] - list.sort() - for name in list: + l = [x.name[0] for x in Command.cmd] + l.sort() + for name in l: commandcls = Command.cmd_dict[name] trans = gettext.translation('pisi', fallback=True) summary = trans.ugettext(commandcls.__doc__).split('\n')[0] @@ -173,12 +173,12 @@ class Command(object): # make destdir absolute if self.options.destdir: - dir = str(self.options.destdir) + d = str(self.options.destdir) import os.path - if not os.path.exists(dir): - pisi.cli.printu(_('Destination directory %s does not exist. Creating directory.\n') % dir) - os.makedirs(dir) - self.options.destdir = os.path.realpath(dir) + if not os.path.exists(d): + pisi.cli.printu(_('Destination directory %s does not exist. Creating directory.\n') % d) + os.makedirs(d) + self.options.destdir = os.path.realpath(d) def check_auth_info(self): username = self.options.username @@ -451,6 +451,10 @@ to be downloaded from a repository containing sources. default=False, help=_("Do not install build dependencies, fail if a build dependency is present")) group.add_option("-F", "--package-format", action="store", default='1.1', help=_("PiSi binary package formats: '1.0', '1.1' (default)")) + group.add_option("--use-quilt", action="store_true", default=False, + help=_("Use quilt patch management system instead of GNU patch")) + group.add_option("--ignore-sandbox", action="store_true", default=False, + help=_("Constrain build process inside the build folder")) def add_steps_options(self): group = OptionGroup(self.parser, _("build steps")) @@ -528,7 +532,7 @@ and creates a delta pisi package with the changed files between two releases. self.init(database=False, write=False) - if len(self.args) is not 2: + if len(self.args) != 2: self.help() return @@ -728,9 +732,9 @@ expanded to package names. import os patterns = [] - file = ctx.get_option('exclude_from') - if os.path.exists(file): - for line in open(file, "r").readlines(): + f = ctx.get_option('exclude_from') + if os.path.exists(f): + for line in open(f, "r").readlines(): if not line.startswith('#') and not line == '\n': patterns.append(line.strip()) if patterns: @@ -750,8 +754,8 @@ expanded to package names. if not match: # match pattern in component names - for cmp in fnmatch.filter(ctx.componentdb.list_components(), pattern): - packages = packages - set(ctx.componentdb.get_union_packages(cmp, walk=True)) + for compare in fnmatch.filter(ctx.componentdb.list_components(), pattern): + packages = packages - set(ctx.componentdb.get_union_packages(compare, walk=True)) return list(packages) @@ -966,8 +970,6 @@ Usage: info ... ctx.ui.info(_("%s is not installed") % arg) def print_pkginfo(self, metadata, files, repo = None): - import os.path - if ctx.get_option('short'): pkg = metadata.package ctx.ui.info('%15s - %s' % (pkg.name, unicode(pkg.summary))) @@ -1381,12 +1383,12 @@ all repositories. component = ctx.get_option('component') if component: - list = ctx.componentdb.get_packages(component, walk=True, repo=repo) + l = ctx.componentdb.get_packages(component, walk=True, repo=repo) else: - list = ctx.packagedb.list_packages(repo) + l = ctx.packagedb.list_packages(repo) installed_list = ctx.installdb.list_installed() - list.sort() - for p in list: + l.sort() + for p in l: package = ctx.packagedb.get_package(p) if self.options.long: ctx.ui.info(unicode(package)) @@ -1424,9 +1426,9 @@ repositories. self.init(database = True, write = False) - list = ctx.componentdb.list_components() - list.sort() - for p in list: + l = ctx.componentdb.list_components() + l.sort() + for p in l: component = ctx.componentdb.get_component(p) if self.options.long: ctx.ui.info(unicode(component)) @@ -1463,9 +1465,9 @@ Gives a brief list of sources published in the repositories. self.init(database = True, write = False) - list = ctx.sourcedb.list() - list.sort() - for p in list: + l = ctx.sourcedb.list() + l.sort() + for p in l: sf, repo = ctx.sourcedb.get_spec_repo(p) if self.options.long: ctx.ui.info('[Repository: ' + repo + ']')