mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-04-20 04:12:42 +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
|
||||
set -e
|
||||
|
||||
REPO=${REPO:-"/usr/local/bin/repo"}
|
||||
USE_BITMAP_INDEX=${USE_BITMAPT_INDEX:-"0"}
|
||||
|
||||
function repo_init() {
|
||||
mkdir -p $TUNASYNC_WORKING_DIR
|
||||
@ -13,9 +15,25 @@ function repo_sync() {
|
||||
$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"
|
||||
repo_init
|
||||
fi
|
||||
|
||||
repo_sync
|
||||
|
||||
if [[ "$USE_BITMAP_INDEX" == "1" ]]; then
|
||||
git_repack
|
||||
do
|
||||
|
Loading…
x
Reference in New Issue
Block a user