From 9a33fabd5176ba2b9b944bb7272a5cdf9fb9a5cc Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Thu, 15 Jul 2021 21:21:28 +0000 Subject: [PATCH] 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. --- assemblers/org.osbuild.ostree.commit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assemblers/org.osbuild.ostree.commit b/assemblers/org.osbuild.ostree.commit index 83850f7d..1b5c9fb9 100755 --- a/assemblers/org.osbuild.ostree.commit +++ b/assemblers/org.osbuild.ostree.commit @@ -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)