* [gentoo-commits] proj/R_overlay:master commit in: files/hooks/, doc/rst/, doc/html/
@ 2013-09-06 10:22 André Erdmann
0 siblings, 0 replies; only message in thread
From: André Erdmann @ 2013-09-06 10:22 UTC (permalink / raw
To: gentoo-commits
commit: cac0ebaee367d638cb7e9faf510b2aca77275051
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Fri Sep 6 09:56:14 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Fri Sep 6 10:05:00 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=cac0ebae
files/hooks/mux.sh: set $this
---
doc/html/usage.html | 7 +++++--
doc/rst/usage.rst | 5 ++++-
files/hooks/mux.sh | 14 +++++++++++++-
3 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/doc/html/usage.html b/doc/html/usage.html
index f3b8866..b5fe42f 100644
--- a/doc/html/usage.html
+++ b/doc/html/usage.html
@@ -2783,8 +2783,11 @@ when included in the hook script, most of the enviroment variables readonly.</p>
<td>name of the hook script (without file extension)</td>
</tr>
<tr><td>this</td>
-<td>initially a copy of <tt class="docutils literal">${SCRIPT_NAME}</tt>, but can be
-modified (not a constant)</td>
+<td><p class="first">initially a copy of <tt class="docutils literal">${SCRIPT_NAME}</tt>, but can be
+modified (not a constant).</p>
+<p class="last">Set to the name of the actual hook script when using
+the default event script.</p>
+</td>
</tr>
<tr><td>lf</td>
<td>reference to a function that loads additional shell
diff --git a/doc/rst/usage.rst b/doc/rst/usage.rst
index a571052..0b670fc 100644
--- a/doc/rst/usage.rst
+++ b/doc/rst/usage.rst
@@ -2350,7 +2350,10 @@ when included in the hook script, most of the enviroment variables readonly.
| SCRIPT_NAME | name of the hook script (without file extension) |
+-----------------+-------------------------------------------------------+
| this | initially a copy of ``${SCRIPT_NAME}``, but can be |
- | | modified (not a constant) |
+ | | modified (not a constant). |
+ | | |
+ | | Set to the name of the actual hook script when using |
+ | | the default event script. |
+-----------------+-------------------------------------------------------+
| lf | reference to a function that loads additional shell |
| | function files |
diff --git a/files/hooks/mux.sh b/files/hooks/mux.sh
index 80bff31..efda723 100755
--- a/files/hooks/mux.sh
+++ b/files/hooks/mux.sh
@@ -17,6 +17,7 @@ export LC_CTYPE
## load $ROVERLAY_HOOKRC (if set)
if [ -n "${ROVERLAY_HOOKRC-}" ]; then
+ veinfo "Loading hook config file '${ROVERLAY_HOOKRC}'"
. "${ROVERLAY_HOOKRC}" || \
die "failed to load ROVERLAY_HOOKRC (${ROVERLAY_HOOKRC})."
fi
@@ -32,7 +33,15 @@ do
#subshell?
#( . "${hookfile}"; ) || ...
- veinfo "Running hook '${hookfile##*/}'"
+ hookfile_name="${hookfile##*/}"
+ this="${hookfile_name#[0-9]*-}"; this="${this%.*}"
+
+ if [ -n "${this}" ]; then
+ veinfo "Running hook ${this} ('${hookfile_name}')"
+ else
+ this="${hookfile_name}"
+ veinfo "Running hook '${hookfile_name}'"
+ fi
# initial directory should always be $S
cd "${S}" && . "${hookfile}" || \
@@ -40,6 +49,9 @@ do
# restore signals
trap - INT TERM EXIT
+
+ this="${SCRIPT_NAME}"
+ unset -v hookfile_name
fi
done
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-09-06 10:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-06 10:22 [gentoo-commits] proj/R_overlay:master commit in: files/hooks/, doc/rst/, doc/html/ André Erdmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox