aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorFrans Meulenbroeks <fransmeulenbroeks@gmail.com>2010-09-16 22:41:39 +0200
committerFrans Meulenbroeks <fransmeulenbroeks@gmail.com>2010-09-16 22:41:39 +0200
commit4221cd0e2bfd20639a162f242675bdb564cc3fb3 (patch)
treec56849cef8c40a9ada70bfab1787881ea56e9904 /contrib
parentde694aa88cc2bde41df4edff38ca70f1c40be9ac (diff)
downloadopenembedded-4221cd0e2bfd20639a162f242675bdb564cc3fb3.tar.gz
openembedded-4221cd0e2bfd20639a162f242675bdb564cc3fb3.tar.bz2
openembedded-4221cd0e2bfd20639a162f242675bdb564cc3fb3.zip
clean-recipe: added (script to move unused patches to obsolete)
Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/clean-recipe50
1 files changed, 50 insertions, 0 deletions
diff --git a/contrib/clean-recipe b/contrib/clean-recipe
new file mode 100755
index 0000000000..8336f267ca
--- /dev/null
+++ b/contrib/clean-recipe
@@ -0,0 +1,50 @@
+#!/bin/bash
+# clean-recipe: a small shell script to clean unneeded patch/diff files from a recipe folder
+shopt -s extglob
+if [ $# -eq 0 ]
+then
+ echo "usage " $0 "[-d] recipe-dir-name"
+ exit
+fi
+delete=0
+if [ $1 = "-d" ]
+then
+ delete=1
+ shift;
+fi
+dir=$1
+if [ ! -d ${dir} ]
+then
+ echo ${dir} " is not a directory"
+ exit
+fi
+if [ ${dir} = "obsolete" -o ${dir} = "nonworking" ]
+then
+ echo skipping ${dir}
+ exit
+fi
+cd ${dir}
+moved=0
+grep -q "file://.*\\$" *.+(bb|inc) && echo "cannot handle recipes with metavariables in the name" && exit
+find -name "*.diff" -o -name "*.patch" | (while read name
+ do
+ bname=`basename ${name}`
+ dname=`dirname ${name}`
+ grep -q ${bname} *.+(bb|inc) || \
+ if [ ${delete} -eq 0 ]
+ then
+ echo ${name} " in recipe dir $dir is unused"
+ else
+ mkdir -p ../obsolete/${dir}/${dname}
+ git mv ${name} ../obsolete/${dir}/${dname}/
+ moved=1
+ fi
+ done
+ if [ ${moved} -eq 1 ]
+ then
+ for b in *.bb
+ do
+ bitbake -cpatch -b $b || echo patch failed for $b
+ done
+ echo ${dir} ": moved unused files to obsolete dir" | git commit -s -F -
+ fi )