SF.net SVN: gar:[25983] csw/mgar/gar/v2

cgrzemba at users.sourceforge.net cgrzemba at users.sourceforge.net
Thu Oct 13 10:41:35 CEST 2016


Revision: 25983
          http://sourceforge.net/p/gar/code/25983
Author:   cgrzemba
Date:     2016-10-13 08:41:35 +0000 (Thu, 13 Oct 2016)
Log Message:
-----------
add mercurial repo (HG_REPOS) and update PYPI_MIRROR

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

Property Changed:
----------------
    csw/mgar/gar/v2/

Index: csw/mgar/gar/v2
===================================================================
--- csw/mgar/gar/v2	2016-10-13 08:00:25 UTC (rev 25982)
+++ csw/mgar/gar/v2	2016-10-13 08:41:35 UTC (rev 25983)

Property changes on: csw/mgar/gar/v2
___________________________________________________________________
Modified: svn:mergeinfo
## -8,7 +8,7 ##
 /csw/mgar/gar/v2-dirpackage:8125-8180
 /csw/mgar/gar/v2-fortran:10883-12516
 /csw/mgar/gar/v2-git/v2-relocate:7617
-/csw/mgar/gar/v2-hg:25913-25940
+/csw/mgar/gar/v2-hg:25913-25941
 /csw/mgar/gar/v2-migrateconf:7082-7211
 /csw/mgar/gar/v2-noexternals:11592-11745
 /csw/mgar/gar/v2-raised-buildlevel:15906-15949
\ No newline at end of property
Modified: csw/mgar/gar/v2/gar.conf.mk
===================================================================
--- csw/mgar/gar/v2/gar.conf.mk	2016-10-13 08:00:25 UTC (rev 25982)
+++ csw/mgar/gar/v2/gar.conf.mk	2016-10-13 08:41:35 UTC (rev 25983)
@@ -935,7 +935,7 @@
 # Python Package Index
 PYPI_PROJECT ?= $(NAME)
 PYPI_SUBDIR = $(shell echo $(PYPI_PROJECT) | cut -c 1)
-PYPI_MIRROR = http://pypi.python.org/packages/source/$(PYPI_SUBDIR)/$(PYPI_PROJECT)/
+PYPI_MIRROR = http://pypi.io/packages/source/$(PYPI_SUBDIR)/$(PYPI_PROJECT)/
 
 # Package dir
 GARPACKAGE = $(shell basename $(CURDIR))

Modified: csw/mgar/gar/v2/gar.lib.mk
===================================================================
--- csw/mgar/gar/v2/gar.lib.mk	2016-10-13 08:00:25 UTC (rev 25982)
+++ csw/mgar/gar/v2/gar.lib.mk	2016-10-13 08:41:35 UTC (rev 25983)
@@ -10,6 +10,8 @@
 # software causes damage.
 #
 
+# md5sum ?= md5sum
+md5sum ?= $(if $(filter no%,$(shell which md5sum)),gmd5sum,md5sum)
 # cookies go here, so we have to be able to find them for
 # dependency checking.
 VPATH += $(COOKIEDIR)
@@ -24,6 +26,7 @@
 # override GIT_PROXY_SCRIPT to something else if you need to.
 GIT_MAYBEPROXY = $(if $(GIT_USE_PROXY),GIT_PROXY_COMMAND=$(GIT_PROXY_SCRIPT))
 GIT_TREEISH = $(if $(GIT_TREEISH_$(1)),$(GIT_TREEISH_$(1)),HEAD)
+HG_TREEISH = $(if $(HG_TREEISH_$(1)),$(HG_TREEISH_$(1)),tip)
 
 #################### FETCH RULES ####################
 
