mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-04-20 12:42:50 +00:00
calculate the size of AOSP and chromiumos
This commit is contained in:
parent
f34df2f0ff
commit
9514244be9
8
aosp.sh
8
aosp.sh
@ -20,9 +20,9 @@ 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
|
||||
size=$(du -sk .|cut -f1)
|
||||
total_size=$(($total_size+1024*$sz))
|
||||
if [[ "$size" -gt "100000" ]]; then
|
||||
git repack -a -b -d
|
||||
fi
|
||||
done < <(find $TUNASYNC_WORKING_DIR -type d -not -path "*/.repo/*" -name "*.git")
|
||||
@ -35,6 +35,8 @@ fi
|
||||
|
||||
repo_sync
|
||||
|
||||
total_size=0
|
||||
if [[ "$USE_BITMAP_INDEX" == "1" ]]; then
|
||||
git_repack
|
||||
echo "Total size is" $(numfmt --to=iec $total_size)
|
||||
fi
|
||||
|
8
cros.sh
8
cros.sh
@ -39,9 +39,9 @@ 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
|
||||
size=$(du -sk .|cut -f1)
|
||||
total_size=$(($total_size+1024*$sz))
|
||||
if [[ "$size" -gt "100000" ]]; then
|
||||
git repack -a -b -d
|
||||
fi
|
||||
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
|
||||
|
||||
total_size=0
|
||||
if [[ -z ${DRY_RUN:-} && "$USE_BITMAP_INDEX" == "1" ]]; then
|
||||
git_repack
|
||||
echo "Total size is" $(numfmt --to=iec $total_size)
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user