pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

hg-package.mk: avoid cache extraction if hg repo exists in the work dir



Module Name:	pkgsrc-wip
Committed By:	Martin Husemann <martin%NetBSD.org@localhost>
Pushed By:	martin
Date:		Sun Jan 31 00:33:18 2016 +0100
Changeset:	43150ec8409dad0c62e41880100fb5708bdc6ab7

Modified Files:
	mk/hg-package.mk

Log Message:
hg-package.mk: avoid cache extraction if hg repo exists in the work dir

When working with huge hg packages (like firefox) the caching and cache
extraction of the hg repository and the working copy take a lot of time.

When we find a .hg directory in the work dir assume it is a full hg
repository clone, leave it intact, pull it to current and checkout
(throwing away local modifications).

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=43150ec8409dad0c62e41880100fb5708bdc6ab7

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 mk/hg-package.mk | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diffs:
diff --git a/mk/hg-package.mk b/mk/hg-package.mk
index 6a1b931..ba91932 100644
--- a/mk/hg-package.mk
+++ b/mk/hg-package.mk
@@ -143,15 +143,24 @@ do-hg-extract:
 .for _repo_ in ${HG_REPOSITORIES}
 	${RUN} cd ${WRKDIR};						\
 	if [ ! -d ${HG_DISTDIR:Q} ]; then mkdir -p ${HG_DISTDIR:Q}; fi;	\
-	${_HG_EXTRACT_CACHED.${_repo_}};					\
-	${SETENV} ${_HG_ENV}						\
-	       ${_HG_CMD} clone ${_HG_FLAGS}			       \
-		       ${HG_REPO.${_repo_}:Q} ${HG_MODULE.${_repo_}} && \
-	(cd ${HG_MODULE.${_repo_}:Q} && 				\
-	${SETENV} ${_HG_ENV}						\
-		${_HG_CMD} update ${_HG_FLAGS}				\
-			 ${_HG_TAG_FLAG.${_repo_}:Q}) &&		\
-	${_HG_CREATE_CACHE.${_repo_}}
+	if [ ! -d ${HG_MODULE.${_repo_}:Q}/.hg ]; then			\
+		${_HG_EXTRACT_CACHED.${_repo_}};			\
+		${SETENV} ${_HG_ENV}					\
+		       ${_HG_CMD} clone ${_HG_FLAGS}			\
+			       ${HG_REPO.${_repo_}:Q}			\
+				${HG_MODULE.${_repo_}} &&		\
+		(cd ${HG_MODULE.${_repo_}:Q} && 			\
+		${SETENV} ${_HG_ENV}					\
+			${_HG_CMD} update ${_HG_FLAGS}			\
+				 ${_HG_TAG_FLAG.${_repo_}:Q}) &&	\
+		${_HG_CREATE_CACHE.${_repo_}};				\
+	else								\
+		(cd ${HG_MODULE.${_repo_}:Q} &&				\
+		${SETENV} ${_HG_ENV}					\
+			${_HG_CMD} pull ${_HG_FLAGS} &&			\
+		${SETENV} ${_HG_ENV}					\
+			${_HG_CMD} update -C ${_HG_FLAGS})		\
+	fi
 .endfor
 
 .endif


Home | Main Index | Thread Index | Old Index