Date: Tue, 25 Jul 2006 11:07:16 GMT From: Gabor Kovesdan <gabor@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 102364 for review Message-ID: <200607251107.k6PB7GED039285@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=102364 Change 102364 by gabor@gabor_spitfire on 2006/07/25 11:06:24 Move another pieces of code. Affected files ... .. //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#59 edit .. //depot/projects/soc2006/gabor_ports/Tools/scripts/do-fetch.sh#4 edit Differences ... ==== //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#59 (text+ko) ==== @@ -2374,164 +2374,7 @@ # Popular master sites .include "bsd.sites.mk" -# Empty declaration to avoid "variable MASTER_SITES recursive" error -MASTER_SITES?= -_MASTER_SITES_DEFAULT?= - -# Feed internal _{MASTER,PATCH}_SITES_n where n is a group designation -# as per grouping rules (:something) -# Organize _{MASTER,PATCH}_SITES_{DEFAULT,[^/:]+} according to grouping -# rules (:something) -.for _S in ${MASTER_SITES} -_S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://} -. if !empty(_S_TEMP) -. for _group in ${_S_TEMP:S/,/ /g} -_G_TEMP= ${_group} -. if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default -check-makevars:: - @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be" - @${ECHO_MSG} "used in group definitions. Please fix your MASTER_SITES" - @${FALSE} -. endif -_MASTER_SITES_${_group}+= ${_S:C@^(.*/):[^/:]+$@\1@} -. endfor -. else -_MASTER_SITES_DEFAULT+= ${_S:C@^(.*/):[^/:]+$@\1@} -. endif -.endfor - -# Feed internal _{MASTER,PATCH}_SITE_SUBDIR_n where n is a group designation -# as per grouping rules (:something) -# Organize _{MASTER,PATCH}_SITE_SUBDIR_{DEFAULT,[^/:]+} according to grouping -# rules (:something) -.for _S in ${MASTER_SITE_SUBDIR} -_S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://} -. if !empty(_S_TEMP) -. for _group in ${_S_TEMP:S/,/ /g} -_G_TEMP= ${_group} -. if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default -check-makevars:: - @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be" - @${ECHO_MSG} "used in group definitions. Please fix your MASTER_SITE_SUBDIR" - @${FALSE} -. endif -. if defined(_MASTER_SITES_${_group}) -_MASTER_SITE_SUBDIR_${_group}+= ${_S:C@^(.*)/:[^/:]+$@\1@} -. endif -. endfor -. else -. if defined(_MASTER_SITES_DEFAULT) -_MASTER_SITE_SUBDIR_DEFAULT+= ${_S:C@^(.*)/:[^/:]+$@\1@} -. endif -. endif -.endfor - -# Substitute subdirectory names -# XXX simpler/faster solution but not the best space wise, suggestions please -.for _S in ${MASTER_SITES} -_S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://} -. if !empty(_S_TEMP) -. for _group in ${_S_TEMP:S/,/ /g} -. if !defined(_MASTER_SITE_SUBDIR_${_group}) -MASTER_SITES_TMP= ${_MASTER_SITES_${_group}:S^%SUBDIR%/^^} -. else -_S_TEMP_TEMP= ${_MASTER_SITES_${_group}:M*%SUBDIR%/*} -. if empty(_S_TEMP_TEMP) -MASTER_SITES_TMP= ${_MASTER_SITES_${_group}} -. else -MASTER_SITES_TMP= -. for site in ${_MASTER_SITES_${_group}} -_S_TEMP_TEMP= ${site:M*%SUBDIR%/*} -. if empty(_S_TEMP_TEMP) -MASTER_SITES_TMP+= ${site} -. else -. for dir in ${_MASTER_SITE_SUBDIR_${_group}} -MASTER_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^} -. endfor -. endif -. endfor -. endif -. endif -_MASTER_SITES_${_group}:= ${MASTER_SITES_TMP} -. endfor -. endif -.endfor -.if defined(_MASTER_SITE_SUBDIR_DEFAULT) -_S_TEMP= ${_MASTER_SITES_DEFAULT:M*%SUBDIR%/*} -. if empty(_S_TEMP) -MASTER_SITES_TMP= ${_MASTER_SITES_DEFAULT} -. else -MASTER_SITES_TMP= -. for site in ${_MASTER_SITES_DEFAULT} -_S_TEMP_TEMP= ${site:M*%SUBDIR%/*} -. if empty(_S_TEMP_TEMP) -MASTER_SITES_TMP+= ${site} -. else -. for dir in ${_MASTER_SITE_SUBDIR_DEFAULT} -MASTER_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^} -. endfor -. endif -. endfor -. endif -.else -MASTER_SITES_TMP= ${_MASTER_SITES_DEFAULT:S^%SUBDIR%/^^} -.endif -_MASTER_SITES_DEFAULT:= ${MASTER_SITES_TMP} -MASTER_SITES_TMP= - -# The primary backup site. -MASTER_SITE_BACKUP?= \ - ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/ -MASTER_SITE_BACKUP:= ${MASTER_SITE_BACKUP:S^\${DIST_SUBDIR}/^^} - -# If the user has MASTER_SITE_FREEBSD set, go to the FreeBSD repository -# for everything, but don't search it twice by appending it to the end. -.if defined(MASTER_SITE_FREEBSD) -_MASTER_SITE_OVERRIDE:= ${MASTER_SITE_BACKUP} -_MASTER_SITE_BACKUP:= # empty -.else -_MASTER_SITE_OVERRIDE= ${MASTER_SITE_OVERRIDE} -_MASTER_SITE_BACKUP= ${MASTER_SITE_BACKUP} -.endif - -# Search CDROM first if mounted, symlink instead of copy if -# FETCH_SYMLINK_DISTFILES is set -.for MOUNTPT in ${CD_MOUNTPTS} -.if exists(${MOUNTPT}/ports/distfiles) -_MASTER_SITE_OVERRIDE:= file:${MOUNTPT}/ports/distfiles/${DIST_SUBDIR}/ ${_MASTER_SITE_OVERRIDE} -.if defined(FETCH_SYMLINK_DISTFILES) -FETCH_BEFORE_ARGS+= -l -.endif -.endif -.endfor - -NOFETCHFILES?= - -# Organize DISTFILES, PATCHFILES, _MASTER_SITES_ALL, _PATCH_SITES_ALL -# according to grouping rules (:something) -DISTFILES?= ${DISTNAME}${EXTRACT_SUFX} -_MASTER_SITES_ALL= ${_MASTER_SITES_DEFAULT} -_G_TEMP= DEFAULT -.for _D in ${DISTFILES} -_D_TEMP= ${_D:S/^${_D:C/:[^:]+$//}//} -. if !empty(_D_TEMP) -. for _group in ${_D_TEMP:S/^://:S/,/ /g} -. if !defined(_MASTER_SITES_${_group}) -_G_TEMP_TEMP= ${_G_TEMP:M/${_group}/} -. if empty(_G_TEMP_TEMP) -_G_TEMP+= ${_group} -_MASTER_SITES_ALL+= ${_MASTER_SITES_${_group}} -. endif -. endif -. endfor -_DISTFILES+= ${_D:C/:[^:]+$//} -. else -_DISTFILES+= ${_D} -. endif -.endfor -_G_TEMP= -_G_TEMP_TEMP= -ALLFILES?= ${_DISTFILES} ${_PATCHFILES} +ALLFILES?= ${_DISTFILES} ${_PATCHFILES} # # Sort the master site list according to the patterns in MASTER_SORT ==== //depot/projects/soc2006/gabor_ports/Tools/scripts/do-fetch.sh#4 (text+ko) ==== @@ -1,5 +1,152 @@ ${MKDIR} ${_DISTDIR} cd ${_DISTDIR} + +for _S in ${MASTER_SITES}; do + _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://} + if [ -n "$(_S_TEMP)" ] ; then + for _group in ${_S_TEMP:S/,/ /g}; do + _G_TEMP= ${_group} + if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default + ${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be" + ${ECHO_MSG} "used in group definitions. Please fix your MASTER_SITES." + exit 1 + fi + _MASTER_SITES_${_group}+= ${_S:C@^(.*/):[^/:]+$@\1@} + done + else + _MASTER_SITES_DEFAULT+= ${_S:C@^(.*/):[^/:]+$@\1@} + fi +done +for _S in ${MASTER_SITE_SUBDIR}; do + _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://} + if [ -n "$(_S_TEMP)" ] ; then + for _group in ${_S_TEMP:S/,/ /g}; do + _G_TEMP= ${_group} + if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default; then + ${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be" + ${ECHO_MSG} "used in group definitions. Please fix your MASTER_SITES." + exit 1 + fi + if [ -n "$(_MASTER_SITES_${_group})" ] ; then + _MASTER_SITE_SUBDIR_${_group}+= ${_S:C@^(.*)/:[^/:]+$@\1@} + fi + done + else + if [ -n "$(_MASTER_SITES_DEFAULT)" ] ; then + _MASTER_SITE_SUBDIR_DEFAULT+= ${_S:C@^(.*)/:[^/:]+$@\1@} + fi + fi +done +for _S in ${MASTER_SITES}; do + _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://} + if [ -n "$(_S_TEMP)" ] ; then + for _group in ${_S_TEMP:S/,/ /g}; do + if [ -z "$$(_MASTER_SITE_SUBDIR_${_group})" ] ; then + MASTER_SITES_TMP= ${_MASTER_SITES_${_group}:S^%SUBDIR%/^^} + else + _S_TEMP_TEMP= ${_MASTER_SITES_${_group}:M*%SUBDIR%/*} + if [ -z "$(_S_TEMP_TEMP)" ] ; then + MASTER_SITES_TMP= $${_MASTER_SITES_${_group}} + else + MASTER_SITES_TMP= + for site in $${_MASTER_SITES_${_group}}; do + _S_TEMP_TEMP= ${site:M*%SUBDIR%/*} + if [ -z "$(_S_TEMP_TEMP)" ] ; then + MASTER_SITES_TMP+= ${site} + else + for dir in $${_MASTER_SITE_SUBDIR_${_group}}; do + MASTER_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^} + done + fi + done + fi + fi + _MASTER_SITES_${_group}:= ${MASTER_SITES_TMP} + done + fi +done +if [ -n "$(_MASTER_SITE_SUBDIR_DEFAULT)" ] ; then + _S_TEMP= ${_MASTER_SITES_DEFAULT:M*%SUBDIR%/*} + if [ -z "$(_S_TEMP)" ] ; then + MASTER_SITES_TMP= ${_MASTER_SITES_DEFAULT} + else + MASTER_SITES_TMP= + for site in ${_MASTER_SITES_DEFAULT}; do + _S_TEMP_TEMP= ${site:M*%SUBDIR%/*} + if [ -z "$(_S_TEMP_TEMP)" ] ; then + MASTER_SITES_TMP+= ${site} + else + for dir in ${_MASTER_SITE_SUBDIR_DEFAULT}; do + MASTER_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^} + done + fi + done + fi +else + MASTER_SITES_TMP= ${_MASTER_SITES_DEFAULT:S^%SUBDIR%/^^} +fi +_MASTER_SITES_DEFAULT:= ${MASTER_SITES_TMP} +MASTER_SITES_TMP= + +# The primary backup site. +if [ -z "${MASTER_SITE_BACKUP}" ] ; then + MASTER_SITE_BACKUP= ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/ +fi +MASTER_SITE_BACKUP:= ${MASTER_SITE_BACKUP:S^\${DIST_SUBDIR}/^^} + +# If the user has MASTER_SITE_FREEBSD set, go to the FreeBSD repository +# for everything, but don't search it twice by appending it to the end. +if [ -n "$(MASTER_SITE_FREEBSD)" ] ; then + _MASTER_SITE_OVERRIDE= ${MASTER_SITE_BACKUP} + _MASTER_SITE_BACKUP= +else +_MASTER_SITE_OVERRIDE= ${MASTER_SITE_OVERRIDE} +_MASTER_SITE_BACKUP= ${MASTER_SITE_BACKUP} +fi + +# Search CDROM first if mounted, symlink instead of copy if +# FETCH_SYMLINK_DISTFILES is set +for MOUNTPT in ${CD_MOUNTPTS}; do + if [ -d ${MOUNTPT}/ports/distfiles ] ; then + _MASTER_SITE_OVERRIDE:= file:${MOUNTPT}/ports/distfiles/${DIST_SUBDIR}/ ${_MASTER_SITE_OVERRIDE} + if [ -n "${FETCH_SYMLINK_DISTFILES}" ]; then + FETCH_BEFORE_ARGS+= -l + fi + fi +done + +if [ -z "${NOFETCHFILES}" ] ; then + NOFETCHFILES= +fi + +# Organize DISTFILES, PATCHFILES, _MASTER_SITES_ALL, _PATCH_SITES_ALL +# according to grouping rules (:something) +if [ -z "${DISTFILES}" ] ; then + DISTFILES= ${DISTNAME}${EXTRACT_SUFX} +fi +_MASTER_SITES_ALL= ${_MASTER_SITES_DEFAULT} +_G_TEMP= DEFAULT +for _D in ${DISTFILES}; do + _D_TEMP= ${_D:S/^${_D:C/:[^:]+$//}//} + if [ -n "$(_D_TEMP)" ] ; then + for _group in ${_D_TEMP:S/^://:S/,/ /g}; do + if [ -z "$$(_MASTER_SITES_${_group})" ] ; then + _G_TEMP_TEMP= ${_G_TEMP:M/${_group}/} + if [ -z "$(_G_TEMP_TEMP)" ; then + _G_TEMP+= ${_group} + _MASTER_SITES_ALL+= ${_MASTER_SITES_${_group}} + fi + fi + done + _DISTFILES+= ${_D:C/:[^:]+$//} + else + _DISTFILES+= ${_D} + fi +done +_G_TEMP= +_G_TEMP_TEMP= +ALLFILES= ${_DISTFILES} ${_PATCHFILES} + ${_MASTER_SITES_ENV} for _file in ${DISTFILES}; do file=`${ECHO_CMD} $_file | ${SED} -E -e 's/:[^:]+$//'`
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607251107.k6PB7GED039285>