From d602c1d5d462100313a2c6c47434c652444ba7fd Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 30 Nov 2012 16:07:48 -0500 Subject: move librechroot's sync into it's own file for licensing reasons --- src/chroot-tools/librechroot | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) (limited to 'src/chroot-tools/librechroot') diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index d43ea2f..8e57004 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -22,34 +22,11 @@ . /etc/libretools.conf -## -# This function is almost verbatim from makechrootpkg -## -sync() { - if [[ $CHROOTCOPY = root ]]; then - error "Cannot sync the root copy with itself" - exit 1 - fi - - lock_open_read 8 "$rootdir" "Locking clean chroot" - - stat_busy 'Creating clean working copy' - local use_rsync=false - if type -P btrfs >/dev/null; then - [[ -d $copydir ]] && btrfs subvolume delete "$copydir" &>/dev/null - btrfs subvolume snapshot "$chrootdir/root" "$copydir" &>/dev/null || use_rsync=true - else - use_rsync=true - fi - - if $use_rsync; then - mkdir -p "$copydir" - rsync -a --delete -q -W -x "$CHROOTDIR/$CHROOT/root/" "$copydir" - fi - stat_done - - lock_close 8 -} +# This file (librechroot) is GPLv3+, but I would like to use some code +# modified from devtools' "makechrootpkg", which is GPLv2. +. "$(dirname "$0")/librechroot.gpl2" +# This gives us the functions: +# - sync cmd=${0##*/} usage() { -- cgit v1.2.2