summaryrefslogtreecommitdiffstats
path: root/syncrepo
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-01-23 23:07:19 +0100
committerFlorian Pritz <bluewind@xinu.at>2013-01-23 23:07:19 +0100
commit0e74baf1add9e7fea3d07e1c79af88831fc5d5f3 (patch)
tree0be54f1bea13a4bbbf9d38ed7a5d35d33c749d60 /syncrepo
parent7793b6247208cc8b1201ba0335ca9a4ead4cafbe (diff)
downloadrepo-tools-0e74baf1add9e7fea3d07e1c79af88831fc5d5f3.tar.gz
repo-tools-0e74baf1add9e7fea3d07e1c79af88831fc5d5f3.tar.xz
syncrepo: check repo_mtime fileworking
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'syncrepo')
-rwxr-xr-xsyncrepo5
1 files changed, 5 insertions, 0 deletions
diff --git a/syncrepo b/syncrepo
index 7d249da..ddc2cff 100755
--- a/syncrepo
+++ b/syncrepo
@@ -5,6 +5,7 @@ target="${home}/repo"
tmp="${home}/tmp"
lock='/tmp/mirrorsync.lck'
source='pkgbuild.com::packages/'
+repo_mtime_url="http://rsync.archlinux.org/repo_mtime"
[ ! -d "${target}" ] && mkdir -p "${target}"
[ ! -d "${tmp}" ] && mkdir -p "${tmp}"
@@ -12,6 +13,10 @@ source='pkgbuild.com::packages/'
touch "${lock}"
trap "rm -f '${lock}'" EXIT INT TERM
+if diff -b <(curl -s "$repo_mtime_url") "$target/repo_mtime" >/dev/null; then
+ exit 0
+fi
+
rsync -rtlvH --safe-links --delete-after --progress -h \
--delay-updates --no-motd --bwlimit=1000 \
--temp-dir="${tmp}" \