* fix: dosyalardan install ederken, onlarin arasinda da bagimlilik
cozmeye calis dogru bicimde. (yarim kalmis oradaki code) (fix: #358) * bunun icin dependency'e sekilli bir fonksiyon ekle * CLI islemeyi biraz gelistir, index komutu arg istemez illa ornegin * nedir?
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Project SYSTEM "Project-3.7.dtd">
|
||||
<!-- Project file for project pisi -->
|
||||
<!-- Saved: 2005-08-10, 20:16:49 -->
|
||||
<!-- Saved: 2005-08-11, 04:30:17 -->
|
||||
<!-- Copyright (C) 2005 PiSi Development Team, pisi@uludag.org.tr -->
|
||||
<Project version="3.7">
|
||||
<ProgLanguage mixed="0">Python</ProgLanguage>
|
||||
@@ -306,7 +306,7 @@
|
||||
<Source>
|
||||
<Dir>pisi</Dir>
|
||||
<Dir>actionsapi</Dir>
|
||||
<Name>pisitoolsfun.py</Name>
|
||||
<Name>pisitoolsfunctions.py</Name>
|
||||
</Source>
|
||||
</Sources>
|
||||
<Forms>
|
||||
@@ -319,11 +319,6 @@
|
||||
<Other>
|
||||
<Name>pisi-cli</Name>
|
||||
</Other>
|
||||
<Other>
|
||||
<Dir>pisi</Dir>
|
||||
<Dir>actionsapi</Dir>
|
||||
<Name>pisitoolsfun</Name>
|
||||
</Other>
|
||||
</Others>
|
||||
<MainScript>
|
||||
<Name>pisi-cli</Name>
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
+2
-4
@@ -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()
|
||||
|
||||
@@ -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"""
|
||||
|
||||
+6
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user