diff --git a/scripts/android.sh b/scripts/android.sh new file mode 100755 index 0000000..bf296fe --- /dev/null +++ b/scripts/android.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +function sync_android() { + cd $TUNASYNC_WORKING_DIR + /usr/local/bin/android-repo sync +} + +sync_android diff --git a/scripts/gen_debian_exclude.py b/scripts/gen_debian_exclude.py new file mode 100644 index 0000000..e04ad24 --- /dev/null +++ b/scripts/gen_debian_exclude.py @@ -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') diff --git a/scripts/homebrew.sh b/scripts/homebrew.sh new file mode 100755 index 0000000..922d994 --- /dev/null +++ b/scripts/homebrew.sh @@ -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 diff --git a/scripts/linux.sh b/scripts/linux.sh new file mode 100755 index 0000000..8c783ed --- /dev/null +++ b/scripts/linux.sh @@ -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 diff --git a/scripts/pypi.sh b/scripts/pypi.sh new file mode 100755 index 0000000..e7b7c56 --- /dev/null +++ b/scripts/pypi.sh @@ -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 diff --git a/scripts/repo-ck.sh b/scripts/repo-ck.sh new file mode 100755 index 0000000..d8c35d2 --- /dev/null +++ b/scripts/repo-ck.sh @@ -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"