mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-04-19 11:42:43 +00:00
update pypi.sh and termux.sh
This commit is contained in:
parent
5406a0bc92
commit
5975d7c5d5
34
pypi.sh
34
pypi.sh
@ -1,9 +1,37 @@
|
||||
#!/bin/bash
|
||||
BANDERSNATCH=${BANDERSNATCH:-"/usr/local/bin/bandersnatch"}
|
||||
CONF="/tmp/bandersnatch.conf"
|
||||
INIT=${INIT:-"0"}
|
||||
|
||||
if [ ! -d "$TUNASYNC_WORKING_DIR" ]; then
|
||||
echo "Directory not exists, fail"
|
||||
exit 1
|
||||
mkdir -p $TUNASYNC_WORKING_DIR
|
||||
INIT="1"
|
||||
fi
|
||||
|
||||
echo "Syncing to $TUNASYNC_WORKING_DIR"
|
||||
|
||||
/usr/bin/timeout -s INT 3600 /home/tuna/.virtualenvs/bandersnatch/bin/bandersnatch -c /etc/bandersnatch.conf mirror || exit 1
|
||||
if [[ $INIT == "0" ]]; then
|
||||
cat > $CONF << EOF
|
||||
[mirror]
|
||||
directory = ${TUNASYNC_WORKING_DIR}
|
||||
master = https://pypi.python.org
|
||||
timeout = 15
|
||||
workers = 10
|
||||
stop-on-error = true
|
||||
delete-packages = true
|
||||
EOF
|
||||
/usr/bin/timeout -s INT 7200 $BANDERSNATCH -c $CONF mirror || exit 1
|
||||
|
||||
else
|
||||
cat > $CONF << EOF
|
||||
[mirror]
|
||||
directory = ${TUNASYNC_WORKING_DIR}
|
||||
master = https://pypi.python.org
|
||||
timeout = 15
|
||||
workers = 10
|
||||
stop-on-error = false
|
||||
delete-packages = false
|
||||
EOF
|
||||
|
||||
$BANDERSNATCH -c $CONF mirror || exit 1
|
||||
fi
|
||||
|
@ -7,10 +7,13 @@ _here=`dirname $(realpath $0)`
|
||||
|
||||
BASE_PATH="${TUNASYNC_WORKING_DIR}"
|
||||
|
||||
base_url="http://apt.termux.com"
|
||||
base_url=${TUNASYNC_UPSTREAM_URL:-"http://termux.net"}
|
||||
|
||||
ARCHES=("aarch64" "all" "arm" "i686")
|
||||
|
||||
for arch in ${ARCHES[@]}; do
|
||||
echo "start syncing: ${arch}"
|
||||
apt-download-binary "${base_url}" "stable" "main" "${arch}" "${BASE_PATH}" || true
|
||||
done
|
||||
|
||||
echo "finished"
|
||||
|
Loading…
x
Reference in New Issue
Block a user