add shell scripts for non-rsync repo

This commit is contained in:
bigeagle 2014-11-22 19:30:51 +08:00
parent 680940dfe3
commit 5ef9ecd6ec
6 changed files with 64 additions and 0 deletions

8
scripts/android.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
function sync_android() {
cd $TUNASYNC_WORKING_DIR
/usr/local/bin/android-repo sync
}
sync_android

View File

@ -0,0 +1,11 @@
#!/usr/bin/env python
ARCH_EXCLUDE = ['armel', 'arm64', 'alpha', 'hurd-i386', 'ia64', 'kfreebsd-amd64', 'kfreebsd-i386', 'mips', 'powerpc', 'ppc64el', 's390', 's390x', 'sparc']
CONTENT_EXCLUDE = ['binary-{arch}', 'installer-{arch}', 'Contents-{arch}.gz', 'Contents-udeb-{arch}.gz', 'Contents-{arch}.diff', 'arch-{arch}.files', 'arch-{arch}.list.gz', '*_{arch}.deb', '*_{arch}.udeb', '*_{arch}.changes']
with open("debian-exclude.txt", 'wb') as f:
for arch in ARCH_EXCLUDE:
for content in CONTENT_EXCLUDE:
f.write(content.format(arch=arch))
f.write('\n')

12
scripts/homebrew.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
if [ ! -d "$TUNASYNC_WORKING_DIR" ]; then
echo "Directory not exists, fail"
exit 1
fi
function update_homebrew_git() {
cd $TUNASYNC_WORKING_DIR
git remote -v update
}
update_homebrew_git

12
scripts/linux.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
if [ ! -d "$TUNASYNC_WORKING_DIR" ]; then
echo "Directory not exists, fail"
exit 1
fi
function update_linux_git() {
cd $TUNASYNC_WORKING_DIR
git remote -v update
}
update_linux_git

7
scripts/pypi.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
if [ ! -d "$TUNASYNC_WORKING_DIR" ]; then
echo "Directory not exists, fail"
exit 1
fi
/usr/bin/timeout -s INT 3600 /home/tuna/.virtualenvs/bandersnatch/bin/bandersnatch -c /etc/bandersnatch.conf mirror || exit 1

14
scripts/repo-ck.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
function sync_repo_ck() {
repo_url="$1"
repo_dir="$2"
[ ! -d "$repo_dir" ] && mkdir -p "$repo_dir"
cd $repo_dir
lftp "${repo_url}/" -e 'mirror -v -P 5 --delete --only-missing --only-newer --no-recursion; bye'
wget "${repo_url}/repo-ck.db" -O "repo-ck.db"
}
sync_repo_ck "${TUNASYNC_UPSTREAM_URL}/x86_64" "${TUNASYNC_WORKING_DIR}/x86_64"
sync_repo_ck "${TUNASYNC_UPSTREAM_URL}/i686" "${TUNASYNC_WORKING_DIR}/i686"