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

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Thu May 27 15:51:42 CEST 2010


Revision: 10017
          http://gar.svn.sourceforge.net/gar/?rev=10017&view=rev
Author:   bdwalton
Date:     2010-05-27 13:51:42 +0000 (Thu, 27 May 2010)

Log Message:
-----------
gar/v2: make makepatch git stuff robust against recipes with no extracted sources

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

Modified: csw/mgar/gar/v2-bwalton/gar.mk
===================================================================
--- csw/mgar/gar/v2-bwalton/gar.mk	2010-05-27 09:00:52 UTC (rev 10016)
+++ csw/mgar/gar/v2-bwalton/gar.mk	2010-05-27 13:51:42 UTC (rev 10017)
@@ -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