do some bug fixes and add dependency filtering

git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@418 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
lxnay
2007-08-08 12:21:10 +00:00
parent 374e42b8d2
commit 1abd60d652
3 changed files with 27 additions and 2 deletions
+5 -1
View File
@@ -1335,6 +1335,8 @@ def installFile(package, infoDict = None):
if not os.path.isdir(imageDir):
return 2
# setup imageDir properly
imageDir = imageDir.encode(sys.getfilesystemencoding())
# merge data into system
for currentdir,subdirs,files in os.walk(imageDir):
# create subdirs
@@ -1345,7 +1347,9 @@ def installFile(package, infoDict = None):
# get info
if (rootdir):
if os.path.islink(rootdir):
if not os.access(os.readlink(rootdir),os.R_OK): # broken symlink
if not os.path.exists(rootdir): # broken symlink
#print "I want to remove "+rootdir
#print os.readlink(rootdir)
os.remove(rootdir)
elif os.path.isfile(rootdir): # weird
print_warning(red(" *** ")+bold(rootdir)+red(" is a file when it should be a directory !! Removing in 10 seconds..."))
+2
View File
@@ -333,6 +333,8 @@ etpConst = {
'packagedbdir': "/db", # directory of the database file in the .tbz2 package
'packagedbfile': "/data.db", # database file in the directory above
'packagecontentdir': "/package", # directory of the package file in the .tbz2 package
'dependenciesfilter': ['sys-devel/automake','sys-devel/autoconf','sys-devel/libtool','dev-util/pkgconfig','sys-devel/make'],
'developmentcategories': ['sys-devel','dev-'],
}
+20 -1
View File
@@ -297,7 +297,7 @@ def extractPkgData(package, etpBranch = "unstable", structuredLayout = False):
_outcontent = []
for i in outcontent:
try:
i.encode("utf-8")
i = i.encode(sys.getfilesystemencoding())
_outcontent.append(i)
except:
pass
@@ -553,6 +553,25 @@ def extractPkgData(package, etpBranch = "unstable", structuredLayout = False):
for i in conflicts.split():
etpData['conflicts'].append(i)
# filter development dependencies
devPackage = False
for cat in etpConst['developmentcategories']:
if etpData['category'].startswith(cat):
devPackage = True
break
if (not devPackage):
# rip away building dependencies
if (etpData['dependencies']):
newdeps = etpData['dependencies'][:]
for dep in newdeps:
for develdep in etpConst['dependenciesfilter']:
if dep.find(develdep) != -1:
try:
while 1: etpData['dependencies'].remove(dep)
except:
pass
if (kernelDependentModule):
# add kname to the dependency
etpData['dependencies'].append("sys-kernel/linux-"+kname+"-"+kver)