diff options
-rwxr-xr-x | bin/emerge-webrsync | 36 |
1 files 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 } |