Lines 3037-3230
check-deprecated:
Link Here
|
3037 |
AUDITFILE?= ${PKG_DBDIR}/vuln.xml |
3037 |
AUDITFILE?= ${PKG_DBDIR}/vuln.xml |
3038 |
|
3038 |
|
3039 |
check-vulnerable: |
3039 |
check-vulnerable: |
3040 |
.if !defined(DISABLE_VULNERABILITIES) && !defined(PACKAGE_BUILDING) |
3040 |
.if !defined(DISABLE_VULNERABILITIES) && !defined(PACKAGE_BUILDING) \ |
3041 |
@if [ -f "${AUDITFILE}" ]; then \ |
3041 |
&& exists(${AUDITFILE}) |
3042 |
if [ -x "${PKG_BIN}" ]; then \ |
3042 |
@${SETENV} \ |
3043 |
vlist=`${PKG_BIN} audit "${PKGNAME}" || :`; \ |
3043 |
dp_ECHO_MSG="${ECHO_MSG}" \ |
3044 |
if [ "$${vlist}" = "0 problem(s) in the installed packages found." ]; then \ |
3044 |
dp_PKG_BIN="${PKG_BIN}" \ |
3045 |
vlist=""; \ |
3045 |
dp_PORTNAME="${PORTNAME}" \ |
3046 |
fi; \ |
3046 |
dp_SCRIPTSDIR="${SCRIPTSDIR}" \ |
3047 |
elif [ "${PORTNAME}" = "pkg" ]; then \ |
3047 |
${SH} ${SCRIPTSDIR}/check-vulnerable.sh |
3048 |
vlist=""; \ |
3048 |
.endif |
3049 |
fi; \ |
3049 |
|
3050 |
if [ -n "$$vlist" ]; then \ |
3050 |
_DO_FETCH_ENV= \ |
3051 |
${ECHO_MSG} "===> ${PKGNAME} has known vulnerabilities:"; \ |
3051 |
dp_DISABLE_SIZE='${DISABLE_SIZE}' \ |
3052 |
${ECHO_MSG} "$$vlist"; \ |
3052 |
dp_DISTDIR='${_DISTDIR}' \ |
3053 |
${ECHO_MSG} "=> Please update your ports tree and try again."; \ |
3053 |
dp_DISTINFO_FILE='${DISTINFO_FILE}' \ |
3054 |
${ECHO_MSG} "=> Note: Vulnerable ports are marked as such even if there is no update available."; \ |
3054 |
dp_DIST_SUBDIR='${DIST_SUBDIR}' \ |
3055 |
${ECHO_MSG} "=> If you wish to ignore this vulnerability rebuild with 'make DISABLE_VULNERABILITIES=yes'"; \ |
3055 |
dp_ECHO_MSG='${ECHO_MSG}' \ |
3056 |
exit 1; \ |
3056 |
dp_FETCH_AFTER_ARGS='${FETCH_AFTER_ARGS}' \ |
3057 |
fi; \ |
3057 |
dp_FETCH_BEFORE_ARGS='${FETCH_BEFORE_ARGS}' \ |
3058 |
fi |
3058 |
dp_FETCH_CMD='${FETCH_CMD}' \ |
3059 |
.endif |
3059 |
dp_FETCH_ENV='${FETCH_ENV}' \ |
3060 |
|
3060 |
dp_FORCE_FETCH_ALL='${FORCE_FETCH_ALL}' \ |
3061 |
# set alg to any of SIZE, SHA256 (or any other checksum algorithm): |
3061 |
dp_FORCE_FETCH_LIST='${FORCE_FETCH_LIST}' \ |
3062 |
DISTINFO_DATA?= if [ \( -n "${DISABLE_SIZE}" -a -n "${NO_CHECKSUM}" \) -o ! -f "${DISTINFO_FILE}" ]; then exit; fi; \ |
3062 |
dp_MASTER_SITE_BACKUP='${_MASTER_SITE_BACKUP}' \ |
3063 |
DIR=${DIST_SUBDIR}; ${AWK} -v alg=$$alg -v file=$${DIR:+$$DIR/}$${file} \ |
3063 |
dp_MASTER_SITE_OVERRIDE='${_MASTER_SITE_OVERRIDE}' \ |
3064 |
'$$1 == alg && $$2 == "(" file ")" {print $$4}' ${DISTINFO_FILE} |
3064 |
dp_MASTER_SORT_AWK='${MASTER_SORT_AWK}' \ |
|
|
3065 |
dp_NO_CHECKSUM='${NO_CHECKSUM}' \ |
3066 |
dp_RANDOMIZE_SITES='${_RANDOMIZE_SITES}' \ |
3067 |
dp_SCRIPTSDIR='${SCRIPTSDIR}' \ |
3068 |
dp_SORTED_MASTER_SITES_DEFAULT_CMD='${SORTED_MASTER_SITES_DEFAULT_CMD}' \ |
3069 |
dp_TARGET='${.TARGET}' |
3065 |
|
3070 |
|
3066 |
# Fetch |
3071 |
# Fetch |
3067 |
|
3072 |
|
3068 |
.if !target(do-fetch) |
3073 |
.if !target(do-fetch) |
3069 |
do-fetch: |
3074 |
do-fetch: |
3070 |
@${MKDIR} ${_DISTDIR} |
3075 |
@${SETENV} \ |
3071 |
@cd ${_DISTDIR};\ |
3076 |
${_DO_FETCH_ENV} ${_MASTER_SITES_ENV} \ |
3072 |
${_MASTER_SITES_ENV} ; \ |
3077 |
${SH} ${SCRIPTSDIR}/do-fetch.sh ${DISTFILES:C/.*/'&'/} |
3073 |
for _file in ${DISTFILES}; do \ |
|
|
3074 |
file=$${_file%%:*}; \ |
3075 |
if [ $$_file = $$file ]; then \ |
3076 |
select=''; \ |
3077 |
else \ |
3078 |
select=`${ECHO_CMD} $${_file##*:} | ${SED} -e 's/,/ /g'` ; \ |
3079 |
fi; \ |
3080 |
force_fetch=false; \ |
3081 |
filebasename=$${file##*/}; \ |
3082 |
for afile in ${FORCE_FETCH}; do \ |
3083 |
afile=$${afile##*/}; \ |
3084 |
if [ "x$$afile" = "x$$filebasename" ]; then \ |
3085 |
force_fetch=true; \ |
3086 |
fi; \ |
3087 |
done; \ |
3088 |
if [ ! -f $$file -a ! -f $$filebasename -o "$$force_fetch" = "true" ]; then \ |
3089 |
if [ -L $$file -o -L $$filebasename ]; then \ |
3090 |
${ECHO_MSG} "=> ${_DISTDIR}/$$file is a broken symlink."; \ |
3091 |
${ECHO_MSG} "=> Perhaps a filesystem (most likely a CD) isn't mounted?"; \ |
3092 |
${ECHO_MSG} "=> Please correct this problem and try again."; \ |
3093 |
exit 1; \ |
3094 |
fi; \ |
3095 |
if [ -f ${DISTINFO_FILE} -a "x${NO_CHECKSUM}" = "x" ]; then \ |
3096 |
_sha256sum=`alg=SHA256; ${DISTINFO_DATA}`; \ |
3097 |
if [ -z "$$_sha256sum" ]; then \ |
3098 |
${ECHO_MSG} "=> $${DIR:+$$DIR/}$$file is not in ${DISTINFO_FILE}."; \ |
3099 |
${ECHO_MSG} "=> Either ${DISTINFO_FILE} is out of date, or"; \ |
3100 |
${ECHO_MSG} "=> $${DIR:+$$DIR/}$$file is spelled incorrectly."; \ |
3101 |
exit 1; \ |
3102 |
fi; \ |
3103 |
fi; \ |
3104 |
${ECHO_MSG} "=> $$file doesn't seem to exist in ${_DISTDIR}."; \ |
3105 |
if [ ! -w ${_DISTDIR} ]; then \ |
3106 |
${ECHO_MSG} "=> ${_DISTDIR} is not writable by you; cannot fetch."; \ |
3107 |
exit 1; \ |
3108 |
fi; \ |
3109 |
if [ ! -z "$$select" ] ; then \ |
3110 |
__MASTER_SITES_TMP= ; \ |
3111 |
for group in $$select; do \ |
3112 |
if [ ! -z \$${_MASTER_SITES_$${group}} ] ; then \ |
3113 |
eval ___MASTER_SITES_TMP="\$${_MASTER_SITES_$${group}}" ; \ |
3114 |
__MASTER_SITES_TMP="$${__MASTER_SITES_TMP} $${___MASTER_SITES_TMP}" ; \ |
3115 |
fi; \ |
3116 |
done; \ |
3117 |
___MASTER_SITES_TMP= ; \ |
3118 |
SORTED_MASTER_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__MASTER_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \ |
3119 |
else \ |
3120 |
SORTED_MASTER_SITES_CMD_TMP="${SORTED_MASTER_SITES_DEFAULT_CMD}" ; \ |
3121 |
fi; \ |
3122 |
sites_remaining=0; \ |
3123 |
sites="`eval $$SORTED_MASTER_SITES_CMD_TMP ${_RANDOMIZE_SITES}`"; \ |
3124 |
for site in $${sites}; do \ |
3125 |
sites_remaining=$$(($${sites_remaining} + 1)); \ |
3126 |
done; \ |
3127 |
for site in $${sites}; do \ |
3128 |
sites_remaining=$$(($${sites_remaining} - 1)); \ |
3129 |
${ECHO_MSG} "=> Attempting to fetch $${site}$${file}"; \ |
3130 |
CKSIZE=`alg=SIZE; ${DISTINFO_DATA}`; \ |
3131 |
case $${file} in \ |
3132 |
*/*) ${MKDIR} $${file%/*}; \ |
3133 |
args="-o $${file} $${site}$${file}";; \ |
3134 |
*) args=$${site}$${file};; \ |
3135 |
esac; \ |
3136 |
if ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} ${FETCH_AFTER_ARGS}; then \ |
3137 |
actual_size=`stat -f %z "$${file}"`; \ |
3138 |
if [ -n "${DISABLE_SIZE}" ] || [ -z "$${CKSIZE}" ] || [ $${actual_size} -eq $${CKSIZE} ]; then \ |
3139 |
continue 2; \ |
3140 |
else \ |
3141 |
${ECHO_MSG} "=> Fetched file size mismatch (expected $${CKSIZE}, actual $${actual_size})"; \ |
3142 |
if [ $${sites_remaining} -gt 0 ]; then \ |
3143 |
${ECHO_MSG} "=> Trying next site"; \ |
3144 |
${RM} -f $${file}; \ |
3145 |
fi; \ |
3146 |
fi; \ |
3147 |
fi; \ |
3148 |
done; \ |
3149 |
${ECHO_MSG} "=> Couldn't fetch it - please try to retrieve this";\ |
3150 |
${ECHO_MSG} "=> port manually into ${_DISTDIR} and try again."; \ |
3151 |
exit 1; \ |
3152 |
fi; \ |
3153 |
done |
3154 |
.if defined(PATCHFILES) |
3078 |
.if defined(PATCHFILES) |
3155 |
@cd ${_DISTDIR};\ |
3079 |
@${SETENV} \ |
3156 |
${_PATCH_SITES_ENV} ; \ |
3080 |
${_DO_FETCH_ENV} ${_PATCH_SITES_ENV} \ |
3157 |
for _file in ${PATCHFILES}; do \ |
3081 |
${SH} ${SCRIPTSDIR}/do-fetch.sh ${PATCHFILES:C/.*/'&'/} |
3158 |
file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^-:][^:]*$$//'` ; \ |
|
|
3159 |
if [ $$_file = $$file ]; then \ |
3160 |
select=''; \ |
3161 |
else \ |
3162 |
select=`${ECHO_CMD} $${_file##*:} | ${SED} -e 's/,/ /g'` ; \ |
3163 |
fi; \ |
3164 |
file=`${ECHO_CMD} $$file | ${SED} -E -e 's/:-[^:]+$$//'` ; \ |
3165 |
force_fetch=false; \ |
3166 |
filebasename=$${file##*/}; \ |
3167 |
for afile in ${FORCE_FETCH}; do \ |
3168 |
afile=$${afile##*/}; \ |
3169 |
if [ "x$$afile" = "x$$filebasename" ]; then \ |
3170 |
force_fetch=true; \ |
3171 |
fi; \ |
3172 |
done; \ |
3173 |
if [ ! -f $$file -a ! -f $$filebasename -o "$$force_fetch" = "true" ]; then \ |
3174 |
if [ -L $$file -o -L $${file##*/} ]; then \ |
3175 |
${ECHO_MSG} "=> ${_DISTDIR}/$$file is a broken symlink."; \ |
3176 |
${ECHO_MSG} "=> Perhaps a filesystem (most likely a CD) isn't mounted?"; \ |
3177 |
${ECHO_MSG} "=> Please correct this problem and try again."; \ |
3178 |
exit 1; \ |
3179 |
fi; \ |
3180 |
${ECHO_MSG} "=> $$file doesn't seem to exist in ${_DISTDIR}."; \ |
3181 |
if [ ! -z "$$select" ] ; then \ |
3182 |
__PATCH_SITES_TMP= ; \ |
3183 |
for group in $$select; do \ |
3184 |
if [ ! -z \$${_PATCH_SITES_$${group}} ] ; then \ |
3185 |
eval ___PATCH_SITES_TMP="\$${_PATCH_SITES_$${group}}" ; \ |
3186 |
__PATCH_SITES_TMP="$${__PATCH_SITES_TMP} $${___PATCH_SITES_TMP}" ; \ |
3187 |
fi; \ |
3188 |
done; \ |
3189 |
___PATCH_SITES_TMP= ; \ |
3190 |
SORTED_PATCH_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__PATCH_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \ |
3191 |
else \ |
3192 |
SORTED_PATCH_SITES_CMD_TMP="${SORTED_PATCH_SITES_DEFAULT_CMD}" ; \ |
3193 |
fi; \ |
3194 |
sites_remaining=0; \ |
3195 |
sites="`eval $$SORTED_PATCH_SITES_CMD_TMP`"; \ |
3196 |
for site in $${sites}; do \ |
3197 |
sites_remaining=$$(($${sites_remaining} + 1)); \ |
3198 |
done; \ |
3199 |
for site in $${sites}; do \ |
3200 |
sites_remaining=$$(($${sites_remaining} - 1)); \ |
3201 |
${ECHO_MSG} "=> Attempting to fetch $${site}$${file}"; \ |
3202 |
CKSIZE=`alg=SIZE; ${DISTINFO_DATA}`; \ |
3203 |
case $${file} in \ |
3204 |
*/*) ${MKDIR} $${file%/*}; \ |
3205 |
args="-o $${file} $${site}$${file}";; \ |
3206 |
*) args=$${site}$${file};; \ |
3207 |
esac; \ |
3208 |
if ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} ${FETCH_AFTER_ARGS}; then \ |
3209 |
actual_size=`stat -f %z "$${file}"`; \ |
3210 |
if [ -n "${DISABLE_SIZE}" ] || [ -z "$${CKSIZE}" ] || [ $${actual_size} -eq $${CKSIZE} ]; then \ |
3211 |
continue 2; \ |
3212 |
else \ |
3213 |
${ECHO_MSG} "=> Fetched file size mismatch (expected $${CKSIZE}, actual $${actual_size})"; \ |
3214 |
if [ $${sites_remaining} -gt 1 ]; then \ |
3215 |
${ECHO_MSG} "=> Trying next site"; \ |
3216 |
${RM} -f $${file}; \ |
3217 |
fi; \ |
3218 |
fi; \ |
3219 |
fi; \ |
3220 |
done; \ |
3221 |
${ECHO_MSG} "=> Couldn't fetch it - please try to retrieve this";\ |
3222 |
${ECHO_MSG} "=> port manually into ${_DISTDIR} and try again."; \ |
3223 |
exit 1; \ |
3224 |
fi; \ |
3225 |
done |
3226 |
.endif |
3082 |
.endif |
3227 |
.endif |
3083 |
.endif |
|
|
3084 |
# |
3085 |
# Prints out a list of files to fetch (useful to do a batch fetch) |
3086 |
|
3087 |
.if !target(fetch-list) |
3088 |
fetch-list: |
3089 |
@${SETENV} \ |
3090 |
${_DO_FETCH_ENV} ${_MASTER_SITES_ENV} \ |
3091 |
${SH} ${SCRIPTSDIR}/do-fetch.sh ${DISTFILES:C/.*/'&'/} |
3092 |
.if defined(PATCHFILES) |
3093 |
@${SETENV} \ |
3094 |
${_DO_FETCH_ENV} ${_PATCH_SITES_ENV} \ |
3095 |
${SH} ${SCRIPTSDIR}/do-fetch.sh ${PATCHFILES:C/.*/'&'/} |
3096 |
.endif |
3097 |
.endif |
3098 |
|
3099 |
# Used by fetch-urlall-list and fetch-url-list |
3100 |
|
3101 |
.if !target(fetch-url-list-int) |
3102 |
fetch-url-list-int: |
3103 |
@${SETENV} \ |
3104 |
${_DO_FETCH_ENV} ${_MASTER_SITES_ENV} \ |
3105 |
${SH} ${SCRIPTSDIR}/do-fetch.sh ${DISTFILES:C/.*/'&'/} |
3106 |
.if defined(PATCHFILES) |
3107 |
@${SETENV} \ |
3108 |
${_DO_FETCH_ENV} ${_PATCH_SITES_ENV} \ |
3109 |
${SH} ${SCRIPTSDIR}/do-fetch.sh ${PATCHFILES:C/.*/'&'/} |
3110 |
.endif |
3111 |
.endif |
3112 |
|
3113 |
# Prints out all the URL for all the DISTFILES and PATCHFILES. |
3114 |
|
3115 |
.if !target(fetch-urlall-list) |
3116 |
fetch-urlall-list: |
3117 |
@cd ${.CURDIR} && ${SETENV} FORCE_FETCH_ALL=yes ${MAKE} fetch-url-list-int |
3118 |
.endif |
3119 |
|
3120 |
# Prints the URL for all the DISTFILES and PATCHFILES that are not here |
3121 |
|
3122 |
.if !target(fetch-url-list) |
3123 |
fetch-url-list: fetch-url-list-int |
3124 |
.endif |
3125 |
|
3228 |
|
3126 |
|
3229 |
# Extract |
3127 |
# Extract |
3230 |
|
3128 |
|
Lines 3943-4118
delete-distfiles-list:
Link Here
|
3943 |
.endif |
3841 |
.endif |
3944 |
.endif |
3842 |
.endif |
3945 |
|
3843 |
|
3946 |
# Prints out a list of files to fetch (useful to do a batch fetch) |
|
|
3947 |
|
3948 |
.if !target(fetch-list) |
3949 |
fetch-list: |
3950 |
@${MKDIR} ${_DISTDIR} |
3951 |
@(cd ${_DISTDIR}; \ |
3952 |
${_MASTER_SITES_ENV} ; \ |
3953 |
for _file in ${DISTFILES}; do \ |
3954 |
file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \ |
3955 |
if [ $$_file = $$file ]; then \ |
3956 |
select=''; \ |
3957 |
else \ |
3958 |
select=`${ECHO_CMD} $${_file##*:} | ${SED} -e 's/,/ /g'` ; \ |
3959 |
fi; \ |
3960 |
if [ ! -f $$file -a ! -f $${file##*/} ]; then \ |
3961 |
if [ ! -z "$$select" ] ; then \ |
3962 |
__MASTER_SITES_TMP= ; \ |
3963 |
for group in $$select; do \ |
3964 |
if [ ! -z \$${_MASTER_SITES_$${group}} ] ; then \ |
3965 |
eval ___MASTER_SITES_TMP=\$${_MASTER_SITES_$${group}} ; \ |
3966 |
__MASTER_SITES_TMP="$${__MASTER_SITES_TMP} $${___MASTER_SITES_TMP}" ; \ |
3967 |
fi; \ |
3968 |
done; \ |
3969 |
___MASTER_SITES_TMP= ; \ |
3970 |
SORTED_MASTER_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__MASTER_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \ |
3971 |
else \ |
3972 |
SORTED_MASTER_SITES_CMD_TMP="${SORTED_MASTER_SITES_DEFAULT_CMD}" ; \ |
3973 |
fi; \ |
3974 |
${ECHO_CMD} -n ${MKDIR} ${_DISTDIR} '&& ' ; \ |
3975 |
${ECHO_CMD} -n cd ${_DISTDIR} '&& { ' ; \ |
3976 |
for site in `eval $$SORTED_MASTER_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do \ |
3977 |
if [ ! -z "`${ECHO_CMD} ${NOFETCHFILES} | ${GREP} -w $${file}`" ]; then \ |
3978 |
if [ -z "`${ECHO_CMD} ${MASTER_SITE_OVERRIDE} | ${GREP} -w $${site}`" ]; then \ |
3979 |
continue; \ |
3980 |
fi; \ |
3981 |
fi; \ |
3982 |
CKSIZE=`alg=SIZE; ${DISTINFO_DATA}`; \ |
3983 |
case $${file} in \ |
3984 |
*/*) args="-o $${file} $${site}$${file}";; \ |
3985 |
*) args=$${site}$${file};; \ |
3986 |
esac; \ |
3987 |
${ECHO_CMD} -n ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} "${FETCH_AFTER_ARGS}" '|| ' ; \ |
3988 |
done; \ |
3989 |
${ECHO_CMD} "${ECHO_CMD} $${file} not fetched; }" ; \ |
3990 |
fi; \ |
3991 |
done) |
3992 |
.if defined(PATCHFILES) |
3993 |
@(cd ${_DISTDIR}; \ |
3994 |
${_PATCH_SITES_ENV} ; \ |
3995 |
for _file in ${PATCHFILES}; do \ |
3996 |
file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^-:][^:]*$$//'` ; \ |
3997 |
if [ $$_file = $$file ]; then \ |
3998 |
select=''; \ |
3999 |
else \ |
4000 |
select=`${ECHO_CMD} $${_file##*:} | ${SED} -e 's/,/ /g'` ; \ |
4001 |
fi; \ |
4002 |
file=`${ECHO_CMD} $$file | ${SED} -E -e 's/:-[^:]+$$//'` ; \ |
4003 |
if [ ! -f $$file -a ! -f $${file##*/} ]; then \ |
4004 |
if [ ! -z "$$select" ] ; then \ |
4005 |
__PATCH_SITES_TMP= ; \ |
4006 |
for group in $$select; do \ |
4007 |
if [ ! -z \$${_PATCH_SITES_$${group}} ] ; then \ |
4008 |
eval ___PATCH_SITES_TMP=\$${_PATCH_SITES_$${group}} ; \ |
4009 |
__PATCH_SITES_TMP="$${__PATCH_SITES_TMP} $${___PATCH_SITES_TMP}" ; \ |
4010 |
fi; \ |
4011 |
done; \ |
4012 |
___PATCH_SITES_TMP= ; \ |
4013 |
SORTED_PATCH_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__PATCH_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \ |
4014 |
else \ |
4015 |
SORTED_PATCH_SITES_CMD_TMP="${SORTED_PATCH_SITES_DEFAULT_CMD}" ; \ |
4016 |
fi; \ |
4017 |
${ECHO_CMD} -n ${MKDIR} ${_DISTDIR} '&& ' ; \ |
4018 |
${ECHO_CMD} -n cd ${_DISTDIR} '&& { ' ; \ |
4019 |
for site in `eval $$SORTED_PATCH_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do \ |
4020 |
CKSIZE=`alg=SIZE; ${DISTINFO_DATA}`; \ |
4021 |
case $${file} in \ |
4022 |
*/*) args="-o $${file} $${site}$${file}";; \ |
4023 |
*) args=$${site}$${file};; \ |
4024 |
esac; \ |
4025 |
${ECHO_CMD} -n ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} "${FETCH_AFTER_ARGS}" '|| ' ; \ |
4026 |
done; \ |
4027 |
${ECHO_CMD} "${ECHO_CMD} $${file} not fetched; }" ; \ |
4028 |
fi; \ |
4029 |
done) |
4030 |
.endif |
4031 |
.endif |
4032 |
|
4033 |
.if !target(fetch-url-list-int) |
4034 |
fetch-url-list-int: |
4035 |
@${MKDIR} ${_DISTDIR} |
4036 |
@(cd ${_DISTDIR}; \ |
4037 |
${_MASTER_SITES_ENV}; \ |
4038 |
for _file in ${DISTFILES}; do \ |
4039 |
file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \ |
4040 |
fileptn=`${ECHO_CMD} $$file | ${SED} 's|/|\\\\/|g;s/\./\\\\./g;s/\+/\\\\+/g;s/\?/\\\\?/g'` ; \ |
4041 |
if [ $$_file = $$file ]; then \ |
4042 |
select=''; \ |
4043 |
else \ |
4044 |
select=`${ECHO_CMD} $${_file##*:} | ${SED} -e 's/,/ /g'` ; \ |
4045 |
fi; \ |
4046 |
if [ ! -z "${LISTALL}" -o ! -f $$file -a ! -f $${file##*/} ]; then \ |
4047 |
if [ ! -z "$$select" ] ; then \ |
4048 |
__MASTER_SITES_TMP= ; \ |
4049 |
for group in $$select; do \ |
4050 |
if [ ! -z \$${_MASTER_SITES_$${group}} ] ; then \ |
4051 |
eval ___MASTER_SITES_TMP=\$${_MASTER_SITES_$${group}} ; \ |
4052 |
__MASTER_SITES_TMP="$${__MASTER_SITES_TMP} $${___MASTER_SITES_TMP}" ; \ |
4053 |
fi \ |
4054 |
done; \ |
4055 |
___MASTER_SITES_TMP= ; \ |
4056 |
SORTED_MASTER_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__MASTER_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \ |
4057 |
else \ |
4058 |
SORTED_MASTER_SITES_CMD_TMP="${SORTED_MASTER_SITES_DEFAULT_CMD}" ; \ |
4059 |
fi ; \ |
4060 |
for site in `eval $$SORTED_MASTER_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do \ |
4061 |
case $${file} in \ |
4062 |
*/*) args="-o $${file} $${site}$${file}";; \ |
4063 |
*) args=$${site}$${file};; \ |
4064 |
esac; \ |
4065 |
${ECHO_CMD} $${args} ; \ |
4066 |
done; \ |
4067 |
fi \ |
4068 |
done) |
4069 |
.if defined(PATCHFILES) |
4070 |
@(cd ${_DISTDIR}; \ |
4071 |
${_PATCH_SITES_ENV} ; \ |
4072 |
for _file in ${PATCHFILES}; do \ |
4073 |
file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^-:][^:]*$$//'` ; \ |
4074 |
if [ $$_file = $$file ]; then \ |
4075 |
select=''; \ |
4076 |
else \ |
4077 |
select=`${ECHO_CMD} $${_file##*:} | ${SED} -e 's/,/ /g'` ; \ |
4078 |
fi; \ |
4079 |
file=`${ECHO_CMD} $$file | ${SED} -E -e 's/:-[^:]+$$//'` ; \ |
4080 |
fileptn=`${ECHO_CMD} $$file | ${SED} 's|/|\\\\/|g;s/\./\\\\./g;s/\+/\\\\+/g;s/\?/\\\\?/g'` ; \ |
4081 |
if [ ! -z "${LISTALL}" -o ! -f $$file -a ! -f $${file##*/} ]; then \ |
4082 |
if [ ! -z "$$select" ] ; then \ |
4083 |
__PATCH_SITES_TMP= ; \ |
4084 |
for group in $$select; do \ |
4085 |
if [ ! -z \$${_PATCH_SITES_$${group}} ] ; then \ |
4086 |
eval ___PATCH_SITES_TMP=\$${_PATCH_SITES_$${group}} ; \ |
4087 |
__PATCH_SITES_TMP="$${__PATCH_SITES_TMP} $${___PATCH_SITES_TMP}" ; \ |
4088 |
fi \ |
4089 |
done; \ |
4090 |
___PATCH_SITES_TMP= ; \ |
4091 |
SORTED_PATCH_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__PATCH_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \ |
4092 |
else \ |
4093 |
SORTED_PATCH_SITES_CMD_TMP="${SORTED_PATCH_SITES_DEFAULT_CMD}" ; \ |
4094 |
fi ; \ |
4095 |
for site in `eval $$SORTED_PATCH_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do \ |
4096 |
case $${file} in \ |
4097 |
*/*) args="-o $${file} $${site}$${file}";; \ |
4098 |
*) args=$${site}$${file};; \ |
4099 |
esac; \ |
4100 |
${ECHO_CMD} $${args} ; \ |
4101 |
done; \ |
4102 |
fi \ |
4103 |
done) |
4104 |
.endif |
4105 |
.endif |
4106 |
|
4107 |
.if !target(fetch-urlall-list) |
4108 |
fetch-urlall-list: |
4109 |
@cd ${.CURDIR} && LISTALL=yes ${MAKE} fetch-url-list-int |
4110 |
.endif |
4111 |
|
4112 |
.if !target(fetch-url-list) |
4113 |
fetch-url-list: fetch-url-list-int |
4114 |
.endif |
4115 |
|
4116 |
# Generates patches. |
3844 |
# Generates patches. |
4117 |
|
3845 |
|
4118 |
update-patches: |
3846 |
update-patches: |
Lines 4128-4250
update-patches:
Link Here
|
4128 |
|
3856 |
|
4129 |
# Checksumming utilities |
3857 |
# Checksumming utilities |
4130 |
|
3858 |
|
4131 |
check-checksum-algorithms: |
3859 |
# List all algorithms here, all the variables name must begin with dp_ |
4132 |
@ \ |
3860 |
_CHECKSUM_INIT_ENV= \ |
4133 |
${checksum_init} \ |
3861 |
dp_SHA256=${SHA256} |
4134 |
\ |
|
|
4135 |
for alg in ${CHECKSUM_ALGORITHMS:tu}; do \ |
4136 |
eval alg_executable=\$$$$alg; \ |
4137 |
if [ -z "$$alg_executable" ]; then \ |
4138 |
${ECHO_MSG} "Checksum algorithm $$alg: Couldn't find the executable."; \ |
4139 |
${ECHO_MSG} "Set $$alg=/path/to/$$alg in /etc/make.conf and try again."; \ |
4140 |
exit 1; \ |
4141 |
fi; \ |
4142 |
done; \ |
4143 |
|
4144 |
checksum_init=\ |
4145 |
SHA256=${SHA256}; |
4146 |
|
3862 |
|
4147 |
.if !target(makesum) |
3863 |
.if !target(makesum) |
4148 |
makesum: check-checksum-algorithms |
3864 |
# Some port change the options with OPTIONS_*_FORCE when make(makesum) to be |
4149 |
@cd ${.CURDIR} && ${MAKE} fetch NO_CHECKSUM=yes \ |
3865 |
# able to add all distfiles in one go. |
4150 |
DISABLE_SIZE=yes |
3866 |
# For this to work, we need to call the do-fetch script directly here so that |
4151 |
@if [ -f ${DISTINFO_FILE} ]; then ${CAT} /dev/null > ${DISTINFO_FILE}; fi |
3867 |
# the options consistent when fetching and when makesum'ing. |
4152 |
@( \ |
3868 |
# As we're fetching new distfiles, that are not in the distinfo file, disable |
4153 |
cd ${DISTDIR}; \ |
3869 |
# checksum and sizes checks. |
4154 |
\ |
3870 |
makesum: |
4155 |
${checksum_init} \ |
3871 |
@${SETENV} \ |
4156 |
\ |
3872 |
${_DO_FETCH_ENV} ${_MASTER_SITES_ENV} \ |
4157 |
for file in ${_CKSUMFILES}; do \ |
3873 |
dp_NO_CHECKSUM=yes dp_DISABLE_SIZE=yes \ |
4158 |
for alg in ${CHECKSUM_ALGORITHMS:tu}; do \ |
3874 |
${SH} ${SCRIPTSDIR}/do-fetch.sh ${DISTFILES:C/.*/'&'/} |
4159 |
eval alg_executable=\$$$$alg; \ |
3875 |
.if defined(PATCHFILES) |
4160 |
\ |
3876 |
@${SETENV} \ |
4161 |
if [ $$alg_executable != "NO" ]; then \ |
3877 |
${_DO_FETCH_ENV} ${_PATCH_SITES_ENV} \ |
4162 |
$$alg_executable $$file >> ${DISTINFO_FILE}; \ |
3878 |
dp_NO_CHECKSUM=yes dp_DISABLE_SIZE=yes \ |
4163 |
fi; \ |
3879 |
${SH} ${SCRIPTSDIR}/do-fetch.sh ${PATCHFILES:C/.*/'&'/} |
4164 |
done; \ |
3880 |
.endif |
4165 |
${ECHO_CMD} "SIZE ($$file) = `${STAT} -f \"%z\" $$file`" >> ${DISTINFO_FILE}; \ |
3881 |
@${SETENV} \ |
4166 |
done \ |
3882 |
${_CHECKSUM_INIT_ENV} \ |
4167 |
) |
3883 |
dp_CHECKSUM_ALGORITHMS='${CHECKSUM_ALGORITHMS:tu}' \ |
|
|
3884 |
dp_CKSUMFILES='${_CKSUMFILES}' \ |
3885 |
dp_DISTDIR='${DISTDIR}' \ |
3886 |
dp_DISTINFO_FILE='${DISTINFO_FILE}' \ |
3887 |
dp_ECHO_MSG='${ECHO_MSG}' \ |
3888 |
dp_SCRIPTSDIR='${SCRIPTSDIR}' \ |
3889 |
${SH} ${SCRIPTSDIR}/makesum.sh ${DISTFILES:C/.*/'&'/} |
4168 |
.endif |
3890 |
.endif |
4169 |
|
3891 |
|
4170 |
.if !target(checksum) |
3892 |
.if !target(checksum) |
4171 |
checksum: fetch check-checksum-algorithms |
3893 |
checksum: fetch |
4172 |
@set -e ; \ |
3894 |
@${SETENV} \ |
4173 |
${checksum_init} \ |
3895 |
${_CHECKSUM_INIT_ENV} \ |
4174 |
if [ -f ${DISTINFO_FILE} ]; then \ |
3896 |
dp_CHECKSUM_ALGORITHMS='${CHECKSUM_ALGORITHMS:tu}' \ |
4175 |
cd ${DISTDIR}; OK="";\ |
3897 |
dp_CURDIR='${.CURDIR}' \ |
4176 |
for file in ${_CKSUMFILES}; do \ |
3898 |
dp_DISTDIR='${DISTDIR}' \ |
4177 |
ignored="true"; \ |
3899 |
dp_DISTINFO_FILE='${DISTINFO_FILE}' \ |
4178 |
_file=$${file#${DIST_SUBDIR}/*}; \ |
3900 |
dp_DIST_SUBDIR='${DIST_SUBDIR}' \ |
4179 |
for alg in ${CHECKSUM_ALGORITHMS:tu}; do \ |
3901 |
dp_ECHO_MSG='${ECHO_MSG}' \ |
4180 |
ignore="false"; \ |
3902 |
dp_FETCH_REGET='${FETCH_REGET}' \ |
4181 |
eval alg_executable=\$$$$alg; \ |
3903 |
dp_MAKE='${MAKE}' \ |
4182 |
\ |
3904 |
dp_MAKEFLAGS='${.MAKEFLAGS}' \ |
4183 |
if [ $$alg_executable != "NO" ]; then \ |
3905 |
dp_SCRIPTSDIR='${SCRIPTSDIR}' \ |
4184 |
MKSUM=`$$alg_executable < $$file`; \ |
3906 |
dp_DISABLE_SIZE='${DISABLE_SIZE}' \ |
4185 |
CKSUM=`file=$$_file; ${DISTINFO_DATA}`; \ |
3907 |
dp_NO_CHECKSUM='${NO_CHECKSUM}' \ |
4186 |
else \ |
3908 |
${SH} ${SCRIPTSDIR}/checksum.sh ${_CKSUMFILES:C/.*/'&'/} |
4187 |
ignore="true"; \ |
3909 |
|
4188 |
fi; \ |
|
|
4189 |
\ |
4190 |
if [ $$ignore = "false" -a -z "$$CKSUM" ]; then \ |
4191 |
${ECHO_MSG} "=> No $$alg checksum recorded for $$file."; \ |
4192 |
ignore="true"; \ |
4193 |
fi; \ |
4194 |
\ |
4195 |
if [ $$ignore = "false" ]; then \ |
4196 |
match="false"; \ |
4197 |
for chksum in $$CKSUM; do \ |
4198 |
if [ "$$chksum" = "$$MKSUM" ]; then \ |
4199 |
match="true"; \ |
4200 |
break; \ |
4201 |
fi; \ |
4202 |
done; \ |
4203 |
if [ $$match = "true" ]; then \ |
4204 |
${ECHO_MSG} "=> $$alg Checksum OK for $$file."; \ |
4205 |
ignored="false"; \ |
4206 |
else \ |
4207 |
${ECHO_MSG} "=> $$alg Checksum mismatch for $$file."; \ |
4208 |
refetchlist="$$refetchlist$$file "; \ |
4209 |
OK="$${OK:-retry}"; \ |
4210 |
[ "$${OK}" = "retry" -a ${FETCH_REGET} -gt 0 ] && ${RM} -f $${file}; \ |
4211 |
ignored="false"; \ |
4212 |
fi; \ |
4213 |
fi; \ |
4214 |
done; \ |
4215 |
\ |
4216 |
if [ $$ignored = "true" ]; then \ |
4217 |
${ECHO_MSG} "=> No suitable checksum found for $$file."; \ |
4218 |
OK="${FALSE}"; \ |
4219 |
fi; \ |
4220 |
\ |
4221 |
done; \ |
4222 |
\ |
4223 |
if [ "$${OK:=true}" = "retry" ] && [ ${FETCH_REGET} -gt 0 ]; then \ |
4224 |
${ECHO_MSG} "===> Refetch for ${FETCH_REGET} more times files: $$refetchlist"; \ |
4225 |
if ( cd ${.CURDIR} && \ |
4226 |
${MAKE} ${.MAKEFLAGS} FORCE_FETCH="$$refetchlist" FETCH_REGET="`${EXPR} ${FETCH_REGET} - 1`" fetch); then \ |
4227 |
if ( cd ${.CURDIR} && \ |
4228 |
${MAKE} ${.MAKEFLAGS} FETCH_REGET="`${EXPR} ${FETCH_REGET} - 1`" checksum ); then \ |
4229 |
OK="true"; \ |
4230 |
fi; \ |
4231 |
fi; \ |
4232 |
fi; \ |
4233 |
\ |
4234 |
if [ "$$OK" != "true" -a ${FETCH_REGET} -eq 0 ]; then \ |
4235 |
${ECHO_MSG} "===> Giving up on fetching files: $$refetchlist"; \ |
4236 |
${ECHO_MSG} "Make sure the Makefile and distinfo file (${DISTINFO_FILE})"; \ |
4237 |
${ECHO_MSG} "are up to date. If you are absolutely sure you want to override this"; \ |
4238 |
${ECHO_MSG} "check, type \"make NO_CHECKSUM=yes [other args]\"."; \ |
4239 |
exit 1; \ |
4240 |
fi; \ |
4241 |
if [ "$$OK" != "true" ]; then \ |
4242 |
exit 1; \ |
4243 |
fi; \ |
4244 |
elif [ -n "${_CKSUMFILES:M*}" ]; then \ |
4245 |
${ECHO_MSG} "=> No checksum file (${DISTINFO_FILE})."; \ |
4246 |
exit 1; \ |
4247 |
fi |
4248 |
.endif |
3910 |
.endif |
4249 |
|
3911 |
|
4250 |
################################################################ |
3912 |
################################################################ |