aboutsummaryrefslogtreecommitdiff
path: root/Mk/Scripts
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2019-09-03 14:36:00 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2019-09-03 14:36:00 +0000
commit7610a280b57ed2313f506799bf8afe39d74482a2 (patch)
tree74477210536a9532c246622b0b4fabbb456310d8 /Mk/Scripts
parentb425021f226d8509a5261cfa28460626d6c17399 (diff)
downloadports-7610a280b57ed2313f506799bf8afe39d74482a2.tar.gz
ports-7610a280b57ed2313f506799bf8afe39d74482a2.zip
Add support for overlays
overlays are a way to help users to integrate their own ports tree with the official ports tree without having to maintain clone of the official tree and remerge on regular basis. The ports tree will lookup in the overlays (in the order the are listed in OVERLAY variable) for the dependencies and the USES. It will use the first found. in order to use it the user have to declare his overlays that way in their make.conf: OVERLAYS= overlay1 overlay2 overlay3 Reviewed by: manu Approved by: swills Differential Revision: https://reviews.freebsd.org/D21468
Notes
Notes: svn path=/head/; revision=510950
Diffstat (limited to 'Mk/Scripts')
-rw-r--r--Mk/Scripts/depends-list.sh27
-rw-r--r--Mk/Scripts/do-depends.sh12
2 files changed, 28 insertions, 11 deletions
diff --git a/Mk/Scripts/depends-list.sh b/Mk/Scripts/depends-list.sh
index ce4f4b75a094..843bedd03958 100644
--- a/Mk/Scripts/depends-list.sh
+++ b/Mk/Scripts/depends-list.sh
@@ -37,7 +37,7 @@ while getopts "fmrw" FLAG; do
done
shift $((OPTIND-1))
-validate_env PORTSDIR dp_PKGNAME
+validate_env PORTSDIR dp_OVERLAYS dp_PKGNAME
if [ ${recursive} -eq 1 -o ${requires_wrkdir} -eq 1 ]; then
validate_env dp_MAKE
# Cache command executions to avoid looking them up again in every
@@ -65,16 +65,25 @@ check_dep() {
case "${2}" in
/*) d=${2} ;;
- *) d=${PORTSDIR}/${2} ;;
+ *) for overlay in ${dp_OVERLAYS} ${PORTSDIR}; do
+ d=${overlay}/${2}
+ f=
+ case "${d}" in
+ *@*/*) ;; # Ignore @ in the path which would not be a flavor
+ *@*)
+ f=${d##*@}
+ d=${d%@*}
+ ;;
+ esac
+ if [ -f ${d}/Makefile ]; then
+ if [ -n $f ]; then
+ export FLAVOR=$f
+ fi
+ break
+ fi
+ done
esac
- case "${d}" in
- *@*/*) ;; # Ignore @ in the path which would not be a flavor
- *@*)
- export FLAVOR=${d##*@}
- d=${d%@*}
- ;;
- esac
if [ ${flavors} -eq 1 -a -n "${FLAVOR:-}" ]; then
port_display="${d}@${FLAVOR}"
else
diff --git a/Mk/Scripts/do-depends.sh b/Mk/Scripts/do-depends.sh
index 163570052a54..af93ec646a74 100644
--- a/Mk/Scripts/do-depends.sh
+++ b/Mk/Scripts/do-depends.sh
@@ -11,7 +11,7 @@ validate_env dp_RAWDEPENDS dp_DEPTYPE dp_DEPENDS_TARGET dp_DEPENDS_PRECLEAN \
dp_DEPENDS_CLEAN dp_DEPENDS_ARGS dp_USE_PACKAGE_DEPENDS \
dp_USE_PACKAGE_DEPENDS_ONLY dp_PKG_ADD dp_PKG_INFO dp_WRKDIR \
dp_PKGNAME dp_STRICT_DEPENDS dp_LOCALBASE dp_LIB_DIRS dp_SH \
- dp_SCRIPTSDIR PORTSDIR dp_MAKE dp_MAKEFLAGS
+ dp_SCRIPTSDIR PORTSDIR dp_MAKE dp_MAKEFLAGS dp_OVERLAYS
[ -n "${DEBUG_MK_SCRIPTS}" -o -n "${DEBUG_MK_SCRIPTS_DO_DEPENDS}" ] && set -x
@@ -125,7 +125,15 @@ for _line in ${dp_RAWDEPENDS} ; do
case "${origin}" in
/*) ;;
- *) origin="${PORTSDIR}/${origin}" ;;
+ *)
+ for overlay in ${dp_OVERLAYS} ${PORTSDIR}; do
+ orig="${overlay}/${origin}"
+ if [ -f "${orig}/Makefile" ]; then
+ break
+ fi
+ done
+ origin="${orig}"
+ ;;
esac
case "${origin}" in
*@*/*) ;; # Ignore @ in the path which would not be a flavor