mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-04-20 04:12:42 +00:00
OSError: [Errno 36] Filename too long: '/data/mirrors/pypi/web/packages/74/b6/d3fe5583d610652a0ce8613b05922b62a1fab89a4804eb8977f8ff2b2814/.uselesscapitalquiz-3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593-py3-none-any.whl.ltdmxtek' Related to https://github.com/tuna/issues/issues/1538
72 lines
1.3 KiB
Bash
Executable File
72 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
BANDERSNATCH=${BANDERSNATCH:-"/usr/local/bin/bandersnatch"}
|
|
PYPI_MASTER="https://pypi.org/"
|
|
TUNASYNC_UPSTREAM=${TUNASYNC_UPSTREAM_URL:-$PYPI_MASTER}
|
|
CONF="/tmp/bandersnatch.conf"
|
|
INIT=${INIT:-"0"}
|
|
|
|
if [ ! -d "$TUNASYNC_WORKING_DIR" ]; then
|
|
mkdir -p $TUNASYNC_WORKING_DIR
|
|
INIT="1"
|
|
fi
|
|
|
|
echo "Syncing to $TUNASYNC_WORKING_DIR"
|
|
|
|
DOWNLOAD_MIRROR=""
|
|
if [[ $TUNASYNC_UPSTREAM != $PYPI_MASTER ]]; then
|
|
# see https://github.com/pypa/bandersnatch/pull/928 for more info
|
|
DOWNLOAD_MIRROR="download-mirror = ${TUNASYNC_UPSTREAM}"
|
|
fi
|
|
|
|
if [[ $INIT == "0" ]]; then
|
|
(
|
|
cat << EOF
|
|
[mirror]
|
|
directory = ${TUNASYNC_WORKING_DIR}
|
|
master = ${PYPI_MASTER}
|
|
${DOWNLOAD_MIRROR}
|
|
json = true
|
|
timeout = 300
|
|
workers = 5
|
|
hash-index = false
|
|
stop-on-error = false
|
|
delete-packages = true
|
|
compare-method = stat
|
|
|
|
[plugins]
|
|
enabled =
|
|
blocklist_project
|
|
|
|
[blocklist]
|
|
packages =
|
|
tf-nightly-gpu
|
|
tf-nightly
|
|
tensorflow-io-nightly
|
|
tf-nightly-cpu
|
|
pyagrum-nightly
|
|
uselesscapitalquiz
|
|
EOF
|
|
for i in $PYPI_EXCLUDE; do
|
|
echo " $i"
|
|
done
|
|
) > $CONF
|
|
exec $BANDERSNATCH -c $CONF mirror
|
|
else
|
|
cat > $CONF << EOF
|
|
[mirror]
|
|
directory = ${TUNASYNC_WORKING_DIR}
|
|
master = ${PYPI_MASTER}
|
|
${DOWNLOAD_MIRROR}
|
|
json = true
|
|
timeout = 15
|
|
workers = 10
|
|
hash-index = false
|
|
stop-on-error = false
|
|
delete-packages = false
|
|
EOF
|
|
|
|
exec $BANDERSNATCH -c $CONF mirror
|
|
fi
|
|
|