optional tarsync integration; thanks to Johannes Fahrenkrug for doing the legwork.
authorBrian Harring <ferringb@gentoo.org>
Thu, 2 Feb 2006 12:58:20 +0000 (12:58 -0000)
committerBrian Harring <ferringb@gentoo.org>
Thu, 2 Feb 2006 12:58:20 +0000 (12:58 -0000)
svn path=/main/trunk/; revision=2624

bin/emerge-webrsync

index f68d0265b8ba2bc316c503a79d9e1dd57bd1b992..2173ecd952e6aac1dd728740a0a06bf5cebfdf35 100755 (executable)
@@ -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
 }