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
|
||||
if [ ! -d "$TUNASYNC_WORKING_DIR" ]; then
|
||||
echo "Directory not exists, fail"
|
||||
exit 1
|
||||
fi
|
||||
function repo_init() {
|
||||
UPSTREAM=$1
|
||||
WORKING_DIR=$2
|
||||
git clone --mirror $UPSTREAM $WORKING_DIR
|
||||
}
|
||||
|
||||
function update_homebrew_git() {
|
||||
repo_dir="$1"
|
||||
cd $repo_dir
|
||||
echo "==== SYNC $repo_dir START ===="
|
||||
/usr/bin/timeout -s INT 3600 git remote -v update
|
||||
git repack -a -b -d
|
||||
echo "==== SYNC $repo_dir DONE ===="
|
||||
}
|
||||
|
||||
update_homebrew_git "$TUNASYNC_WORKING_DIR/homebrew.git"
|
||||
update_homebrew_git "$TUNASYNC_WORKING_DIR/homebrew-python.git"
|
||||
update_homebrew_git "$TUNASYNC_WORKING_DIR/homebrew-science.git"
|
||||
brews=("brew" "homebrew-core" "homebrew-python" "homebrew-science")
|
||||
|
||||
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
|
||||
if [ ! -d "$TUNASYNC_WORKING_DIR" ]; then
|
||||
echo "Directory not exists, fail"
|
||||
exit 1
|
||||
fi
|
||||
UPSTREAM=${TUNASYNC_UPSTREAM_URL:-"git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"}
|
||||
|
||||
function repo_init() {
|
||||
git clone --mirror $UPSTREAM $TUNASYNC_WORKING_DIR
|
||||
}
|
||||
|
||||
function update_linux_git() {
|
||||
cd $TUNASYNC_WORKING_DIR
|
||||
echo "==== SYNC linux.git START ===="
|
||||
/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
|
||||
|
Loading…
x
Reference in New Issue
Block a user