aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2009-05-03 21:32:28 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2009-05-03 21:32:28 +0000
commit222d797e78fbbda8ab9815d58f941cddef425dcd (patch)
tree7936cf0ed1d190b1d7e1c5c53a0306145759d06f
parent2b2b69dc3f529947a9852619fd8ba68eb06a8006 (diff)
downloadsimplepkg-222d797e78fbbda8ab9815d58f941cddef425dcd.tar.gz
simplepkg-222d797e78fbbda8ab9815d58f941cddef425dcd.tar.bz2
improved enable-mkbuild-section
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@807 04377dda-e619-0410-9926-eae83683ac58
-rwxr-xr-xtrunk/utils/enable-mkbuild-section32
1 files changed, 18 insertions, 14 deletions
diff --git a/trunk/utils/enable-mkbuild-section b/trunk/utils/enable-mkbuild-section
index 0889f1a..17efd77 100755
--- a/trunk/utils/enable-mkbuild-section
+++ b/trunk/utils/enable-mkbuild-section
@@ -17,24 +17,28 @@
#
CWD="`pwd`"
-BASE="/path/to/mkbuilds"
-MATCH="SLACK REQUIRED" # example parameter
-ADD_BEFORE="on: build_package" # example section
-INCLUDE=" on: slack-required" # example section
+BASE="/data/projetos/code/mkbuilds"
+MATCH=": manifest_check" # example parameter
+ADD_BEFORE=": untar_source" # example section
+INCLUDE=" on: manifest_check" # example section
cd $BASE
-FILES="`grep -R "$MATCH" * | grep -v .svn | grep -v '""' | cut -d : -f 1`"
+FILES="` grep -l -R -L -e "$MATCH" * | grep -v .svn`" # match criteria
+#FILES="`grep -R "$MATCH" * | grep -v .svn | grep -v '""' | cut -d : -f 1 | uniq`" # unmatch criteria
for file in $FILES; do
- LINES="`wc -l $file | awk '{ print $1 }'`"
- CENTER="`sed = $file | sed 'N;s/\n/\t/' | grep "$ADD_BEFORE" | awk '{ print $1 }'`"
- CENTER="`echo $(($CENTER -1))`"
- END="`echo $(($LINES - $CENTER))`"
- head -n $CENTER $file > $file.new
- echo "$INCLUDE" >> $file.new
- tail -n $END $file >> $file.new
- cat $file.new > $file
- rm $file.new
+ if [ "`basename $file .mkbuild`" != "`basename $file`" ]; then
+ echo processing $file
+ LINES="`wc -l $file | awk '{ print $1 }'`"
+ CENTER="`sed = $file | sed 'N;s/\n/\t/' | grep "$ADD_BEFORE" | awk '{ print $1 }'`"
+ CENTER="`echo $(($CENTER -1))`"
+ END="`echo $(($LINES - $CENTER))`"
+ head -n $CENTER $file > $file.new
+ echo "$INCLUDE" >> $file.new
+ tail -n $END $file >> $file.new
+ cat $file.new > $file
+ rm $file.new
+ fi
done
cd $CWD