.github/workflows: fix dev-util/android-studio
[gentoo-zh.git] / scripts / thin_manifest_clean.sh
bloba09a276d6913528fd5b0dd27de66c03ab8b6149d
1 #!/bin/bash
3 . /etc/init.d/functions.sh
6 OVERLAY=/var/lib/layman/gentoo-zh
8 einfo "clean thin Manifest"
10 remove() {
11 M=$1/Manifest
12 if [[ ! -e ${M} ]]; then
13 # ewarn "$(basename $1) not exist"
14 return
16 einfo "$2: clean up: $(basename $1)"
17 sed -i -e '/ebuild/d' $M
18 sed -i -e '/metadata/d' $M
19 sed -i -e '/ChangeLog/d' $M
21 if [[ -d $1/files ]]; then
22 for i in $(find $1/files -type f ); do
23 V=${i##*\/}
24 sed -i -e "/${V}/d" $M
25 done
28 sed -i -e '/^$/d' $M
29 if [[ ! -s ${M} ]]; then
30 # einfo "remove empty: $M"
31 rm $M
35 C=0
36 for i in $(find ${OVERLAY} -maxdepth 2 -and -type d) ; do
37 C=$((C+1))
38 remove $i $C
39 done