(additionalfile için glob desteği ve metadata.xml)
This commit is contained in:
A. Murat Eren
2005-11-13 18:39:57 +00:00
parent 9511d39d95
commit 5aa6e9d77d
+8 -1
View File
@@ -474,18 +474,23 @@ class Builder:
"""Build each package defined in PSPEC file. After this process there
will be .pisi files hanging around, AS INTENDED ;)"""
from copy import deepcopy
# Strip install directory before building .pisi packages.
self.strip_install_dir()
for package in self.spec.packages:
# store additional files
c = os.getcwd()
os.chdir(self.pspecDir)
install_dir = self.bctx.pkg_dir() + ctx.const.install_dir_suffix
tmp_aF = []
for afile in package.additionalFiles:
destdir = util.join_path(install_dir, os.path.dirname(afile.target))
for src in glob.glob(util.join_path(ctx.const.files_dir, afile.filename)):
tmp_afile_obj = deepcopy(afile)
tmp_afile_obj.filename = src[len(ctx.const.files_dir) + 1:]
tmp_aF.append(tmp_afile_obj)
destfile = os.path.basename(afile.target)
if not destfile: destfile = os.path.basename(src)
ctx.ui.debug(_("Copying additional file: '%s' to '%s' as '%s'") \
@@ -495,6 +500,8 @@ class Builder:
# mode is octal!
os.chmod(util.join_path(destdir, destfile), int(afile.permission, 8))
package.additionalFiles = tmp_aF
os.chdir(c)
ctx.ui.action(_("** Building package %s") % package.name);