diff --git a/src/modules/unpackfs/main.py b/src/modules/unpackfs/main.py index 8c074738a..bfd291e3c 100644 --- a/src/modules/unpackfs/main.py +++ b/src/modules/unpackfs/main.py @@ -49,7 +49,7 @@ class UnpackEntry: :param sourcefs: :param destination: """ - __slots__ = ['source', 'sourcefs', 'destination', 'copied', 'total'] + __slots__ = ['source', 'sourcefs', 'destination', 'copied', 'total', 'exclude', 'excludeFile'] def __init__(self, source, sourcefs, destination): """ @@ -66,6 +66,8 @@ class UnpackEntry: self.source = source self.sourcefs = sourcefs self.destination = destination + self.exclude = None + self.excludeFile = None self.copied = 0 self.total = 0 @@ -399,6 +401,12 @@ def run(): utils.debug(".. assuming that the previous targets will create that directory.") unpack.append(UnpackEntry(source, sourcefs, destination)) + # Optional settings + if entry.get("exclude", None): + unpack[-1].exclude = entry["exclude"] + if entry.get("excludeFile", None): + unpack[-1].excludeFile = entry["excludeFile"] + is_first = False unpackop = UnpackOperation(unpack) diff --git a/src/modules/unpackfs/unpackfs.conf b/src/modules/unpackfs/unpackfs.conf index 96f628c11..98569b477 100644 --- a/src/modules/unpackfs/unpackfs.conf +++ b/src/modules/unpackfs/unpackfs.conf @@ -23,6 +23,13 @@ # empty string, which effectively is / (the root) of the target # system. # +# Each list item **optionally** can include the following attributes: +# - *exclude* is a list of values that is expanded into --exclude +# arguments for rsync (each entry in exclude gets its own --exclude). +# - *excludeFile* is a single file that is passed to rsync as an +# --exclude-file argument. This should be a full pathname +# inside the **host** filesystem. +# # EXAMPLES # # Usually you list a filesystem image to unpack; you can use @@ -75,3 +82,7 @@ unpack: - source: ../CHANGES sourcefs: file destination: "/tmp/changes.txt" + - source: src/qml/calamares/slideshow/ + sourcefs: file + destination: "/tmp/" + exclude: [ "*.qmlc", "qmldir" ]