Index: Mk/bsd.sites.mk =================================================================== --- Mk/bsd.sites.mk (revision 380770) +++ Mk/bsd.sites.mk (working copy) @@ -546,6 +546,48 @@ .endif .endif +# +# In order to use subversion repository your port must define USE_SVNREPO and +# the following variables, along with PORTNAME and PORTVERSION: +# +# SVNREPO_URL - URL of the subversion repository, including the branch part +# default: not set, mandatory +# +# SVNREPO_REV - revision number to check out +# default: not set, mandatory +# + +.if defined(USE_SVNREPO) +FETCH_DEPENDS= svn:${PORTSDIR}/devel/subversion +do-fetch: + @${MKDIR} ${_DISTDIR} + @file=${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX}; \ + if [ ! -f ${_DISTDIR}/$$file ]; then \ + if [ -f ${DISTINFO_FILE} -a "x${NO_CHECKSUM}" = "x" ]; then \ + _sha256sum=`alg=SHA256; ${DISTINFO_DATA}`; \ + if [ -z "$$_sha256sum" ]; then \ + ${ECHO_MSG} "=> $${DIR:+$$DIR/}$$file is not in ${DISTINFO_FILE}."; \ + ${ECHO_MSG} "=> Either ${DISTINFO_FILE} is out of date, or"; \ + ${ECHO_MSG} "=> $${DIR:+$$DIR/}$$file is spelled incorrectly."; \ + exit 1; \ + fi; \ + fi; \ + ${ECHO_MSG} "=> $$file doesn't seem to exist in ${_DISTDIR}."; \ + if [ ! -w ${_DISTDIR} ]; then \ + ${ECHO_MSG} "=> ${_DISTDIR} is not writable by you; cannot fetch."; \ + exit 1; \ + fi; \ + cd ${_DISTDIR} && \ + ${RM} -rf ${PORTNAME}-${PORTVERSION} && \ + ${ECHO_MSG} "=> checking out subversion repository ${SVNREPO_URL}, revision ${SVNREPO_REV}"; \ + svn export -q -r ${SVNREPO_REV} ${SVNREPO_URL} ${PORTNAME}-${PORTVERSION} && \ + ${FIND} ${PORTNAME}-${PORTVERSION} -and -exec ${TOUCH} -h -d 1970-01-01T00:00:00Z {} \; && \ + ${FIND} ${PORTNAME}-${PORTVERSION} -print0 | sort -z | \ + ${TAR} czf ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX} --options gzip:!timestamp --no-recursion --null -T - && \ + ${RM} -rf ${PORTNAME}-${PORTVERSION}; \ + fi; +.endif + .if !defined(IGNORE_MASTER_SITE_GNOME) MASTER_SITE_GNOME+= \ https://download.gnome.org/%SUBDIR%/ \