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

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Tue Jun 22 04:48:04 CEST 2010


Revision: 10277
          http://gar.svn.sourceforge.net/gar/?rev=10277&view=rev
Author:   bdwalton
Date:     2010-06-22 02:48:04 +0000 (Tue, 22 Jun 2010)

Log Message:
-----------
gar/v2: Add ssh and file git transport support for GIT_REPOS

Andrew Robert Nicols sent in support for allowing ssh:// and file://
tranport types to be used in GIT_REPOS.  This allows local and
non-public (ssh protected) repositories to be used.

This is a slight modification of the two patches that were submitted.

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

Modified: csw/mgar/gar/v2/gar.lib.mk
===================================================================
--- csw/mgar/gar/v2/gar.lib.mk	2010-06-22 01:16:49 UTC (rev 10276)
+++ csw/mgar/gar/v2/gar.lib.mk	2010-06-22 02:48:04 UTC (rev 10277)
@@ -33,8 +33,12 @@
 # these 'dynamic script' targets to our fetch list
 URLS += $(foreach DYN,$(DYNSCRIPTS),dynscr://$(DYN))
 
+define gitsubst
+$(subst git-git,git,$(if $(findstring $(1)://,$(2)),$(patsubst $(1)%,git-$(1)%,$(call URLSTRIP,$(2)))))
+endef
+
 ifdef GIT_REPOS
-URLS += $(foreach R,$(GIT_REPOS),gitrepo://$(call GITPROJ,$(R)) $(subst http,git-http,$(call URLSTRIP,$(R))))
+URLS += $(foreach R,$(GIT_REPOS),gitrepo://$(call GITPROJ,$(R)) $(foreach gitproto,git http file ssh,$(call gitsubst,$(gitproto),$(R))))
 endif
 
 # Download the file if and only if it doesn't have a preexisting
@@ -83,6 +87,19 @@
 		git remote add origin git://$*; \
 		git config remote.origin.fetch $(if $(GIT_REFS_$(call GITPROJ,$*)),$(GIT_REFS_$(call GITPROJ,$*)),$(GIT_DEFAULT_TRACK)); )
 
+git-file//%:
+	@git clone --bare file:///$* $(PARTIALDIR)/$(call GITPROJ,$*)
+	@( cd $(PARTIALDIR)/$(call GITPROJ,$*); \
+		git remote add origin file://$*; \
+		git config remote.origin.fetch $(if $(GIT_REFS_$(call GITPROJ,$*)),$(GIT_REFS_$(call GITPROJ,$*)),$(GIT_DEFAULT_TRACK)); )
+
+git-ssh//%:
+	@git clone --bare ssh://$* $(PARTIALDIR)/$(call GITPROJ,$*)
+	@( cd $(PARTIALDIR)/$(call GITPROJ,$*); \
+		git remote add origin ssh://$*; \
+		git config remote.origin.fetch $(if $(GIT_REFS_$(call GITPROJ,$*)),$(GIT_REFS_$(call GITPROJ,$*)),$(GIT_DEFAULT_TRACK)); )
+
+
 # create ADMSCRIPTS 'on the fly' from variables defined by the caller
 # This version is private and should only be called from the non-private
 # version directly below


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