[arch-projects] [devtools] [PATCH 1/1] makechrootpkg: try to copy with hard links
From: Christian Hesse <mail@eworm.de> Using rsync for a fresh copy double the amount of used memory. Instead use cp with hard links. Signed-off-by: Christian Hesse <mail@eworm.de> --- makechrootpkg.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/makechrootpkg.in b/makechrootpkg.in index 8d8fd05..f711201 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -127,8 +127,11 @@ sync_chroot() { btrfs subvolume snapshot "$rootdir" "$copydir" >/dev/null || die "Unable to create subvolume %s" "$copydir" else - mkdir -p "$copydir" - rsync -a --delete -q -W -x "$rootdir/" "$copydir" + if [[ -e "$copydir" ]]; then + rsync -a --delete -q -W -x "$rootdir/" "$copydir/" + else + cp --archive --link "$rootdir/" "$copydir/" + fi fi stat_done
On Fri, Jul 14, 2017 at 12:04 PM Christian Hesse <list@eworm.de> wrote:
Using rsync for a fresh copy double the amount of used memory. Instead use cp with hard links.
This seems rather unsafe. Changes to files in the copydir contaminate the rootdir.
participants (2)
-
Christian Hesse
-
Jan Alexander Steffens