[llvm-commits] [PATCH] Improved svn repo searching for 'make update'

Edwin Vane edwin.vane at intel.com
Sun Jan 27 19:12:48 PST 2013


  Original solution didn't work with bourne shell. New solution works for bourne and bash.

Hi bkramer, echristo,

http://llvm-reviews.chandlerc.com/D326

CHANGE SINCE LAST DIFF
  http://llvm-reviews.chandlerc.com/D326?vs=759&id=782#toc

BRANCH
  update_fix

ARCANIST PROJECT
  llvm

Files:
  Makefile

Index: Makefile
===================================================================
--- Makefile
+++ Makefile
@@ -248,13 +248,26 @@
 SVN = svn
 SVN-UPDATE-OPTIONS =
 AWK = awk
-SUB-SVN-DIRS = $(AWK) '/I|\?      / {print $$2}'   \
-		| LC_ALL=C xargs $(SVN) info 2>/dev/null \
-		| $(AWK) '/^Path:\ / {print $$2}'
+
+# Multiline variable defining a recursive function for finding svn repos rooted at
+# a given path. svnup() requires one argument: the root to search from.
+define SUB_SVN_DIRS
+svnup() {
+  dirs=`svn status --no-ignore $$1 | awk '/I|\?      / {print $$2}' | LC_ALL=C xargs svn info 2>/dev/null | awk '/^Path:\ / {print $$2}'`;
+  if [ "$$dirs" = "" ]; then
+    return;
+  fi;
+  for f in $$dirs; do
+	  echo $$f;
+    svnup $$f;
+  done
+}
+endef
+export SUB_SVN_DIRS
 
 update:
 	$(SVN) $(SVN-UPDATE-OPTIONS) update $(LLVM_SRC_ROOT)
-	@ $(SVN) status --no-ignore $(LLVM_SRC_ROOT) | $(SUB-SVN-DIRS) | xargs $(SVN) $(SVN-UPDATE-OPTIONS) update
+	@eval $$SUB_SVN_DIRS; $(SVN) status --no-ignore $(LLVM_SRC_ROOT) | svnup $(LLVM_SRC_ROOT) | xargs $(SVN) $(SVN-UPDATE-OPTIONS) update
 
 happiness: update all check-all
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D326.2.patch
Type: text/x-patch
Size: 1134 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130127/67da89d3/attachment.bin>


More information about the llvm-commits mailing list