fix #698, additional files icin glob desteği..
This commit is contained in:
+11
-6
@@ -485,12 +485,17 @@ class Builder:
|
|||||||
os.chdir(self.pspecDir)
|
os.chdir(self.pspecDir)
|
||||||
install_dir = self.bctx.pkg_dir() + ctx.const.install_dir_suffix
|
install_dir = self.bctx.pkg_dir() + ctx.const.install_dir_suffix
|
||||||
for afile in package.additionalFiles:
|
for afile in package.additionalFiles:
|
||||||
src = os.path.join(ctx.const.files_dir, afile.filename)
|
wildcard_path = util.join_path(ctx.const.files_dir, afile.filename)
|
||||||
dest = os.path.join(install_dir + os.path.dirname(afile.target), os.path.basename(afile.target))
|
destdir = util.join_path(install_dir, os.path.dirname(afile.target))
|
||||||
util.copy_file(src, dest)
|
for src in glob.glob(wildcard_path):
|
||||||
if afile.permission:
|
destfile = os.path.basename(afile.target)
|
||||||
# mode is octal!
|
if not destfile: destfile = os.path.basename(src)
|
||||||
os.chmod(dest, int(afile.permission, 8))
|
ctx.ui.debug(_("Copying additional file: '%s' to '%s' as '%s'") \
|
||||||
|
% (src, destdir, destfile))
|
||||||
|
util.copy_file(src, util.join_path(destdir, destfile))
|
||||||
|
if afile.permission:
|
||||||
|
# mode is octal!
|
||||||
|
os.chmod(util.join_path(destdir, destfile), int(afile.permission, 8))
|
||||||
|
|
||||||
os.chdir(c)
|
os.chdir(c)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user