mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-04-20 12:24:12 +00:00
aosp bitmap index
This commit is contained in:
parent
b2fc0ebd33
commit
41e933da6a
20
aosp.sh
20
aosp.sh
@ -1,6 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
REPO=${REPO:-"/usr/local/bin/repo"}
|
REPO=${REPO:-"/usr/local/bin/repo"}
|
||||||
|
USE_BITMAP_INDEX=${USE_BITMAPT_INDEX:-"0"}
|
||||||
|
|
||||||
function repo_init() {
|
function repo_init() {
|
||||||
mkdir -p $TUNASYNC_WORKING_DIR
|
mkdir -p $TUNASYNC_WORKING_DIR
|
||||||
@ -13,9 +15,25 @@ function repo_sync() {
|
|||||||
$REPO sync -f
|
$REPO sync -f
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ ! -d "$TUNASYNC_WORKING_DIR/git-repo.git" ]; then
|
function git_repack() {
|
||||||
|
echo "Start writing bitmap index"
|
||||||
|
while read repo; do
|
||||||
|
cd $repo
|
||||||
|
size=$(du -sm .|cut -f1)
|
||||||
|
if [[ "$size" -gt "100" ]]; then
|
||||||
|
echo $repo, ${size}M
|
||||||
|
git repack -a -b -d
|
||||||
|
fi
|
||||||
|
done < <$(find $TUNASYNC_WORKING_DIR -type d -not -path "*/.repo/*" -name "*.git")
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ ! -d "$TUNASYNC_WORKING_DIR/git-repo.git" ]]; then
|
||||||
echo "Initializing AOSP mirror"
|
echo "Initializing AOSP mirror"
|
||||||
repo_init
|
repo_init
|
||||||
fi
|
fi
|
||||||
|
|
||||||
repo_sync
|
repo_sync
|
||||||
|
|
||||||
|
if [[ "$USE_BITMAP_INDEX" == "1" ]]; then
|
||||||
|
git_repack
|
||||||
|
do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user