Merging r46469 through r46494 from trunk into soc-2011-tomato
[blender.git] / extern / libmv / bundle.sh
index 9baad88a7e2a63f9d35870e4a4c2e365cef98d07..3f877508c464f13df4aaca62189f74455eb3b65e 100755 (executable)
@@ -1,14 +1,16 @@
 #!/bin/sh
 
+if [ "x$1" = "x--i-really-know-what-im-doing" ] ; then
+  echo Proceeding as requested by command line ...
+else
+  echo "*** Please run again with --i-really-know-what-im-doing ..."
+  exit 1
+fi
+
 #BRANCH="keir"
 #BRANCH="Matthias-Fauconneau"
 BRANCH="Nazg-Gul"
 
-if [ -d ./.svn ]; then
-  echo "This script is supposed to work only when using git-svn"
-  exit 1
-fi
-
 repo="git://github.com/${BRANCH}/libmv.git"
 tmp=`mktemp -d`
 
@@ -22,8 +24,10 @@ for p in `cat ./patches/series`; do
   cat ./patches/$p | patch -d $tmp/libmv -p1
 done
 
-rm -rf libmv
-rm -rf `find third_party/ -mindepth 1 -maxdepth 1 | grep -v ceres | grep -v CMake | grep -c SCons`
+find libmv -type f -not -iwholename '*.svn*' -exec rm -rf {} \;
+find third_party -type f -not -iwholename '*.svn*' -not -iwholename '*third_party/ceres*' \
+    -not -iwholename '*third_party/SConscript*' -not -iwholename '*third_party/CMakeLists.txt*' \
+    -exec rm -rf {} \;
 
 cat "files.txt" | while read f; do
   mkdir -p `dirname $f`