From f20801229de80aba3686ed4b1683da5ae9bf8bf3 Mon Sep 17 00:00:00 2001 From: Brian Harring Date: Thu, 2 Feb 2006 12:58:20 +0000 Subject: [PATCH] optional tarsync integration; thanks to Johannes Fahrenkrug for doing the legwork. svn path=/main/trunk/; revision=2624 --- bin/emerge-webrsync | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync index f68d0265b..2173ecd95 100755 --- a/bin/emerge-webrsync +++ b/bin/emerge-webrsync @@ -51,21 +51,29 @@ fi sync_local() { echo Syncing local tree... - if ! tar jxf $FILE; then - echo "Tar failed to extract the image. Please review the output." - echo "Executed command: tar jxf $FILE" - exit 1 + if type -p tarsync &> /dev/null; then + if ! tarsync "${FILE}" "${PORTDIR}" -v -s 1 -o root -g root -e /distfiles -e /packages -e /local; then + echo "tarsync failed; tarball is corrupt?" + exit 1; + fi + rm "${FILE}" + else + if ! tar jxf $FILE; then + echo "Tar failed to extract the image. Please review the output." + echo "Executed command: tar jxf $FILE" + exit 1 + fi + rm -f $FILE + # Make sure user and group file ownership is root + chown -R 0:0 portage + cd portage + rsync -av --progress --stats --delete --delete-after \ + --exclude='/distfiles' --exclude='/packages' \ + --exclude='/local' . ${PORTDIR%%/} + cd .. + echo "cleaning up" + rm -rf portage fi - rm -f $FILE - # Make sure user and group file ownership is root - chown -R 0:0 portage - cd portage - rsync -av --progress --stats --delete --delete-after \ - --exclude='/distfiles' --exclude='/packages' \ - --exclude='/local' . ${PORTDIR%%/} - cd .. - echo "cleaning up" - rm -rf portage echo "transferring metadata/cache" emerge metadata } -- 2.26.2