public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "André Erdmann" <dywi@mailerd.de>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/R_overlay:master commit in: files/shlib/
Date: Fri,  6 Sep 2013 17:27:42 +0000 (UTC)	[thread overview]
Message-ID: <1378474445.e412ce185f1e516d30373edf8e1f63292c418160.dywi@gentoo> (raw)

commit:     e412ce185f1e516d30373edf8e1f63292c418160
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Fri Sep  6 13:34:05 2013 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Fri Sep  6 13:34:05 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=e412ce18

allow files/shlib/functions.sh to be used standalone

Setting FUNCTIONS_STANDALONE=y allows to use the functions file without
roverlay's hook env.

---
 files/shlib/functions.sh | 60 ++++++++++++++++++++++++++++++++++--------------
 1 file changed, 43 insertions(+), 17 deletions(-)

diff --git a/files/shlib/functions.sh b/files/shlib/functions.sh
index 405ed3a..ccf6d48 100644
--- a/files/shlib/functions.sh
+++ b/files/shlib/functions.sh
@@ -79,24 +79,50 @@
 if [ -z "${__HAVE_CORE_FUNCTIONS__-}" ]; then
 readonly __HAVE_CORE_FUNCTIONS__=y
 
-## make some env vars readonly
-
-readonly FUNCTIONS
-[ -z "${SHLIB-}"           ] || readonly SHLIB
-[ -z "${DATADIR-}"         ] || readonly DATADIR
-[ -z "${ROVERLAY_HOOKRC-}" ] || readonly ROVERLAY_HOOKRC
-
-readonly DEBUG VERBOSE QUIET NO_COLOR
-
-readonly \
-   ROVERLAY_PHASE \
-   EBUILD ROVERLAY_EXE ROVERLAY_HELPER_EXE \
-   OVERLAY S OVERLAY_NAME \
-   DISTROOT \
-   TMPDIR T \
-   ADDITIONS_DIR FILESDIR WORKDIR \
-   NOSYNC HAS_CHANGES
+if [ "${FUNCTIONS_STANDALONE:-n}" = "y" ]; then
+   : ${DEBUG:=n}
+   : ${VERBOSE:=y}
+   : ${QUIET:=n}
+   : ${NO_COLOR:=n}
+   readonly DEBUG VERBOSE QUIET NO_COLOR
+
+   : ${NOSYNC:=n}
+
+   if \
+      [ "${ROVERLAY_INSTALLED:-n}" = "y" ] || \
+      { [ -z "${ROVERLAY_INSTALLED-}" ] && [ -d /usr/share/roverlay ]; }
+   then
+      : ${ROVERLAY_INSTALLED:=y}
+      readonly DATADIR="/usr/share/roverlay"
+      SHLIB="${DATADIR}/shlib${SHLIB:+:}${SHLIB-}"
+      FUNCTIONS="${SHLIB}/functions.sh"
+   else
+      : ${ROVERLAY_INSTALLED:=n}
+      [ -z "${FUNCTIONS-}" ] || \
+         SHLIB="$(dirname "${FUNCTIONS}")${SHLIB:+:}${SHLIB-}"
+   fi
 
+else
+   ## make some env vars readonly
+   : ${FUNCTIONS?}
+
+   readonly FUNCTIONS
+   [ -z "${SHLIB-}"           ] || readonly SHLIB
+   [ -z "${DATADIR-}"         ] || readonly DATADIR
+   [ -z "${ROVERLAY_HOOKRC-}" ] || readonly ROVERLAY_HOOKRC
+
+   readonly DEBUG VERBOSE QUIET NO_COLOR
+
+   readonly \
+      ROVERLAY_PHASE \
+      EBUILD ROVERLAY_EXE ROVERLAY_HELPER_EXE \
+      OVERLAY S OVERLAY_NAME \
+      DISTROOT \
+      TMPDIR T \
+      ADDITIONS_DIR FILESDIR WORKDIR \
+      NOSYNC HAS_CHANGES
+
+fi # FUNCTIONS_STANDALONE
 
 ## vars / constants
 


             reply	other threads:[~2013-09-06 17:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-06 17:27 André Erdmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-11-14 18:24 [gentoo-commits] proj/R_overlay:master commit in: files/shlib/ André Erdmann
2013-09-23 12:34 André Erdmann
2013-09-23 12:34 André Erdmann
2013-09-06 10:22 André Erdmann
2013-09-04 12:50 André Erdmann
2013-09-04 12:50 André Erdmann
2013-09-04 12:50 André Erdmann
2013-09-04 10:16 André Erdmann
2013-08-05 11:44 André Erdmann
2013-06-30 15:58 André Erdmann
2013-06-30 15:58 André Erdmann
2013-06-22 15:24 André Erdmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1378474445.e412ce185f1e516d30373edf8e1f63292c418160.dywi@gentoo \
    --to=dywi@mailerd.de \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox