Date: Tue, 25 Jul 2006 16:48:49 GMT From: Gabor Kovesdan <gabor@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 102390 for review Message-ID: <200607251648.k6PGmnp8078792@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=102390 Change 102390 by gabor@gabor_spitfire on 2006/07/25 16:48:49 Move another bunch of the code to the script from bsd.port.mk. Affected files ... .. //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#60 edit .. //depot/projects/soc2006/gabor_ports/Tools/scripts/do-fetch.sh#5 edit Differences ... ==== //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#60 (text+ko) ==== @@ -2376,79 +2376,7 @@ ALLFILES?= ${_DISTFILES} ${_PATCHFILES} -# -# Sort the master site list according to the patterns in MASTER_SORT -# -MASTER_SORT?= -MASTER_SORT_REGEX?= -MASTER_SORT_REGEX+= ${MASTER_SORT:S|.|\\.|g:S|^|://[^/]*|:S|$|/|} - -MASTER_SORT_AWK= BEGIN { RS = " "; ORS = " "; IGNORECASE = 1 ; gl = "${MASTER_SORT_REGEX:S|\\|\\\\|g}"; } -.for srt in ${MASTER_SORT_REGEX} -MASTER_SORT_AWK+= /${srt:S|/|\\/|g}/ { good["${srt:S|\\|\\\\|g}"] = good["${srt:S|\\|\\\\|g}"] " " $$0 ; next; } -.endfor -MASTER_SORT_AWK+= { rest = rest " " $$0; } END { n=split(gl, gla); for(i=1;i<=n;i++) { print good[gla[i]]; } print rest; } - -SORTED_MASTER_SITES_DEFAULT_CMD= cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} master-sites-DEFAULT -SORTED_PATCH_SITES_DEFAULT_CMD= cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} patch-sites-DEFAULT -SORTED_MASTER_SITES_ALL_CMD= cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} master-sites-ALL -SORTED_PATCH_SITES_ALL_CMD= cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} patch-sites-ALL - -# -# Sort the master site list according to the patterns in MASTER_SORT -# according to grouping rules (:something) -# -# for use in the fetch targets -.for _S in ${MASTER_SITES} -_S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//} -. if !empty(_S_TEMP) -. for _group in ${_S_TEMP:S/^://:S/,/ /g} -. if !target(master-sites-${_group}) -SORTED_MASTER_SITES_${_group}_CMD= cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} master-sites-${_group} -master-sites-${_group}: - @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_MASTER_SITES_${_group}}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP} -. endif -. endfor -. endif -.endfor -.for _S in ${PATCH_SITES} -_S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//} -. if !empty(_S_TEMP) -. for _group in ${_S_TEMP:S/^://:S/,/ /g} -. if !target(patch-sites-${_group}) -SORTED_PATCH_SITES_${_group}_CMD= cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} patch-sites-${_group} -patch-sites-${_group}: - @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_PATCH_SITES_${_group}}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP} -. endif -. endfor -. endif -.endfor - -# -# Hackery to enable simple fetch targets with several dynamic MASTER_SITES -# -_MASTER_SITES_ENV= _MASTER_SITES_DEFAULT="${_MASTER_SITES_DEFAULT}" -.for _F in ${DISTFILES} -_F_TEMP= ${_F:S/^${_F:C/:[^:]+$//}//:S/^://} -. if !empty(_F_TEMP) -. for _group in ${_F_TEMP:S/,/ /g} -. if defined(_MASTER_SITES_${_group}) -_MASTER_SITES_ENV+= _MASTER_SITES_${_group}="${_MASTER_SITES_${_group}}" -. endif -. endfor -. endif -.endfor -_PATCH_SITES_ENV= _PATCH_SITES_DEFAULT="${_PATCH_SITES_DEFAULT}" -.for _F in ${PATCHFILES} -_F_TEMP= ${_F:S/^${_F:C/:[^:]+$//}//:S/^://} -. if !empty(_F_TEMP) -. for _group in ${_F_TEMP:S/,/ /g} -. if defined(_PATCH_SITES_${_group}) -_PATCH_SITES_ENV+= _PATCH_SITES_${_group}="${_PATCH_SITES_${_group}}" -. endif -. endfor -. endif -.endfor +### FIXME: shellify these targets, too master-sites-ALL: @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_MASTER_SITES_ALL}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP} ==== //depot/projects/soc2006/gabor_ports/Tools/scripts/do-fetch.sh#5 (text+ko) ==== @@ -147,6 +147,51 @@ _G_TEMP_TEMP= ALLFILES= ${_DISTFILES} ${_PATCHFILES} +# +# Sort the master site list according to the patterns in MASTER_SORT +# +MASTER_SORT_REGEX+= ${MASTER_SORT:S|.|\\.|g:S|^|://[^/]*|:S|$|/|} +MASTER_SORT_AWK= BEGIN { RS = " "; ORS = " "; IGNORECASE = 1 ; gl = "${MASTER_SORT_REGEX:S|\\|\\\\|g}"; } +.for srt in ${MASTER_SORT_REGEX} +MASTER_SORT_AWK+= /${srt:S|/|\\/|g}/ { good["${srt:S|\\|\\\\|g}"] = good["${srt:S|\\|\\\\|g}"] " " $$0 ; next; } +.endfor +MASTER_SORT_AWK+= { rest = rest " " $$0; } END { n=split(gl, gla); for(i=1;i<=n;i++) { print good[gla[i]]; } print rest; } + +SORTED_MASTER_SITES_DEFAULT_CMD= cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} master-sites-DEFAULT +SORTED_PATCH_SITES_DEFAULT_CMD= cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} patch-sites-DEFAULT +SORTED_MASTER_SITES_ALL_CMD= cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} master-sites-ALL +SORTED_PATCH_SITES_ALL_CMD= cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} patch-sites-ALL + +# Sort the master site list according to the patterns in MASTER_SORT +# according to grouping rules (:something) +# +# for use in the fetch targets +for _S in ${MASTER_SITES}; do + _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//} + if [ -n "${_S_TEMP}" ] ; then + for _group in ${_S_TEMP:S/^://:S/,/ /g}; do + SORTED_MASTER_SITES_${_group}_CMD= cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} master-sites--${_group} + ${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_MASTER_SITES_${_group}}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP} + done + fi +done + +### FIXME: thos should be convert to be done in this script itself +# +# Hackery to enable simple fetch targets with several dynamic MASTER_SITES +# +_MASTER_SITES_ENV= _MASTER_SITES_DEFAULT="${_MASTER_SITES_DEFAULT}" +.for _F in ${DISTFILES} +_F_TEMP= ${_F:S/^${_F:C/:[^:]+$//}//:S/^://} +. if !empty(_F_TEMP) +. for _group in ${_F_TEMP:S/,/ /g} +. if defined(_MASTER_SITES_${_group}) +_MASTER_SITES_ENV+= _MASTER_SITES_${_group}="${_MASTER_SITES_${_group}}" +. endif +. endfor +. endif +.endfor + ${_MASTER_SITES_ENV} for _file in ${DISTFILES}; do file=`${ECHO_CMD} $_file | ${SED} -E -e 's/:[^:]+$//'` @@ -319,6 +364,30 @@ _PATCHFILES+= ${_P} fi done +for _S in ${PATCH_SITES}; do + _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//} + if [ -n "${_S_TEMP}" ] ; then + for _group in ${_S_TEMP:S/^://:S/,/ /g}; do + SORTED_PATCH_SITES_${_group}_CMD= cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} patch-sites-${_group} + ${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_PATCH_SITES_${_group}}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP} + done + fi +done + +### FIXME: this should be convert to be done in this script itself + +_PATCH_SITES_ENV= _PATCH_SITES_DEFAULT="${_PATCH_SITES_DEFAULT}" +.for _F in ${PATCHFILES} +_F_TEMP= ${_F:S/^${_F:C/:[^:]+$//}//:S/^://} +. if !empty(_F_TEMP) +. for _group in ${_F_TEMP:S/,/ /g} +. if defined(_PATCH_SITES_${_group}) +_PATCH_SITES_ENV+= _PATCH_SITES_${_group}="${_PATCH_SITES_${_group}}" +. endif +. endfor +. endif +.endfor + cd ${_DISTDIR} ${_PATCH_SITES_ENV} for _file in ${PATCHFILES}; do
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607251648.k6PGmnp8078792>