-
Notifications
You must be signed in to change notification settings - Fork 1
/
validate_access.bash
51 lines (42 loc) · 929 Bytes
/
validate_access.bash
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
set -e
unshallow_list=(
"http://git.netfilter.org/ebtables"
"https://anongit.mindrot.org/openssh.git"
"https://git.tukaani.org/xz-java.git"
"https://git.tukaani.org/xz.git"
"https://git.netfilter.org/arptables"
"https://git.netfilter.org/ipset"
"https://git.netfilter.org/iptables"
)
Mercurial_list=(
"https://gmplib.org/repo/gmp"
"http://hg.nginx.org/nginx"
)
declare -A unshallow_array
declare -A Mercurial_array
for i in ${unshallow_list[*]}
do
unshallow_array[$i]=1
done
for i in ${Mercurial_list[*]}
do
Mercurial_array[$i]=1
done
for i in $(cat upstream.yaml | grep "upstream: " | awk '{print $NF}')
do
echo "Sync $i ..."
repo_name=$(echo $i | awk -F/ '{print $NF}')
rm -rf $repo_name
if [[ ${Mercurial_array[$i]} ]]
then
hg -q clone $i $repo_name
continue
fi
if [[ ${unshallow_array[$i]} ]]
then
git clone -q $i $repo_name
else
git clone -q --depth 1 $i $repo_name
fi
done