mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-04-20 20:52:43 +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"
|
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
|
||||||
|
8
cros.sh
8
cros.sh
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user