Page MenuHomeFreeBSD

D28946.id85206.diff
No OneTemporary

D28946.id85206.diff

Index: Mk/Scripts/do-depends.sh
===================================================================
--- Mk/Scripts/do-depends.sh
+++ Mk/Scripts/do-depends.sh
@@ -92,6 +92,24 @@
echo " - found (${libfile})"
}
+dep_err()
+{
+ echo -e "Error: $1" >&2
+ echo "Culprit is: $2" >&2
+}
+
+
+
+# Find an applicable NORUNTIME file
+noruntime_file=
+for overlay in ${dp_OVERLAYS} ${PORTSDIR}; do
+ noruntime_file="${overlay}/NORUNTIME"
+ if [ -f "${noruntime_file}" ]; then
+ break
+ fi
+done
+
+runtime_deps_regex=
anynotfound=0
err=0
for _line in ${dp_RAWDEPENDS} ; do
@@ -113,13 +131,13 @@
last=${3:-}
if [ -z "${pattern}" ]; then
- echo "Error: there is an empty port dependency in ${dp_DEPTYPE}" >&2
+ dep_err "Empty port dependency in ${dp_DEPTYPE}" ${_line}
err=1
continue
fi
if [ -z "${origin}" ]; then
- echo "Error: a dependency has an empty origin in ${dp_DEPTYPE}" >&2
+ dep_err "Dependency with empty origin in ${dp_DEPTYPE}" ${_line}
err=1
continue
fi
@@ -132,6 +150,17 @@
;;
esac
+ # Take note of runtime dependencies to check them at once
+ case ${dp_DEPTYPE} in
+ LIB_DEPENDS|RUN_DEPENDS)
+ # Not quoting ${origin} as an ERE, seems unnecessary
+ if [ -z "${runtime_deps_regex}" ]; then
+ runtime_deps_regex="${origin}"
+ else
+ runtime_deps_regex="${runtime_deps_regex}|${origin}"
+ fi;;
+ esac
+
case "${origin}" in
/*) ;;
*)
@@ -170,7 +199,7 @@
case ${pattern} in
lib*.so*) fct=find_lib ;;
*)
- echo "Error: pattern ${pattern} in LIB_DEPENDS is not valid"
+ dep_err "Pattern ${pattern} in LIB_DEPENDS is not valid" ${_line}
err=1
continue
;;
@@ -189,7 +218,7 @@
[ ${pattern} = "/nonexistent" ] || anynotfound=1
if [ ! -f "${origin}/Makefile" ]; then
- echo "Error a dependency refers to a non existing origin: ${origin} in ${dp_DEPTYPE}" >&2
+ dep_err "Dependency refers to a nonexistant origin in ${dp_DEPTYPE}" ${_line}
err=1
continue
fi
@@ -200,6 +229,22 @@
[ "${fct}" = "false" ] || ${fct} "${pattern}"
echo "===> Returning to build of ${dp_PKGNAME}"
done
+
+# Check if runtime dependencies are forbidden by NORUNTIME
+if [ -n "${noruntime_file}" -a -n "${runtime_deps_regex}" ]; then
+ cur_date=$(date -u +%F)
+ OLD_IFS=$IFS
+ IFS='|'
+ awk -F\| '$0 !~ "^[[:space:]]*#" && $1 ~ "'"${runtime_deps_regex}"'"' \
+ "${noruntime_file}" |
+ while read origin exp_date reason; do
+ if [ "${exp_date}" \< "${cur_date}" ]; then
+ dep_err "Dependency forbidden at runtime, reason: ${reason}" ${origin}
+ err=1
+ fi
+ done
+ IFS=${OLD_IFS}
+fi
if [ $err -eq 1 ]; then
echo "Errors with dependencies."
Index: NORUNTIME
===================================================================
--- /dev/null
+++ NORUNTIME
@@ -0,0 +1,23 @@
+#
+# NORUNTIME -- A list of ports that cannot be used as run-time dependencies
+#
+# $FreeBSD$
+#
+# Each entry consists of a single line containing the following three fields in
+# the order named, separated with the pipe (`|') character:
+#
+# Port: The origin of the port that can't be used at runtime
+# Date: From when the restriction will be enforced (YYYY-MM-DD, UTC)
+# Why: The reason for restricting dependencies on it
+#
+# Pipe characters are forbidden in these fields.
+#
+# Keep this list sorted in chronological order. New entries must be added at
+# the tail. Reason for the restriction should start with a capital letter and
+# not end with a dot.
+#
+# If the restriction is lifted, make sure to delete the relevant line.
+#
+# Port|Date|Why
+lang/python2|2021-03-03|EOL upstream
+lang/python27|2021-03-04|EOL upstream

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 28, 7:25 AM (10 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26277346
Default Alt Text
D28946.id85206.diff (3 KB)

Event Timeline