diff --git a/pisi.e3p b/pisi.e3p index e73d8b5a..5f6fe359 100644 --- a/pisi.e3p +++ b/pisi.e3p @@ -1,7 +1,7 @@ - + Python @@ -306,7 +306,7 @@ pisi actionsapi - pisitoolsfun.py + pisitoolsfunctions.py @@ -319,11 +319,6 @@ pisi-cli - - pisi - actionsapi - pisitoolsfun - pisi-cli diff --git a/pisi/cli/commands.py b/pisi/cli/commands.py index aa55dd35..36313bd0 100644 --- a/pisi/cli/commands.py +++ b/pisi/cli/commands.py @@ -52,8 +52,8 @@ class Command(object): version="%prog " + pisi.__version__) self.options() self.parser = commonopts(self.parser) - (self.options, args) = self.parser.parse_args() - self.args = args[1:] + (self.options, self.args) = self.parser.parse_args() + self.args.pop(0) # exclude command arg # initialize PiSi #print '**** running cmd' @@ -301,17 +301,15 @@ TODO: Some description... super(Index, self).__init__() def run(self): - if not self.args: - self.help() - return from pisi.toplevel import index if len(self.args)==1: index(self.args[0]) elif len(self.args)==0: + print 'Indexing current directory.' index() else: - print 'Indexing only a single directory supported' + print 'Indexing only a single directory supported.' return diff --git a/pisi/cli/pisicli.py b/pisi/cli/pisicli.py index 20d4b373..14600fd8 100644 --- a/pisi/cli/pisicli.py +++ b/pisi/cli/pisicli.py @@ -41,11 +41,9 @@ class PisiCLI(object): cmd = "" try: (options, args) = self.parser.parse_args() - #if len(parser.rargs)==0: - # self.die() + if len(args)==0: + self.die() cmd = args[0] - #cli = pisi.ui.CLI(options.debug) - #pisi.ui.ui = cli except IndexError: self.die() diff --git a/pisi/dependency.py b/pisi/dependency.py index fbc5b52a..af8f9552 100644 --- a/pisi/dependency.py +++ b/pisi/dependency.py @@ -74,6 +74,16 @@ class DepInfo: s += 'rel <= ' + self.releaseTo return s +def dictSatisfiesDep(dict, depinfo): + """determine if a package in a dictionary satisfies given dependency spec""" + pkg_name = depinfo.package + if not dict.has_key(pkg_name): + return False + else: + pkg = dict[pkg_name] + (version, release) = (pkg.version, pkg.release) + return depinfo.satisfies(pkg_name, version, release) + def installedSatisfiesDep(depinfo): """determine if a package in *repository* satisfies given dependency spec""" diff --git a/pisi/toplevel.py b/pisi/toplevel.py index d629ebb4..41938bfd 100644 --- a/pisi/toplevel.py +++ b/pisi/toplevel.py @@ -69,6 +69,10 @@ def install_pkg_files(packages): package.read() d_t[package.metadata.package.name] = package.metadata + def satisfiesDep(dep): + return dependency.installedSatisfiesDep(dep) \ + or dependency.dictSatisfiesDep(d_t, dep) + # for this case, we have to determine the dependencies # that aren't already satisfied and try to install them # from the repository @@ -76,7 +80,8 @@ def install_pkg_files(packages): for name in d_t.keys(): md = d_t[name] deps = md.package.runtimeDeps - if not dependency.satisfiesDeps(md.package.name, deps): + if not dependency.satisfiesDeps(md.package.name, deps, + satisfiesDep): dep_unsatis += deps # now determine if these unsatisfied dependencies could