hg-package.mk: add a "hg-cleandir" target to remove all checkouts and state

This is very much like "cleandir" but keeps the hg clones intact (plus
a few hidden .* files probably nobody cares about).

This is usefull with huge hg repos when testing/veryfing patches.
This commit is contained in:
Martin Husemann 2016-02-01 21:20:25 +01:00
parent a9f1987341
commit 16bbd88bd3

View file

@ -136,6 +136,16 @@ _HG_CREATE_CACHE.${repo}= \
pax -w ${HG_MODULE.${repo}:Q} | gzip > ${HG_DISTDIR}/${_HG_DISTFILE.${repo}:Q}
.endfor
.PHONY: hg-cleandir
hg-cleandir:
.for _repo_ in ${HG_REPOSITORIES}
${RUN} cd ${WRKDIR}; \
if [ -d ${HG_MODULE.${_repo_}:Q} ]; then \
cd ${HG_MODULE.${_repo_}:Q} && rm -rf *; \
fi
.endfor
${RUN} cd ${WRKDIR} && rm -f .*_done
pre-extract: do-hg-extract
.PHONY: do-hg-extract