fixed some bugs on the dependencies' side
git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@56 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
@@ -26,7 +26,9 @@ pData = {
|
||||
'etpapi': "", # blockers
|
||||
}
|
||||
|
||||
ETP_API = "1.0"
|
||||
ETP_API = "1"
|
||||
ETP_API_SUBLEVEL = ".0"
|
||||
|
||||
|
||||
# variables
|
||||
# should we import these into make.conf ?
|
||||
@@ -50,8 +52,10 @@ if not pBinHost.endswith("/"):
|
||||
import commands
|
||||
if (commands.getoutput("q -V").find("portage-utils") != -1):
|
||||
pFindLibrary = "qfile -qC "
|
||||
pFindLibraryXT = "qfile -qeC "
|
||||
else:
|
||||
pFindLibrary = "equery belongs -n "
|
||||
pFindLibraryXT = "equery belongs -en "
|
||||
|
||||
# Portage /var/db/<pkgcat>/<pkgname-pkgver>/*
|
||||
# you never know if gentoo devs change these things
|
||||
|
||||
@@ -6,16 +6,28 @@
|
||||
|
||||
import portage
|
||||
import portage_const
|
||||
from portage_dep import isvalidatom, isjustname, dep_getkey
|
||||
|
||||
from entropyConstants import *
|
||||
import commands
|
||||
|
||||
# resolve atoms automagically
|
||||
# resolve atoms automagically (best, not current!)
|
||||
# sys-libs/application --> sys-libs/application-1.2.3-r1
|
||||
def getBestAtom(atom):
|
||||
rc = portage.portdb.xmatch("bestmatch-visible",str(atom))
|
||||
return rc
|
||||
|
||||
def getArch():
|
||||
return portage.settings["ARCH"]
|
||||
|
||||
def getInstalledAtom(atom):
|
||||
if (isjustname(atom) == 1):
|
||||
# resolve name to atom
|
||||
rc = portage.db['/']['vartree'].dep_match(str(atom))
|
||||
return rc[len(rc)-1]
|
||||
else:
|
||||
return atom
|
||||
|
||||
def print_error(msg):
|
||||
print "* erro * : "+msg
|
||||
|
||||
@@ -116,6 +128,9 @@ def extractPkgData(package):
|
||||
tmpIUSE = f.readline().strip().split()
|
||||
f.close()
|
||||
|
||||
# fill KEYWORDS
|
||||
|
||||
|
||||
for i in tmpIUSE:
|
||||
if tmpUSE.find(i) != -1:
|
||||
pData['useflags'] += i+" "
|
||||
@@ -244,13 +259,21 @@ def extractPkgData(package):
|
||||
neededLibraries = list(set(neededLibraries))
|
||||
|
||||
runtimeNeededPackages = []
|
||||
runtimeNeededPackagesXT = []
|
||||
for i in neededLibraries:
|
||||
pkgs = commands.getoutput(pFindLibrary+i).split("\n")
|
||||
pkgs = commands.getoutput(pFindLibraryXT+i).split("\n")
|
||||
if (pkgs[0] != ""):
|
||||
for y in pkgs:
|
||||
runtimeNeededPackages.append(y)
|
||||
runtimeNeededPackagesXT.append(y)
|
||||
y = dep_getkey(y)
|
||||
runtimeNeededPackages.append(y)
|
||||
#pkgsXT = commands.getoutput(pFindLibraryXT+i).split("\n")
|
||||
#if (pkgs[0] != ""):
|
||||
# for y in pkgsXT:
|
||||
# runtimeNeededPackagesXT.append(y)
|
||||
|
||||
runtimeNeededPackages = list(set(runtimeNeededPackages))
|
||||
runtimeNeededPackagesXT = list(set(runtimeNeededPackagesXT))
|
||||
|
||||
# now keep only the ones not available in pData['dependencies']
|
||||
for i in runtimeNeededPackages:
|
||||
@@ -258,16 +281,23 @@ def extractPkgData(package):
|
||||
# filter itself
|
||||
if (i != pData['category']+"/"+pData['name']):
|
||||
pData['rundependencies'] += i+" "
|
||||
i = getBestAtom(i)
|
||||
|
||||
for i in runtimeNeededPackagesXT:
|
||||
x = dep_getkey(i)
|
||||
if pData['dependencies'].find(x) == -1:
|
||||
# filter itself
|
||||
if (x != pData['category']+"/"+pData['name']):
|
||||
pData['rundependenciesXT'] += i+" "
|
||||
|
||||
# format properly
|
||||
if pData['rundependencies'].endswith(" "):
|
||||
pData['rundependencies'] = pData['rundependencies'][:len(pData['rundependencies'])-1]
|
||||
|
||||
if pData['rundependenciesXT'].endswith(" "):
|
||||
pData['rundependenciesXT'] = pData['rundependenciesXT'][:len(pData['rundependenciesXT'])-1]
|
||||
|
||||
# write API info
|
||||
pData['etpapi'] = ETP_API
|
||||
pData['etpapi'] = ETP_API+ETP_API_SUBLEVEL
|
||||
|
||||
return pData
|
||||
|
||||
|
||||
Reference in New Issue
Block a user