Skip to content

Commit

Permalink
thin manifest: script which doing the Manifest cleanup
Browse files Browse the repository at this point in the history
why I wrote this script, since I don't have all the packages sources!@

the goal of this scrtipt is :
1) clean all file's checksum which already managed by git
  (means file's checksum belong to this overlay will be removed)
2) keep the source code/tarballs/patch which should fetch from external
  (means file not belong to this overlay need to be preserved)

hope I don't break anything

Signed-off-by: Lan Yixun <dennis.yxun@gmail.com>
  • Loading branch information
dlanx committed Jun 15, 2012
1 parent 49fa6da commit d333fd1
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions scripts/thin_manifest_clean.sh
@@ -0,0 +1,39 @@
#!/bin/bash

. /etc/init.d/functions.sh


OVERLAY=/var/lib/layman/gentoo-zh

einfo "clean thin Manifest"

remove() {
M=$1/Manifest
if [[ ! -e ${M} ]]; then
# ewarn "$(basename $1) not exist"
return
fi
einfo "$2: clean up: $(basename $1)"
sed -i -e '/ebuild/d' $M
sed -i -e '/metadata/d' $M
sed -i -e '/ChangeLog/d' $M

if [[ -d $1/files ]]; then
for i in $(find $1/files -type f ); do
V=${i##*\/}
sed -i -e "/${V}/d" $M
done
fi

sed -i -e '/^$/d' $M
if [[ ! -s ${M} ]]; then
# einfo "remove empty: $M"
rm $M
fi
}

C=0
for i in $(find ${OVERLAY} -maxdepth 2 -and -type d) ; do
C=$((C+1))
remove $i $C
done

0 comments on commit d333fd1

Please sign in to comment.