* 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"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE Project SYSTEM "Project-3.7.dtd">
|
<!DOCTYPE Project SYSTEM "Project-3.7.dtd">
|
||||||
<!-- Project file for project pisi -->
|
<!-- 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 -->
|
<!-- Copyright (C) 2005 PiSi Development Team, pisi@uludag.org.tr -->
|
||||||
<Project version="3.7">
|
<Project version="3.7">
|
||||||
<ProgLanguage mixed="0">Python</ProgLanguage>
|
<ProgLanguage mixed="0">Python</ProgLanguage>
|
||||||
@@ -306,7 +306,7 @@
|
|||||||
<Source>
|
<Source>
|
||||||
<Dir>pisi</Dir>
|
<Dir>pisi</Dir>
|
||||||
<Dir>actionsapi</Dir>
|
<Dir>actionsapi</Dir>
|
||||||
<Name>pisitoolsfun.py</Name>
|
<Name>pisitoolsfunctions.py</Name>
|
||||||
</Source>
|
</Source>
|
||||||
</Sources>
|
</Sources>
|
||||||
<Forms>
|
<Forms>
|
||||||
@@ -319,11 +319,6 @@
|
|||||||
<Other>
|
<Other>
|
||||||
<Name>pisi-cli</Name>
|
<Name>pisi-cli</Name>
|
||||||
</Other>
|
</Other>
|
||||||
<Other>
|
|
||||||
<Dir>pisi</Dir>
|
|
||||||
<Dir>actionsapi</Dir>
|
|
||||||
<Name>pisitoolsfun</Name>
|
|
||||||
</Other>
|
|
||||||
</Others>
|
</Others>
|
||||||
<MainScript>
|
<MainScript>
|
||||||
<Name>pisi-cli</Name>
|
<Name>pisi-cli</Name>
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ class Command(object):
|
|||||||
version="%prog " + pisi.__version__)
|
version="%prog " + pisi.__version__)
|
||||||
self.options()
|
self.options()
|
||||||
self.parser = commonopts(self.parser)
|
self.parser = commonopts(self.parser)
|
||||||
(self.options, args) = self.parser.parse_args()
|
(self.options, self.args) = self.parser.parse_args()
|
||||||
self.args = args[1:]
|
self.args.pop(0) # exclude command arg
|
||||||
|
|
||||||
# initialize PiSi
|
# initialize PiSi
|
||||||
#print '**** running cmd'
|
#print '**** running cmd'
|
||||||
@@ -301,17 +301,15 @@ TODO: Some description...
|
|||||||
super(Index, self).__init__()
|
super(Index, self).__init__()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.args:
|
|
||||||
self.help()
|
|
||||||
return
|
|
||||||
|
|
||||||
from pisi.toplevel import index
|
from pisi.toplevel import index
|
||||||
if len(self.args)==1:
|
if len(self.args)==1:
|
||||||
index(self.args[0])
|
index(self.args[0])
|
||||||
elif len(self.args)==0:
|
elif len(self.args)==0:
|
||||||
|
print 'Indexing current directory.'
|
||||||
index()
|
index()
|
||||||
else:
|
else:
|
||||||
print 'Indexing only a single directory supported'
|
print 'Indexing only a single directory supported.'
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+2
-4
@@ -41,11 +41,9 @@ class PisiCLI(object):
|
|||||||
cmd = ""
|
cmd = ""
|
||||||
try:
|
try:
|
||||||
(options, args) = self.parser.parse_args()
|
(options, args) = self.parser.parse_args()
|
||||||
#if len(parser.rargs)==0:
|
if len(args)==0:
|
||||||
# self.die()
|
self.die()
|
||||||
cmd = args[0]
|
cmd = args[0]
|
||||||
#cli = pisi.ui.CLI(options.debug)
|
|
||||||
#pisi.ui.ui = cli
|
|
||||||
|
|
||||||
except IndexError:
|
except IndexError:
|
||||||
self.die()
|
self.die()
|
||||||
|
|||||||
@@ -74,6 +74,16 @@ class DepInfo:
|
|||||||
s += 'rel <= ' + self.releaseTo
|
s += 'rel <= ' + self.releaseTo
|
||||||
return s
|
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):
|
def installedSatisfiesDep(depinfo):
|
||||||
"""determine if a package in *repository* satisfies given
|
"""determine if a package in *repository* satisfies given
|
||||||
dependency spec"""
|
dependency spec"""
|
||||||
|
|||||||
+6
-1
@@ -69,6 +69,10 @@ def install_pkg_files(packages):
|
|||||||
package.read()
|
package.read()
|
||||||
d_t[package.metadata.package.name] = package.metadata
|
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
|
# for this case, we have to determine the dependencies
|
||||||
# that aren't already satisfied and try to install them
|
# that aren't already satisfied and try to install them
|
||||||
# from the repository
|
# from the repository
|
||||||
@@ -76,7 +80,8 @@ def install_pkg_files(packages):
|
|||||||
for name in d_t.keys():
|
for name in d_t.keys():
|
||||||
md = d_t[name]
|
md = d_t[name]
|
||||||
deps = md.package.runtimeDeps
|
deps = md.package.runtimeDeps
|
||||||
if not dependency.satisfiesDeps(md.package.name, deps):
|
if not dependency.satisfiesDeps(md.package.name, deps,
|
||||||
|
satisfiesDep):
|
||||||
dep_unsatis += deps
|
dep_unsatis += deps
|
||||||
|
|
||||||
# now determine if these unsatisfied dependencies could
|
# now determine if these unsatisfied dependencies could
|
||||||
|
|||||||
Reference in New Issue
Block a user