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

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Tue May 4 04:10:50 CEST 2010


Revision: 9803
          http://gar.svn.sourceforge.net/gar/?rev=9803&view=rev
Author:   bdwalton
Date:     2010-05-04 02:10:50 +0000 (Tue, 04 May 2010)

Log Message:
-----------
gar/v2-bwalton: enforce a basic ~/.gitconfig

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-04 00:42:49 UTC (rev 9802)
+++ csw/mgar/gar/v2-bwalton/gar.mk	2010-05-04 02:10:50 UTC (rev 9803)
@@ -389,9 +389,40 @@
 extract-modulated: checksum-modulated $(EXTRACTDIR) $(COOKIEDIR) \
 		$(addprefix dep-$(GARDIR)/,$(EXTRACTDEPS)) \
 		announce-modulation \
-		pre-extract-modulated pre-extract-$(MODULATION) $(EXTRACT_TARGETS) $(if $(filter $(firstword $(MODULATIONS)),$(MODULATION)),post-extract-gitsnap) post-extract-$(MODULATION) post-extract-modulated
+		pre-extract-modulated pre-extract-$(MODULATION) pre-extract-git-check $(EXTRACT_TARGETS) $(if $(filter $(firstword $(MODULATIONS)),$(MODULATION)),post-extract-gitsnap) post-extract-$(MODULATION) post-extract-modulated
 	@$(DONADA)
 
+pre-extract-git-check:
+	@( if [ ! -f $(HOME)/.gitconfig ]; then \
+		name=`getent passwd $$USER | awk -F: '{print $$5}'`; \
+		echo "===================================================="; \
+		echo "You need to create a basic ~/.gitconfig."; \
+		echo "Try: "; \
+		echo "	git config --global user.email $$USER at opencsw.org"; \
+		echo "	git config --global user.name \"$$name\""; \
+		echo "===================================================="; \
+		exit 1; \
+	  else \
+		g_email=`git config --global user.email`; \
+		g_name=`git config --global user.name`; \
+		email=$$USER at opencsw.org; \
+		name=`getent passwd $$USER | awk -F: '{print $$5}'`; \
+		if [ -z "$$g_email" ]; then \
+		  echo "==================================================="; \
+		  echo "Your ~/.gitconfig doesn't define user.email.  Try:"; \
+		  echo "  git config --global user.email $$email"; \
+		  echo "==================================================="; \
+		  exit 1; \
+		elif [ -z "$$g_name" ]; then \
+		  echo "==================================================="; \
+		  echo "Your ~/.gitconfig doesn't define user.name.  Try:"; \
+		  echo "  git config --global user.name '$$name'"; \
+		  echo "==================================================="; \
+		  exit 1; \
+		fi; \
+	  fi )
+	@$(MAKECOOKIE)
+
 post-extract-gitsnap: $(EXTRACT_TARGETS)
 	@echo Snapshotting extracted source tree with git...
 	@( cd $(WORKSRC); git init; git add .; \


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