-
Notifications
You must be signed in to change notification settings - Fork 171
/
elpa.sh
executable file
·49 lines (39 loc) · 1.01 KB
/
elpa.sh
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
#!/bin/bash
# requires: rsync lftp
set -e
set -o pipefail
RSYNC_OPTS="-aHvh --no-o --no-g --stats --exclude .~tmp~/ --delete --delete-excluded --delete-after --delay-updates --safe-links --timeout=120 --contimeout=120"
USE_IPV6=${USE_IPV6:-"0"}
if [[ $USE_IPV6 == "1" ]]; then
RSYNC_OPTS="-6 ${RSYNC_OPTS}"
fi
UPSTREAMS=(
"rsync://elpa.gnu.org/elpa/"
"rsync://elpa.nongnu.org/nongnu/"
"rsync://melpa.org/packages/"
"rsync://stable.melpa.org/packages-stable/"
"rsync://elpa.gnu.org/elpa-devel/"
"rsync://elpa.nongnu.org/nongnu-devel/"
)
REPOS=(
"gnu"
"nongnu"
"melpa"
"stable-melpa"
"gnu-devel"
"nongnu-devel"
)
for I in ${!UPSTREAMS[@]}; do
upstream=${UPSTREAMS[$I]}
repo=${REPOS[$I]}
dest=${TUNASYNC_WORKING_DIR}/${repo}
[ ! -d "$dest" ] && mkdir -p "$dest"
rsync ${RSYNC_OPTS} "$upstream" "$dest"
done
org() {
dest=${TUNASYNC_WORKING_DIR}/org
[ ! -d "$dest" ] && mkdir -p "$dest"
cd $dest
lftp "https://orgmode.org/elpa/" -e 'mirror -v -P 5 --delete --no-recursion; bye'
}
org