Date: Mon, 24 Jul 2006 15:35:03 GMT From: Gabor Kovesdan <gabor@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 102291 for review Message-ID: <200607241535.k6OFZ3fk097907@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=102291 Change 102291 by gabor@gabor_spitfire on 2006/07/24 15:34:01 Move the code that fetches patches. This doesn't actually work so far, more environmental variables have to be moved, since they can't be passed through FETCH_SCRIPT_ENV. Affected files ... .. //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#57 edit .. //depot/projects/soc2006/gabor_ports/Tools/scripts/do-fetch.sh#2 edit Differences ... ==== //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#57 (text+ko) ==== @@ -2125,7 +2125,9 @@ _MASTER_SITE_OVERRIDE="${MASTER_SITE_OVERRIDE}" \ _MASTER_SITE_BACKUP="${_MASTER_SITE_BACKUP}" MASTER_SORT_AWK="${MASTER_SORT_AWK}" \ SORTED_MASTER_SITES_DEFAULT_CMD="${SORTED_MASTER_SITES_DEFAULT_CMD}" \ - _RANDOMIZE_SITES="${_RANDOMIZE_SITES}" + _RANDOMIZE_SITES="${_RANDOMIZE_SITES}" \ + PATCHFILES="${PATCHFILES}" \ + SORTED_PATCH_SITES_DEFAULT_CMD="${SORTED_PATCH_SITES_DEFAULT_CMD}" .if exists(/usr/bin/fetch) @@ -3316,62 +3318,6 @@ .if !target(do-fetch) do-fetch: ${SETENV} ${FETCH_SCRIPT_ENV} ${SH} -x ${FETCH_SCRIPT} - -.if defined(PATCHFILES) - @(cd ${_DISTDIR}; \ - ${_PATCH_SITES_ENV} ; \ - for _file in ${PATCHFILES}; do \ - file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \ - select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \ - force_fetch=false; \ - filebasename=`${BASENAME} $$file`; \ - for afile in ${FORCE_FETCH}; do \ - afile=`${BASENAME} $$afile`; \ - if [ "x$$afile" = "x$$filebasename" ]; then \ - force_fetch=true; \ - fi; \ - done; \ - if [ ! -f $$file -a ! -f $$filebasename -o "$$force_fetch" = "true" ]; then \ - if [ -L $$file -o -L `${BASENAME} $$file` ]; then \ - ${ECHO_MSG} "=> ${_DISTDIR}/$$file is a broken symlink."; \ - ${ECHO_MSG} "=> Perhaps a filesystem (most likely a CD) isn't mounted?"; \ - ${ECHO_MSG} "=> Please correct this problem and try again."; \ - exit 1; \ - fi ; \ - ${ECHO_MSG} "=> $$file doesn't seem to exist in ${_DISTDIR}."; \ - if [ ! -z "$$select" ] ; then \ - __PATCH_SITES_TMP= ; \ - for group in $$select; do \ - if [ ! -z \$${_PATCH_SITES_$${group}} ] ; then \ - eval ___PATCH_SITES_TMP="\$${_PATCH_SITES_$${group}}" ; \ - __PATCH_SITES_TMP="$${__PATCH_SITES_TMP} $${___PATCH_SITES_TMP}" ; \ - fi \ - done; \ - ___PATCH_SITES_TMP= ; \ - SORTED_PATCH_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__PATCH_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \ - else \ - SORTED_PATCH_SITES_CMD_TMP="${SORTED_PATCH_SITES_DEFAULT_CMD}" ; \ - fi ; \ - for site in `eval $$SORTED_PATCH_SITES_CMD_TMP`; do \ - ${ECHO_MSG} "=> Attempting to fetch from $${site}."; \ - DIR=${DIST_SUBDIR}; \ - pattern="$${DIR:+$$DIR/}`${ECHO_CMD} $$file | ${SED} -e 's/\./\\\\./g'`"; \ - CKSIZE=`${GREP} "^SIZE ($$pattern)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \ - case $${file} in \ - */*) ${MKDIR} $${file%/*}; \ - args="-o $${file} $${site}$${file}";; \ - *) args=$${site}$${file};; \ - esac; \ - if ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} ${FETCH_AFTER_ARGS}; then \ - continue 2; \ - fi \ - done; \ - ${ECHO_MSG} "=> Couldn't fetch it - please try to retrieve this";\ - ${ECHO_MSG} "=> port manually into ${_DISTDIR} and try again."; \ - exit 1; \ - fi \ - done) -.endif .endif # Extract ==== //depot/projects/soc2006/gabor_ports/Tools/scripts/do-fetch.sh#2 (text+ko) ==== @@ -67,3 +67,61 @@ exit 1 fi done + +if [ -z "${PATCHFILES}" ] ; then + cd ${_DISTDIR} + ${_PATCH_SITES_ENV} + for _file in ${PATCHFILES}; do + file=`${ECHO_CMD} $_file | ${SED} -E -e 's/:[^:]+$$//'` + select=`${ECHO_CMD} ${_file#${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` + force_fetch=false + filebasename=`${BASENAME} $file` + for afile in ${FORCE_FETCH}; do + afile=`${BASENAME} $afile` + if [ "x$afile" = "x$filebasename" ]; then + force_fetch=true + fi + done + if [ ! -f $file -a ! -f $filebasename -o "$force_fetch" = "true" ]; then + if [ -L $file -o -L `${BASENAME} $file` ]; then + ${ECHO_MSG} "=> ${_DISTDIR}/$file is a broken symlink." + ${ECHO_MSG} "=> Perhaps a filesystem (most likely a CD) isn't mounted?" + ${ECHO_MSG} "=> Please correct this problem and try again." + exit 1 + fi + ${ECHO_MSG} "=> $file doesn't seem to exist in ${_DISTDIR}." + if [ ! -z "$select" ] ; then + __PATCH_SITES_TMP= + for group in $select; do + if [ ! -z $${_PATCH_SITES_${group}} ] ; then + eval ___PATCH_SITES_TMP="$${_PATCH_SITES_${group}}" + __PATCH_SITES_TMP="${__PATCH_SITES_TMP} ${___PATCH_SITES_TMP}" + fi + done + ___PATCH_SITES_TMP= + SORTED_PATCH_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} ${__PATCH_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" + else + SORTED_PATCH_SITES_CMD_TMP="${SORTED_PATCH_SITES_DEFAULT_CMD}" + fi + for site in `eval $SORTED_PATCH_SITES_CMD_TMP`; do + ${ECHO_MSG} "=> Attempting to fetch from ${site}." + DIR=${DIST_SUBDIR} + pattern="${DIR:+$DIR/}`${ECHO_CMD} $file | ${SED} -e 's/\./\\\\./g'`" + CKSIZE=`${GREP} "^SIZE ($pattern)" ${MD5_FILE} | ${AWK} '{print $4}'` + case ${file} in + */*) + ${MKDIR} ${file%/*}; \ + args="-o ${file} ${site}${file}";; + *) + args=${site}${file};; + esac + if ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${args} ${FETCH_AFTER_ARGS}; then + continue 2 + fi + done + ${ECHO_MSG} "=> Couldn't fetch it - please try to retrieve this" + ${ECHO_MSG} "=> port manually into ${_DISTDIR} and try again." + exit 1 + fi + done +fi
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607241535.k6OFZ3fk097907>