Gereksiz olabilir, ama yazdım bir kere.
This commit is contained in:
Barış Metin
2005-06-22 06:17:55 +00:00
parent a0fba72103
commit 59670364d8
+9 -3
View File
@@ -107,15 +107,21 @@ class PisiBuild:
metadata.write(os.path.join(self.ctx.pkg_dir(),"metadata.xml")) metadata.write(os.path.join(self.ctx.pkg_dir(),"metadata.xml"))
def genFilesXml(self, package): def genFilesXml(self, package):
# the worst function in this project! """Generetes files.xml using the path definitions in specfile and
# just testing... generated files by the build system."""
files = Files() files = Files()
install_dir = self.ctx.pkg_install_dir() install_dir = self.ctx.pkg_install_dir()
for fpath, fhash in util.get_file_hashes(install_dir): for fpath, fhash in util.get_file_hashes(install_dir):
# get the relative path # get the relative path
fpath = fpath[len(install_dir):] fpath = fpath[len(install_dir):]
depth = 0
ftype = "" ftype = ""
# The usage of depth is somewhat confusing. It is used for
# finding the best match to package.paths. For an example,
# if package.paths contains
# ['/usr/share','/usr/share/doc'] and fpath is
# /usr/share/doc/filename our iteration over package.paths
# should match the second item.
depth = 0
for path in package.paths: for path in package.paths:
if fpath.startswith(path.pathname): if fpath.startswith(path.pathname):
if depth < len(path.pathname): if depth < len(path.pathname):