assembler/ostree.commit: fix copying of links

Commit 92cc269 fixed a bug where `/var` was copied into `/var`
resulting in `/var/var`. Sadly the fix broke copying links,
like `bin -> usr/bin`, where now the content of the link would
be copied but not the link itself. Use the `-t` command line
flag for `cp` which should ensure that we copy links as links
but also copy the contents for `/var` should the target dir,
i.e. `/var` already exist.
This commit is contained in:
Christian Kellner 2021-07-15 21:21:28 +00:00 committed by Ondřej Budai
parent e8bf211e0c
commit 9a33fabd51

View file

@ -81,8 +81,8 @@ TOPLEVEL_LINKS = {
def copy(name, source, dest):
subprocess.run(["cp", "--reflink=auto", "-a",
os.path.join(source, name, "."),
os.path.join(dest, name)],
os.path.join(source, name),
"-t", os.path.join(dest)],
check=True)