]> asedeno.scripts.mit.edu Git - sipb-mirrors.git/commitdiff
Created rsync script to mirror MacPorts
authorEric Lujan <lujan@mit.edu>
Wed, 2 Mar 2016 06:04:24 +0000 (01:04 -0500)
committerLizhou Sha <slz@mit.edu>
Wed, 2 Mar 2016 06:13:57 +0000 (01:13 -0500)
Signed-off-by: Eric Lujan <lujan@mit.edu>
Signed-off-by: Lizhou Sha <slz@mit.edu>
fetch-scripts/macports [new file with mode: 0644]

diff --git a/fetch-scripts/macports b/fetch-scripts/macports
new file mode 100644 (file)
index 0000000..76cbd6d
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+RSYNCSOURCE="rsync://rsync-origin.macports.org"
+BASEDIR="$MIRRORDIR/macports"
+
+RSYNC_MODULES="packages distfiles release trunk"
+
+RSYNC_ARGS="--compress --delete-delay --hard-links --links --no-motd --perms --recursive --stats --timeout=600 --times"
+
+for RSYNC_MODULE in $RSYNC_MODULES; do
+    RSYNC_URL="${RSYNCSOURCE}/${RSYNC_MODULE}"
+    echo "Syncing $RSYNC_MODULE from $RSYNC_URL"
+    mkdir -p "${BASEDIR}/${RSYNC_MODULE}"
+    rsync $RSYNC_ARGS "$RSYNC_URL" "$BASEDIR/$RSYNC_MODULE"
+    echo
+done
+