2
0
Эх сурвалжийг харах

add shell scripts for non-rsync repo

bigeagle 10 жил өмнө
parent
commit
5ef9ecd6ec

+ 8 - 0
scripts/android.sh

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

+ 11 - 0
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')

+ 12 - 0
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

+ 12 - 0
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

+ 7 - 0
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

+ 14 - 0
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"