42b5d2dd4d06 — Alain Leufroy tip 3 years ago
edit: add `--force` option

This is usefull if the unit files or mount point have been given away
for some reasons.
1 files changed, 3 insertions(+), 1 deletions(-)

M overlayctl
M overlayctl +3 -1
@@ 696,6 696,7 @@ def edit(
     prepend=(),
     append=(),
     delete=(),
+    force=False,
     interrupt: '-I' = False,
     preserve: '-P' = False,
     **globaloptions,

          
@@ 709,6 710,7 @@ def edit(
     :prepend: Prepend the following layers (can be used multiple times)
     :append: Append the following layers (can be used multiple times)
     :delete: Delete the following layers (can be used multiple times)
+    :force: Force rewriting the layer configuration even if nothing was changed.
     :interrupt: Automatically interrupt descendants to prevent broken mount point.
                 Restart them afterward.
     :preserve: Do not check if descendant overlays are started

          
@@ 743,7 745,7 @@ def edit(
                 (lower for lower in layer.lowers if lower not in deleted),
                 appended,
             )
-        if lowers == layer.lowers:
+        if not force and lowers == layer.lowers:
             return
         layer.lowers[:] = lowers
         layer.dump()