Date: Sun, 19 Jun 2016 11:24:39 +0000 (UTC) From: Mathieu Arnold <mat@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r417109 - in head/Mk: . Scripts Message-ID: <201606191124.u5JBOdSV049758@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mat Date: Sun Jun 19 11:24:39 2016 New Revision: 417109 URL: https://svnweb.freebsd.org/changeset/ports/417109 Log: Simplify do-fetch, and remove now unused code. Turns out that the DEFAULT, and other groups sites were handled in a different way, ending up having the same code twice, but in slightly different places. PR: 210198 Submitted by: mat Exp-run by: antoine Sponsored by: The FreeBSD Foundation, Absolight Differential Revision: https://reviews.freebsd.org/D6779 Modified: head/Mk/Scripts/do-fetch.sh (contents, props changed) head/Mk/bsd.port.mk (contents, props changed) Modified: head/Mk/Scripts/do-fetch.sh ============================================================================== --- head/Mk/Scripts/do-fetch.sh Sun Jun 19 10:52:21 2016 (r417108) +++ head/Mk/Scripts/do-fetch.sh Sun Jun 19 11:24:39 2016 (r417109) @@ -11,9 +11,7 @@ validate_env dp_DEVELOPER dp_DISABLE_SIZ dp_DIST_SUBDIR dp_ECHO_MSG dp_FETCH_AFTER_ARGS dp_FETCH_BEFORE_ARGS \ dp_FETCH_CMD dp_FETCH_ENV dp_FORCE_FETCH_ALL dp_FORCE_FETCH_LIST \ dp_MASTER_SITE_BACKUP dp_MASTER_SITE_OVERRIDE dp_MASTER_SORT_AWK \ - dp_NO_CHECKSUM dp_RANDOMIZE_SITES dp_SITE_FLAVOR dp_SCRIPTSDIR \ - dp_SORTED_MASTER_SITES_DEFAULT_CMD dp_SORTED_PATCH_SITES_DEFAULT_CMD \ - dp_TARGET + dp_NO_CHECKSUM dp_RANDOMIZE_SITES dp_SITE_FLAVOR dp_TARGET [ -n "${DEBUG_MK_SCRIPTS}" -o -n "${DEBUG_MK_SCRIPTS_DO_FETCH}" ] && set -x @@ -28,7 +26,7 @@ for _file in "${@}"; do # If this files has groups if [ "$_file" = "$file" ]; then - select='' + select=DEFAULT else select=$(echo "${_file##*:}" | sed -e 's/,/ /g') fi @@ -71,44 +69,34 @@ for _file in "${@}"; do fi ;; esac - if [ -n "$select" ] ; then - __MASTER_SITES_TMP= - for group in $select; do - # Disable nounset for this, it may come up empty. - set +u - eval ___MASTER_SITES_TMP="\${_${dp_SITE_FLAVOR}_SITES_${group}}" - set -u - if [ -n "${___MASTER_SITES_TMP}" ] ; then - __MASTER_SITES_TMP="${__MASTER_SITES_TMP} ${___MASTER_SITES_TMP}" - else - case ${dp_TARGET} in - do-fetch|makesum) - if [ -n "${dp_DEVELOPER}" ]; then - ${dp_ECHO_MSG} "===> /!\\ Error /!\\" - else - ${dp_ECHO_MSG} "===> /!\\ Warning /!\\" - fi - ${dp_ECHO_MSG} " The :${group} group used for $file is missing" - ${dp_ECHO_MSG} " from ${dp_SITE_FLAVOR}_SITES. Check for typos, or errors." - if [ -n "${dp_DEVELOPER}" ]; then - exit 1 - fi - ;; - esac - - fi - done - ___MASTER_SITES_TMP= - SORTED_MASTER_SITES_CMD_TMP="echo ${dp_MASTER_SITE_OVERRIDE} $(echo -n "${__MASTER_SITES_TMP}" | awk "${dp_MASTER_SORT_AWK}") ${dp_MASTER_SITE_BACKUP}" - else - if [ ${dp_SITE_FLAVOR} = "MASTER" ]; then - SORTED_MASTER_SITES_CMD_TMP="${dp_SORTED_MASTER_SITES_DEFAULT_CMD}" + __MASTER_SITES_TMP= + for group in $select; do + # Disable nounset for this, it may come up empty. + set +u + eval ___MASTER_SITES_TMP="\${_${dp_SITE_FLAVOR}_SITES_${group}}" + set -u + if [ -n "${___MASTER_SITES_TMP}" ] ; then + __MASTER_SITES_TMP="${__MASTER_SITES_TMP} ${___MASTER_SITES_TMP}" else - SORTED_MASTER_SITES_CMD_TMP="${dp_SORTED_PATCH_SITES_DEFAULT_CMD}" + case ${dp_TARGET} in + do-fetch|makesum) + if [ -n "${dp_DEVELOPER}" ]; then + ${dp_ECHO_MSG} "===> /!\\ Error /!\\" + else + ${dp_ECHO_MSG} "===> /!\\ Warning /!\\" + fi + ${dp_ECHO_MSG} " The :${group} group used for $file is missing" + ${dp_ECHO_MSG} " from ${dp_SITE_FLAVOR}_SITES. Check for typos, or errors." + if [ -n "${dp_DEVELOPER}" ]; then + exit 1 + fi + ;; + esac + fi - # Having this set when the next eval runs creates double entries. - unset _${dp_SITE_FLAVOR}_SITES_DEFAULT - fi + done + ___MASTER_SITES_TMP= + SORTED_MASTER_SITES_CMD_TMP="echo ${dp_MASTER_SITE_OVERRIDE} $(echo -n "${__MASTER_SITES_TMP}" | awk "${dp_MASTER_SORT_AWK}") ${dp_MASTER_SITE_BACKUP}" case ${dp_TARGET} in fetch-list) echo -n "mkdir -p ${dp_DISTDIR} && " Modified: head/Mk/bsd.port.mk ============================================================================== --- head/Mk/bsd.port.mk Sun Jun 19 10:52:21 2016 (r417108) +++ head/Mk/bsd.port.mk Sun Jun 19 11:24:39 2016 (r417109) @@ -2468,47 +2468,6 @@ MASTER_SORT_AWK+= /${srt:S|/|\\/|g}/ { g .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} master-sites-DEFAULT -SORTED_PATCH_SITES_DEFAULT_CMD= cd ${.CURDIR} && ${MAKE} patch-sites-DEFAULT -SORTED_MASTER_SITES_ALL_CMD= cd ${.CURDIR} && ${MAKE} master-sites-ALL -SORTED_PATCH_SITES_ALL_CMD= cd ${.CURDIR} && ${MAKE} patch-sites-ALL - -# has similar effect to old targets, i.e., access only {MASTER,PATCH}_SITES, not working with the new _n variables -master-sites-DEFAULT: - @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_MASTER_SITES_DEFAULT}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP} -patch-sites-DEFAULT: - @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_PATCH_SITES_DEFAULT}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP} - -# -# 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} 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} 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 # @@ -2535,21 +2494,6 @@ _PATCH_SITES_ENV+= _PATCH_SITES_${_group . endif .endfor -master-sites-ALL: - @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_MASTER_SITES_ALL}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP} -patch-sites-ALL: - @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_PATCH_SITES_ALL}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP} - -# synonyms, mnemonics -master-sites-all: master-sites-ALL -patch-sites-all: patch-sites-ALL -master-sites-default: master-sites-DEFAULT -patch-sites-default: patch-sites-DEFAULT - -# compatibility with old behavior -master-sites: master-sites-DEFAULT -patch-sites: patch-sites-DEFAULT - CKSUMFILES= ${ALLFILES} # List of all files, with ${DIST_SUBDIR} in front. Used for checksum. @@ -3021,7 +2965,7 @@ options-message: @${ECHO_MSG} "===> Found saved configuration for ${_OPTIONS_READ}" .endif -${PKG_DBDIR} ${PREFIX} ${WRKDIR} ${EXTRACT_WRKDIR} ${WRKSRC}: +${PKG_DBDIR} ${PREFIX} ${WRKDIR} ${EXTRACT_WRKDIR}: @${MKDIR} ${.TARGET} # Warn user about deprecated packages. Advisory only. @@ -3094,8 +3038,6 @@ _DO_FETCH_ENV= \ dp_NO_CHECKSUM='${NO_CHECKSUM}' \ dp_RANDOMIZE_SITES='${_RANDOMIZE_SITES}' \ dp_SCRIPTSDIR='${SCRIPTSDIR}' \ - dp_SORTED_MASTER_SITES_DEFAULT_CMD='${SORTED_MASTER_SITES_DEFAULT_CMD}' \ - dp_SORTED_PATCH_SITES_DEFAULT_CMD='${SORTED_PATCH_SITES_DEFAULT_CMD}' \ dp_TARGET='${.TARGET}' .if defined(DEVELOPER) _DO_FETCH_ENV+= dp_DEVELOPER=yes
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606191124.u5JBOdSV049758>