File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -e
3
3
BANDERSNATCH=${BANDERSNATCH:- " /usr/local/bin/bandersnatch" }
4
- TUNASYNC_UPSTREAM=${TUNASYNC_UPSTREAM_URL:- " https://pypi.org/" }
4
+ PYPI_MASTER=" https://pypi.org/"
5
+ TUNASYNC_UPSTREAM=${TUNASYNC_UPSTREAM_URL:- $PYPI_MASTER }
5
6
CONF=" /tmp/bandersnatch.conf"
6
7
INIT=${INIT:- " 0" }
7
8
12
13
13
14
echo " Syncing to $TUNASYNC_WORKING_DIR "
14
15
16
+ DOWNLOAD_MIRROR=" "
17
+ if [[ $TUNASYNC_UPSTREAM != $PYPI_MASTER ]]; then
18
+ # see https://github.com/pypa/bandersnatch/pull/928 for more info
19
+ DOWNLOAD_MIRROR=" download-mirror = ${TUNASYNC_UPSTREAM} "
20
+ fi
21
+
15
22
if [[ $INIT == " 0" ]]; then
16
23
(
17
24
cat << EOF
18
25
[mirror]
19
26
directory = ${TUNASYNC_WORKING_DIR}
20
- master = ${TUNASYNC_UPSTREAM}
27
+ master = ${PYPI_MASTER}
28
+ ${DOWNLOAD_MIRROR}
21
29
json = true
22
30
timeout = 300
23
31
workers = 5
47
55
cat > $CONF << EOF
48
56
[mirror]
49
57
directory = ${TUNASYNC_WORKING_DIR}
50
- master = ${TUNASYNC_UPSTREAM}
58
+ master = ${PYPI_MASTER}
59
+ ${DOWNLOAD_MIRROR}
51
60
json = true
52
61
timeout = 15
53
62
workers = 10
You can’t perform that action at this time.
0 commit comments