This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "theslinux-buildsystem".

The branch, _utils has been updated
       via  6c2cad3cc201aaa10366af1c1e6c0d44a9f03baa (commit)
      from  dab28fcb90d2fb181722a8ea9a655b5ef56f9883 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6c2cad3cc201aaa10366af1c1e6c0d44a9f03baa
Author: Ky-Anh Huynh <ky...@theslinux.org>
Date:   Tue Apr 15 21:24:24 2014 +0700

    00_core: Add :require function to check if programs exist

-----------------------------------------------------------------------

Summary of changes:
 _utils/lib/00_core.sh |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/_utils/lib/00_core.sh b/_utils/lib/00_core.sh
index 9a85afc..c38731e 100644
--- a/_utils/lib/00_core.sh
+++ b/_utils/lib/00_core.sh
@@ -22,6 +22,17 @@ _die() {
   exit 1
 }
 
+:require() {
+  while (( $# )); do
+    which "$1" >/dev/null 2>&1 \
+    || {
+      echo >&2 ":: Error: unable to locate '$1' program"
+      return 127
+    }
+    shift
+  done
+}
+
 # Check if a pipe is good: That one contains only zero (0) return codes.
 # NOTE: You must use this *immediately* after any pipe. Any command
 # NOTE: in Bash can be considered as a simple pipe.


hooks/post-receive
-- 
theslinux-buildsystem

--
To ubsubscribe from the list phantom@lists.theslinux.org,
please send an email to ecar...@lists.theslinux.org with subject
  ubsubscribe phantom

To get basic commands to use Ecartis system, use subject 'help'.

Reply via email to