-
-
Notifications
You must be signed in to change notification settings - Fork 236
/
mprsyncup
37 lines (32 loc) · 1.18 KB
/
mprsyncup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
# fkr, jberry, yeled
# checks out both HEAD and then the svn url specified in $RELEASE_URL_FILE
# made for sampson 2006-08-30
# TODO should clean up after itself.
# TODO shouldn't refer to the Tag as "dp1.0"
set -e
SVN=/usr/bin/svn
DPROOT="/Volumes/src2/darwinports"
REPO_BASE=http://svn.macports.org/repository/macports
RELEASE_URL_FILE="base/config/RELEASE_URL"
# Check out HEAD
TMPDIR=dp
if [ -d ${DPROOT}/${TMPDIR}.tmp ]; then
$SVN update ${DPROOT}/${TMPDIR}.tmp
else
$SVN checkout ${REPO_BASE}/trunk ${DPROOT}/${TMPDIR}.tmp
fi
rsync -q --exclude=.svn -a --delete ${DPROOT}/${TMPDIR}.tmp/ ${DPROOT}/${TMPDIR}/
echo `date -u +%s` > ${DPROOT}/${TMPDIR}/TIMESTAMP
# Extract the release URL from HEAD
read RELEASE_URL < ${DPROOT}/${TMPDIR}/${RELEASE_URL_FILE}
[ -n "${RELEASE_URL}" ] || { echo "no RELEASE_URL specified in svn HEAD" ; exit 1 }
# Checkout from the release tag specified in HEAD
TMPDIR=dp1.0
if [ -d ${DPROOT}/${TMPDIR}.tmp ]; then
$SVN switch ${RELEASE_URL} ${DPROOT}/${TMPDIR}.tmp
else
$SVN checkout ${RELEASE_URL} ${DPROOT}/${TMPDIR}.tmp
fi
rsync -q --exclude=.svn -a --delete ${DPROOT}/${TMPDIR}.tmp/ ${DPROOT}/${TMPDIR}/
echo `date -u +%s` > ${DPROOT}/${TMPDIR}/TIMESTAMP