summaryrefslogtreecommitdiff
path: root/src/chroot-tools/librechroot
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2012-11-30 16:07:48 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2012-11-30 16:07:48 -0500
commitd602c1d5d462100313a2c6c47434c652444ba7fd (patch)
tree667478e647baa695dff1cc61074799d4153dea55 /src/chroot-tools/librechroot
parentaa8b0eee0187ca3e2ae1b8ecdad651f4846d4049 (diff)
move librechroot's sync into it's own file for licensing reasons
Diffstat (limited to 'src/chroot-tools/librechroot')
-rwxr-xr-xsrc/chroot-tools/librechroot33
1 files changed, 5 insertions, 28 deletions
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() {