summaryrefslogtreecommitdiffstats
path: root/modules/ports/drivers/hg
blob: 776cb89863fb65c478207b481004c8687a572970 (plain)
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
#!/bin/sh
#
# /etc/ports/drivers/hg: mercurial driver script for ports(8)
# 

if [ $# -ne 1 ]; then
        echo "usage: $0 <file>" >&2
        exit 1
fi

. $1

if [ -z "$ROOT_DIR" ]; then
	echo "ROOT_DIR not set in '$1'" >&2
	exit 2
fi
if [ -z "$URL" ]; then
	echo "URL not set in '$1'" >&2
	exit 2
fi

for REPO in $URL; do
    PORT=`echo $REPO | sed -n '/#.*$/s|^.*#||p'`
    hg -v clone $REPO $ROOT_DIR/$PORT
done

# End of file.