From 395424f90c8ca6969589905cbf86d74fae9d7ea6 Mon Sep 17 00:00:00 2001 From: Michael Haubenwallner Date: Thu, 21 Mar 2019 11:22:27 +0100 Subject: [PATCH] add prefix-stack support Similar to Prefix Guest, Prefix Stack requires a reduced baselayout. Telling the PM installed in base Prefix to actually manage the stacked Prefix is PM specific and beyond the scope of baselayout. --- Makefile | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 395d1a6..688f86b 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,9 @@ INSTALL_SECURE = install -m 0600 OS ?= EPREFIX ?= ROOT ?= +BROOT ?= +# fallback support for EAPI 6 environment +BROOT ?= $(PORTAGE_OVERRIDE_EPREFIX) ifeq ($(OS),) OS=$(shell uname -s) @@ -79,7 +82,10 @@ ETCFILES-Linux += \ etc.Linux/modprobe.d/i386.conf \ etc.Linux/sysctl.conf ETCFILES-prefix-guest += \ - gen-etc.prefix-guest/env.d/99host + gen-etc.$(OS)/env.d/99host +ETCFILES-prefix-stack += \ + $(ETCFILES-prefix-guest) \ + gen-etc.prefix-stack/env.d/00host ETCFILES = $(ETCFILES-$(OS)) \ etc/env.d/50baselayout \ etc/profile @@ -111,6 +117,16 @@ gen-etc.prefix-guest/env.d/99host: ; ! test -d '$(ROOT)/usr/share/man' || echo MANPATH=/usr/share/man \ ; } > $@ +gen-etc.prefix-stack/env.d/99host: + # Query PATH,MANPATH from base prefix + $(INSTALL_DIR) $(@D) + sed -n -E '/^export (PATH|MANPATH)=/{s/^export //;p}' '$(BROOT)'/etc/profile.env > $@ + +gen-etc.prefix-stack/env.d/00host: + # Query EDITOR,PAGER from base prefix + $(INSTALL_DIR) $(@D) + sed -n -E '/^export (EDITOR|PAGER)=/{s/^export //;p}' '$(BROOT)'/etc/profile.env > $@ + install: $(ETCFILES) $(SHAREFILES) test -n '$(DESTDIR)' instfiles= ; \