calculate the size of AOSP and chromiumos

This commit is contained in:
z4yx 2020-03-20 17:08:24 +08:00
parent f34df2f0ff
commit 9514244be9
2 changed files with 10 additions and 6 deletions

View File

@ -20,9 +20,9 @@ function git_repack() {
echo "Start writing bitmap index" echo "Start writing bitmap index"
while read repo; do while read repo; do
cd $repo cd $repo
size=$(du -sm .|cut -f1) size=$(du -sk .|cut -f1)
if [[ "$size" -gt "100" ]]; then total_size=$(($total_size+1024*$sz))
echo $repo, ${size}M if [[ "$size" -gt "100000" ]]; then
git repack -a -b -d git repack -a -b -d
fi fi
done < <(find $TUNASYNC_WORKING_DIR -type d -not -path "*/.repo/*" -name "*.git") done < <(find $TUNASYNC_WORKING_DIR -type d -not -path "*/.repo/*" -name "*.git")
@ -35,6 +35,8 @@ fi
repo_sync repo_sync
total_size=0
if [[ "$USE_BITMAP_INDEX" == "1" ]]; then if [[ "$USE_BITMAP_INDEX" == "1" ]]; then
git_repack git_repack
echo "Total size is" $(numfmt --to=iec $total_size)
fi fi

View File

@ -39,9 +39,9 @@ function git_repack() {
echo "Start writing bitmap index" echo "Start writing bitmap index"
while read repo; do while read repo; do
cd $repo cd $repo
size=$(du -sm .|cut -f1) size=$(du -sk .|cut -f1)
if [[ "$size" -gt "100" ]]; then total_size=$(($total_size+1024*$sz))
echo $repo, ${size}M if [[ "$size" -gt "100000" ]]; then
git repack -a -b -d git repack -a -b -d
fi fi
done < <(find $TUNASYNC_WORKING_DIR -not -path "$MANIFEST_DIR/.git/*" -type f -name HEAD -exec dirname '{}' ';') done < <(find $TUNASYNC_WORKING_DIR -not -path "$MANIFEST_DIR/.git/*" -type f -name HEAD -exec dirname '{}' ';')
@ -70,6 +70,8 @@ done
wait # wait for all background jobs wait # wait for all background jobs
total_size=0
if [[ -z ${DRY_RUN:-} && "$USE_BITMAP_INDEX" == "1" ]]; then if [[ -z ${DRY_RUN:-} && "$USE_BITMAP_INDEX" == "1" ]]; then
git_repack git_repack
echo "Total size is" $(numfmt --to=iec $total_size)
fi fi