[unpackfs] Add settings per-item for exclude and excludeFile
- support excluding specific files / lists when rsyncing, in case the squashfs has more in it than you really want to copy over.
This commit is contained in:
parent
4552631086
commit
9d47716e5d
@ -49,7 +49,7 @@ class UnpackEntry:
|
|||||||
:param sourcefs:
|
:param sourcefs:
|
||||||
:param destination:
|
:param destination:
|
||||||
"""
|
"""
|
||||||
__slots__ = ['source', 'sourcefs', 'destination', 'copied', 'total']
|
__slots__ = ['source', 'sourcefs', 'destination', 'copied', 'total', 'exclude', 'excludeFile']
|
||||||
|
|
||||||
def __init__(self, source, sourcefs, destination):
|
def __init__(self, source, sourcefs, destination):
|
||||||
"""
|
"""
|
||||||
@ -66,6 +66,8 @@ class UnpackEntry:
|
|||||||
self.source = source
|
self.source = source
|
||||||
self.sourcefs = sourcefs
|
self.sourcefs = sourcefs
|
||||||
self.destination = destination
|
self.destination = destination
|
||||||
|
self.exclude = None
|
||||||
|
self.excludeFile = None
|
||||||
self.copied = 0
|
self.copied = 0
|
||||||
self.total = 0
|
self.total = 0
|
||||||
|
|
||||||
@ -399,6 +401,12 @@ def run():
|
|||||||
utils.debug(".. assuming that the previous targets will create that directory.")
|
utils.debug(".. assuming that the previous targets will create that directory.")
|
||||||
|
|
||||||
unpack.append(UnpackEntry(source, sourcefs, destination))
|
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
|
is_first = False
|
||||||
|
|
||||||
unpackop = UnpackOperation(unpack)
|
unpackop = UnpackOperation(unpack)
|
||||||
|
@ -23,6 +23,13 @@
|
|||||||
# empty string, which effectively is / (the root) of the target
|
# empty string, which effectively is / (the root) of the target
|
||||||
# system.
|
# 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
|
# EXAMPLES
|
||||||
#
|
#
|
||||||
# Usually you list a filesystem image to unpack; you can use
|
# Usually you list a filesystem image to unpack; you can use
|
||||||
@ -75,3 +82,7 @@ unpack:
|
|||||||
- source: ../CHANGES
|
- source: ../CHANGES
|
||||||
sourcefs: file
|
sourcefs: file
|
||||||
destination: "/tmp/changes.txt"
|
destination: "/tmp/changes.txt"
|
||||||
|
- source: src/qml/calamares/slideshow/
|
||||||
|
sourcefs: file
|
||||||
|
destination: "/tmp/"
|
||||||
|
exclude: [ "*.qmlc", "qmldir" ]
|
||||||
|
Loading…
Reference in New Issue
Block a user