diff --git a/pisi-spec.rng b/pisi-spec.rng
index 92dd4363..43c28693 100644
--- a/pisi-spec.rng
+++ b/pisi-spec.rng
@@ -49,6 +49,9 @@
+
+
+
diff --git a/pisi/operations/build.py b/pisi/operations/build.py
index 4364c5f2..2d510217 100644
--- a/pisi/operations/build.py
+++ b/pisi/operations/build.py
@@ -262,6 +262,9 @@ class Builder:
self.fetch_source_archive()
self.unpack_source_archive()
+ # Grab AdditionalFiles
+ self.copy_additional_source_files()
+
self.run_setup_action()
self.run_build_action()
if ctx.get_option('debug') and not ctx.get_option('ignore_check'):
@@ -350,8 +353,7 @@ class Builder:
self.download(comaruri, pisi.util.join_path(self.destdir, ctx.const.comar_dir))
def fetch_additionalFiles(self):
- spec = self.spec
- for pkg in spec.packages:
+ for pkg in self.spec.packages + self.spec.source:
for afile in pkg.additionalFiles:
file_name = os.path.basename(afile.filename)
dir_name = os.path.dirname(afile.filename)
@@ -456,6 +458,16 @@ class Builder:
return abandoned_files
+ def copy_additional_source_files(self):
+ # store additional files
+ for afile in self.spec.source.additionalFiles:
+ src = os.path.join(self.specdir, ctx.const.files_dir, afile.filename)
+ dest = os.path.join(self.srcDir, afile.target)
+ pisi.util.copy_file(src, dest)
+ if afile.permission:
+ # mode is octal!
+ os.chmod(dest, int(afile.permission, 8))
+
def compile_action_script(self):
"""Compiles given actions.py to check syntax error in it and sets the actionLocals and actionGlobals"""
fname = pisi.util.join_path(self.specdir, ctx.const.actions_file)
diff --git a/pisi/specfile.py b/pisi/specfile.py
index ca9e954f..edeffbac 100644
--- a/pisi/specfile.py
+++ b/pisi/specfile.py
@@ -149,7 +149,7 @@ class ComarProvide:
class Archive:
s_uri = [ autoxml.String, autoxml.mandatory ]
- a_type =[ autoxml.String, autoxml.mandatory ]
+ a_type = [ autoxml.String, autoxml.mandatory ]
a_sha1sum =[ autoxml.String, autoxml.mandatory ]
def decode_hook(self, node, errs, where):
@@ -172,6 +172,7 @@ class Source:
t_Description = [autoxml.LocalText, autoxml.optional]
t_Icon = [ autoxml.String, autoxml.optional]
t_Archive = [Archive, autoxml.mandatory ]
+ t_AdditionalFiles = [ [AdditionalFile], autoxml.optional]
t_BuildDependencies = [ [pisi.dependency.Dependency], autoxml.optional]
t_Patches = [ [Patch], autoxml.optional]
t_Version = [ autoxml.String, autoxml.optional]