mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-06-30 23:12:45 +00:00
update linux.git and homebrew scripts
This commit is contained in:
parent
b504b7d218
commit
8357f38d26
22
homebrew.sh
22
homebrew.sh
@ -1,17 +1,25 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
if [ ! -d "$TUNASYNC_WORKING_DIR" ]; then
|
function repo_init() {
|
||||||
echo "Directory not exists, fail"
|
UPSTREAM=$1
|
||||||
exit 1
|
WORKING_DIR=$2
|
||||||
fi
|
git clone --mirror $UPSTREAM $WORKING_DIR
|
||||||
|
}
|
||||||
|
|
||||||
function update_homebrew_git() {
|
function update_homebrew_git() {
|
||||||
repo_dir="$1"
|
repo_dir="$1"
|
||||||
cd $repo_dir
|
cd $repo_dir
|
||||||
echo "==== SYNC $repo_dir START ===="
|
echo "==== SYNC $repo_dir START ===="
|
||||||
/usr/bin/timeout -s INT 3600 git remote -v update
|
/usr/bin/timeout -s INT 3600 git remote -v update
|
||||||
|
git repack -a -b -d
|
||||||
echo "==== SYNC $repo_dir DONE ===="
|
echo "==== SYNC $repo_dir DONE ===="
|
||||||
}
|
}
|
||||||
|
|
||||||
update_homebrew_git "$TUNASYNC_WORKING_DIR/homebrew.git"
|
brews=("brew" "homebrew-core" "homebrew-python" "homebrew-science")
|
||||||
update_homebrew_git "$TUNASYNC_WORKING_DIR/homebrew-python.git"
|
|
||||||
update_homebrew_git "$TUNASYNC_WORKING_DIR/homebrew-science.git"
|
for brew in ${brews[@]}; do
|
||||||
|
if [[ ! -d "$TUNASYNC_WORKING_DIR/${brew}.git" ]]; then
|
||||||
|
echo "Initializing ${brew}.git"
|
||||||
|
repo_init "https://github.com/Homebrew/${brew}.git" "$TUNASYNC_WORKING_DIR/${brew}.git"
|
||||||
|
fi
|
||||||
|
update_homebrew_git "$TUNASYNC_WORKING_DIR/${brew}.git"
|
||||||
|
done
|
||||||
|
17
linux.sh
17
linux.sh
@ -1,12 +1,21 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
if [ ! -d "$TUNASYNC_WORKING_DIR" ]; then
|
UPSTREAM=${TUNASYNC_UPSTREAM_URL:-"git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"}
|
||||||
echo "Directory not exists, fail"
|
|
||||||
exit 1
|
function repo_init() {
|
||||||
fi
|
git clone --mirror $UPSTREAM $TUNASYNC_WORKING_DIR
|
||||||
|
}
|
||||||
|
|
||||||
function update_linux_git() {
|
function update_linux_git() {
|
||||||
cd $TUNASYNC_WORKING_DIR
|
cd $TUNASYNC_WORKING_DIR
|
||||||
|
echo "==== SYNC linux.git START ===="
|
||||||
/usr/bin/timeout -s INT 3600 git remote -v update
|
/usr/bin/timeout -s INT 3600 git remote -v update
|
||||||
|
git repack -a -b -d
|
||||||
|
echo "==== SYNC linux.git DONE ===="
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [[ ! -d "$TUNASYNC_WORKING_DIR" ]]; then
|
||||||
|
echo "Initializing Linux.git mirror"
|
||||||
|
repo_init
|
||||||
|
fi
|
||||||
|
|
||||||
update_linux_git
|
update_linux_git
|
||||||
|
Loading…
x
Reference in New Issue
Block a user