[csw-devel] SF.net SVN: gar:[10018] csw/mgar/gar/v2/gar.mk

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Thu May 27 16:06:33 CEST 2010


Revision: 10018
          http://gar.svn.sourceforge.net/gar/?rev=10018&view=rev
Author:   bdwalton
Date:     2010-05-27 14:06:33 +0000 (Thu, 27 May 2010)

Log Message:
-----------
gar/v2: add robustness to git/makepatch when no extracted sources

Modified Paths:
--------------
    csw/mgar/gar/v2/gar.mk

Modified: csw/mgar/gar/v2/gar.mk
===================================================================
--- csw/mgar/gar/v2/gar.mk	2010-05-27 13:51:42 UTC (rev 10017)
+++ csw/mgar/gar/v2/gar.mk	2010-05-27 14:06:33 UTC (rev 10018)
@@ -425,11 +425,13 @@
 	@$(MAKECOOKIE)
 
 post-extract-gitsnap: $(EXTRACT_TARGETS)
-	@echo ' ==> Snapshotting extracted source tree with git'
-	@( cd $(WORKSRC); git init; git add .; \
+	@( if [ -d "$(WORKSRC)" ]; then \
+		echo ' ==> Snapshotting extracted source tree with git'; \
+		cd $(WORKSRC); git init; git add .; \
 		git commit -m "Upstream $(GARVERSION)"; \
 		git tag -am "Upstream $(GARVERSION)" upstream-$(GARVERSION); \
-		git checkout -b csw )
+		git checkout -b csw; \
+	   fi )
 	@$(MAKECOOKIE)
 
 # returns true if extract has completed successfully, false
@@ -459,8 +461,12 @@
 	@$(foreach COOKIEFILE,$(PATCH_TARGETS), test -e $(COOKIEDIR)/$(COOKIEFILE) ;)
 
 post-patch-gitsnap: $(PATCH_TARGETS)
-	@echo "Tagging top of current csw patch stack..."
-	@( cd $(WORKSRC); git tag -am "CSW $(GARVERSION)" csw-$(GARVERSION) )
+
+	@( if [ -d "$(WORKSRC)/.git" ]; then \
+		echo "Tagging top of current csw patch stack..."; \
+		cd $(WORKSRC); \
+		git tag -am "CSW $(GARVERSION)" csw-$(GARVERSION); \
+	  fi )
 	@$(MAKECOOKIE)
 
 makepatch: $(addprefix patch-,$(MODULATIONS)) $(addprefix makepatch-,$(MODULATIONS))
@@ -468,8 +474,9 @@
 
 # Allow generation of patches from modified work source.
 makepatch-modulated: $(FILEDIR)
-	@echo " ==> Makepatch: Looking for changes in modulation $(MODULATION)"
-	@( cd $(WORKSRC); \
+	@( if [ -d "$(WORKSRC)/.git" ]; then \
+		echo " ==> Makepatch: Looking for changes in modulation $(MODULATION)"; \
+		cd $(WORKSRC); \
 		git add -A; \
 		git diff --cached --quiet; \
 		if test $$? -eq 0; then \
@@ -483,9 +490,11 @@
 			echo PATCHFILES +=  0001*; \
 			echo "(or maybe PATCHFILES_$(MODULATION) ??)"; \
 			mv 0001* $(abspath $(FILEDIR)); ) \
-		fi )
+		fi; \
+	    else \
+		echo "No extracted sources so we can't create patches..."; \
+	    fi )
 
-
 # XXX: Allow patching of pristine sources separate from ISA directories
 # XXX: Use makepatch on global/
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list