util.subpath kullan.
comment ekle
This commit is contained in:
+9
-3
@@ -19,7 +19,8 @@ from package import Package
|
|||||||
class PisiBuildError(Exception):
|
class PisiBuildError(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# helper functions
|
|
||||||
|
# Helper Functions
|
||||||
def getFileType(path, pinfoList):
|
def getFileType(path, pinfoList):
|
||||||
"""Return the file type of a path according to the given PathInfo
|
"""Return the file type of a path according to the given PathInfo
|
||||||
list"""
|
list"""
|
||||||
@@ -32,7 +33,7 @@ def getFileType(path, pinfoList):
|
|||||||
ftype = ""
|
ftype = ""
|
||||||
path = "/"+path # we need a real path.
|
path = "/"+path # we need a real path.
|
||||||
for pinfo in pinfoList:
|
for pinfo in pinfoList:
|
||||||
if path.startswith(pinfo.pathname):
|
if util.subpath(pinfo.pathname, path):
|
||||||
length = len(pinfo.pathname)
|
length = len(pinfo.pathname)
|
||||||
if depth < length:
|
if depth < length:
|
||||||
depth = length
|
depth = length
|
||||||
@@ -49,7 +50,12 @@ def checkPathCollision(package, pkgList):
|
|||||||
if pkg is package:
|
if pkg is package:
|
||||||
continue
|
continue
|
||||||
for path in pkg.paths:
|
for path in pkg.paths:
|
||||||
if path.pathname.startswith(pinfo.pathname):
|
# if pinfo.pathname is a subpath of path.pathname like
|
||||||
|
# the example below. path.patname is marked as a
|
||||||
|
# collide. Exp:
|
||||||
|
# pinfo.pathname: /usr/share
|
||||||
|
# path.pathname: /usr/share/doc
|
||||||
|
if util.subpath(pinfo.pathname, path.pathname):
|
||||||
collisions.append(path.pathname)
|
collisions.append(path.pathname)
|
||||||
return collisions
|
return collisions
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user