@@ -43,6 +46,18 @@
 URLS += $(foreach R,$(GIT_REPOS),gitrepo://$(call GITPROJ,$(R)) $(foreach gitproto,git http file ssh,$(call gitsubst,$(gitproto),$(R))))
 endif
 
+define hgsubst
+$(subst hg-hg,hg,$(if $(findstring $(1)://,$(2)),$(patsubst $(1)%,hg-$(1)%,$(call URLSTRIP,$(2)) )))
+endef
+
+ifdef HG_REPOS
+URLS += $(foreach R,$(HG_REPOS),$(foreach hgproto,hg http file ssh,$(call hgsubst,$(hgproto),$(R))))
+NOEXTRACT += $(call GITPROJ,$(HG_REPOS)).hg
+endif
+
+# filename used for mercurial archive
+GARCHDISTNAME ?= $(DISTNAME).tar.gz
+
 # Download the file if and only if it doesn't have a preexisting
 # checksum file.  Loop through available URLs and stop when you
 # get one that doesn't return an error code.
@@ -55,18 +70,18 @@
 	$(if $(_FLIST),,$(error INTERNAL ERROR: The file $* is requested but not in the list of generated URLs))
 	@if test -f $(COOKIEDIR)/checksum-$*; then : ; else \
 		echo " ==> Grabbing $@"; \
-		( for i in $(filter %/$*,$(URLS)) $(foreach URL,$(URLS),$(if $(findstring $(GITHUB_HOST),$(URL)),$(URL),)); do  \
+		( for i in $(filter %/$(*:%.hg=%),$(URLS)) $(foreach URL,$(URLS),$(if $(findstring $(GITHUB_HOST),$(URL)),$(URL),)); do  \
 			echo " 	==> Trying $$i"; \
 			$(MAKE) -s `echo $$i | tr -d :` || continue; \
 			case $$i in \
 				*$(GITHUB_HOST)*) \
 					mv $(PARTIALDIR)/$(GITHUB_REFERENCE) $@ ;; \
 				*) \
-					mv $(PARTIALDIR)/$* $@ ;; \
+					mv $(PARTIALDIR)/$(*:%.hg=%) $(@:%.hg=%) ;; \
 			esac; \
 			break; \
 		done; ) 2>&1 | grep -v '^$(MAKE)'; \
-		if test -r $@ ; then : ; else \
+		if [ -r $(@:%.hg=%) ] || [ $* = $(GARCHDISTNAME) -a ! -z $(HG_REPOS) ]; then : ; else \
 			echo '(!!!) Failed to download $@!' 1>&2; \
 			false; \
 		fi; \
@@ -104,6 +119,14 @@
 	@( cd $(PARTIALDIR)/$(call GITPROJ,$*); \
 		git config remote.origin.fetch $(if $(GIT_REFS_$(call GITPROJ,$*)),$(GIT_REFS_$(call GITPROJ,$*)),$(GIT_DEFAULT_TRACK)); )
 
+hg-http//%:
+	hg clone http://$* $(PARTIALDIR)/$(call GITPROJ,$*)
+hg-hg//%:
+	hg clone hg://$* $(PARTIALDIR)/$(call GITPROJ,$*)
+hg-ssh//%:
+	hg clone ssh://$* $(PARTIALDIR)/$(call GITPROJ,$*)
+hg-file//%:
+	hg clone file://$* $(PARTIALDIR)/$(call GITPROJ,$*)
 
 # create ADMSCRIPTS 'on the fly' from variables defined by the caller
 # This version is private and should only be called from the non-private
@@ -182,7 +205,7 @@
 checksum-%: $(CHECKSUM_FILE) 
 	@echo " ==> Running checksum on $*"
 	@if ggrep -- '[ /]$*$$' $(CHECKSUM_FILE); then \
-		if cat $(CHECKSUM_FILE) | sed -e 's!download/!!' | (cd $(DOWNLOADDIR); LC_ALL="C" LANG="C" gmd5sum -c 2>&1) | \
+		if cat $(CHECKSUM_FILE) | sed -e 's!download/!!' | (cd $(DOWNLOADDIR); LC_ALL="C" LANG="C" $(md5sum) -c 2>&1) | \
 			ggrep -- '$*' | ggrep -v ':[ ]\+OK'; then \
 			echo '(!!!) $* failed checksum test!' 1>&2; \
 			false; \
@@ -550,9 +573,12 @@
 # checksummed files
 
 $(GARCHIVEDIR)/%: $(GARCHIVEDIR)
+	$(if $(filter %.hg,$*),(cd $(DOWNLOADDIR)/$(*:%.hg=%) && \
+	 hg archive --prefix=$(DISTNAME)/ --rev=$(call HG_TREEISH,$(*:%.hg=%)) --type tar - | gzip > $(GARCHIVEDIR)/$(GARCHDISTNAME) && \
+	 rm -f $(GARCHDISTNAME) && ln -s $(GARCHIVEDIR)/$(GARCHDISTNAME) . ), \
 	@if [ -h $(DOWNLOADDIR)/$* ]; then :; else \
 		gcp -Lr $(DOWNLOADDIR)/$* $@; \
-	fi
+	fi )
 
 
 #################### EXTRACT RULES ####################
@@ -632,6 +658,10 @@
 	@echo " ===> Extracting Git Repo $(DOWNLOADDIR)/$* (Treeish: $(call GIT_TREEISH,$*))"
 	( cd $(abspath $(DOWNLOADDIR))/$*/; git --bare archive --prefix=$(NAME)-$(VERSION)/ $(call GIT_TREEISH,$*)) | gtar -xf - -C $(EXTRACTDIR)
 	@$(MAKECOOKIE)
+hg-extract-%:
+	@echo " ===> Extracting Mercurial Repo $(DOWNLOADDIR)/$* (Tag: $(call HG_TREEISH,$(*:%.hg=%)))"
+	( cd $(abspath $(DOWNLOADDIR))/$*/; hg archive --prefix=$(DISTNAME)/ --rev=$(call HG_TREEISH,$(*:%.hg=%)) --type tar -)| gtar -xf - -C $(EXTRACTDIR)
+	@$(MAKECOOKIE)
 
 # rule to extract files with unzip
 zip-extract-%:
@@ -723,6 +753,9 @@
 extract-archive-%.git: git-extract-%.git
 	@$(MAKECOOKIE)
 
+extract-archive-%.hg: hg-extract-%
+	@$(MAKECOOKIE)
+
 extract-copy-%: cp-extract-%
 	@$(MAKECOOKIE)
 

Modified: csw/mgar/gar/v2/gar.mk
===================================================================
--- csw/mgar/gar/v2/gar.mk	2016-10-13 08:00:25 UTC (rev 25982)
+++ csw/mgar/gar/v2/gar.mk	2016-10-13 08:41:35 UTC (rev 25983)
@@ -11,6 +11,8 @@
 # Comment this out to make much verbosity
 #.SILENT:
 
+md5sum ?= $(if $(filter no%,$(shell which md5sum)),gmd5sum,md5sum)
+
 ifneq ($(abspath /),/)
 $(error Your version of 'make' is too old: $(MAKE_VERSION). Please make sure you are using at least 3.81)
 endif
@@ -45,7 +47,7 @@
 
 DYNSCRIPTS := $(foreach PKG,$(SPKG_SPECS),$(foreach SCR,$(ADMSCRIPTS),$(if $(value $(PKG)_$(SCR)), $(PKG).$(SCR))))
 _LOCALFILES = $(notdir $(wildcard files/*))
-_NOCHECKSUM += $(DYNSCRIPTS) $(_LOCALFILES) $(foreach R,$(GIT_REPOS),$(call GITPROJ,$(R))) $(_EXTRA_GAR_NOCHECKSUM)
+_NOCHECKSUM += $(DYNSCRIPTS) $(_LOCALFILES) $(foreach R,$(GIT_REPOS),$(call GITPROJ,$(R))) $(foreach R,$(HG_REPOS),$(call GITPROJ,$(R).hg)) $(_EXTRA_GAR_NOCHECKSUM)
 
 DISTFILES += $(_EXTRA_GAR_DISTFILES)
 
@@ -54,7 +56,8 @@
 ALLFILES_PATCHFILES ?= $(PATCHFILES) $(foreach M,$(MODULATIONS),$(PATCHFILES_$M))
 ALLFILES_DYNSCRIPTS ?= $(DYNSCRIPTS)
 ALLFILES_GIT_REPOS ?= $(foreach R,$(GIT_REPOS),$(call GITPROJ,$(R)))
-ALLFILES ?= $(sort $(ALLFILES_DISTFILES) $(ALLFILES_PATCHFILES) $(ALLFILES_DYNSCRIPTS) $(ALLFILES_GIT_REPOS) $(EXTRA_ALLFILES) $(_EXTRA_GAR_ALLFILES))
+ALLFILES_HG_REPOS ?= $(foreach R,$(HG_REPOS),$(call GITPROJ,$(R).hg))
+ALLFILES ?= $(sort $(ALLFILES_DISTFILES) $(ALLFILES_PATCHFILES) $(ALLFILES_DYNSCRIPTS) $(ALLFILES_GIT_REPOS) $(ALLFILES_HG_REPOS) $(EXTRA_ALLFILES) $(_EXTRA_GAR_ALLFILES))
 
 ifeq ($(MAKE_INSTALL_DIRS),1)
 INSTALL_DIRS = $(addprefix $(DESTDIR),$(prefix) $(exec_prefix) $(bindir) $(sbindir) $(libexecdir) $(datadir) $(sysconfdir) $(sharedstatedir) $(localstatedir) $(libdir) $(infodir) $(lispdir) $(includedir) $(mandir) $(foreach NUM,1 2 3 4 5 6 7 8, $(mandir)/man$(NUM)) $(sourcedir))
@@ -337,6 +340,8 @@
 	@$(foreach D,$(DYNSCRIPTS),echo "	$D";)
 	@echo "Git Repos tracked: "
 	@$(foreach R,$(GIT_REPOS),echo "       $R";)
+	@echo "Mercurial Repos tracked: "
+	@$(foreach R,$(HG_REPOS),echo "       $R";)
 	@echo "All potential URLS: "
 	@$(foreach U,$(URLS),echo "       $U";)
 
@@ -380,9 +385,9 @@
 
 MAKESUM_TARGETS =  $(filter-out $(_NOCHECKSUM) $(NOCHECKSUM),$(ALLFILES))
 
-makesum: fetch $(addprefix $(DOWNLOADDIR)/,$(MAKESUM_TARGETS)) $(GARCHIVE_TARGETS)
+makesum: fetch $(GARCHIVE_TARGETS) $(addprefix $(DOWNLOADDIR)/,$(MAKESUM_TARGETS)) 
 	@if test "x$(MAKESUM_TARGETS)" != "x"; then \
-		(cd $(DOWNLOADDIR) && gmd5sum $(MAKESUM_TARGETS)) > $(CHECKSUM_FILE) ; \
+		(cd $(DOWNLOADDIR) && $(md5sum) $(MAKESUM_TARGETS)) > $(CHECKSUM_FILE) ; \
 		echo "Checksums made for $(MAKESUM_TARGETS)" ; \
 		cat $(CHECKSUM_FILE) ; \
 	else \
@@ -395,8 +400,8 @@
 garchive: checksum $(GARCHIVE_TARGETS) ;
 
 # extract		- Unpacks $(DISTFILES) into $(EXTRACTDIR) (patches are "zcatted" into the patch program)
-EXTRACT_TARGETS-global ?= $(addprefix extract-copy-,$(filter-out $(NOEXTRACT),$(DISTFILES) $(DYNSCRIPTS) $(foreach R,$(GIT_REPOS),$(call GITPROJ,$(R)))))
-EXTRACT_TARGETS-default = $(addprefix extract-archive-,$(filter-out $(NOEXTRACT),$(DISTFILES) $(DYNSCRIPTS) $(foreach R,$(GIT_REPOS),$(call GITPROJ,$(R)))))
+EXTRACT_TARGETS-global ?= $(addprefix extract-copy-,$(filter-out $(NOEXTRACT),$(DISTFILES) $(DYNSCRIPTS) $(foreach R,$(GIT_REPOS),$(call GITPROJ,$(R))) $(foreach R,$(HG_REPOS),$(call GITPROJ,$(R).hg))))
+EXTRACT_TARGETS-default = $(addprefix extract-archive-,$(filter-out $(NOEXTRACT),$(DISTFILES) $(DYNSCRIPTS) $(foreach R,$(GIT_REPOS),$(call GITPROJ,$(R))) $(foreach R,$(HG_REPOS),$(call GITPROJ,$(R).hg))))
 EXTRACT_TARGETS = $(or $(EXTRACT_TARGETS-$(MODULATION)),$(EXTRACT_TARGETS-default))
 
 ifdef REINPLACE_FILES

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