Gentoo Archives: gentoo-commits

From: "André Erdmann" <dywi@×××××××.de>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/R_overlay:master commit in: files/hooks/
Date: Tue, 01 Apr 2014 16:38:51
Message-Id: 1396280235.5b39452838f97dd3645fb102a8f784639209ef1b.dywi@gentoo
1 commit: 5b39452838f97dd3645fb102a8f784639209ef1b
2 Author: André Erdmann <dywi <AT> mailerd <DOT> de>
3 AuthorDate: Mon Mar 31 15:37:15 2014 +0000
4 Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
5 CommitDate: Mon Mar 31 15:37:15 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=5b394528
7
8 hooks: use die_cannot_run()
9
10 ---
11 files/hooks/create-metadata-cache.sh | 4 ++--
12 files/hooks/git-commit-overlay.sh | 2 +-
13 files/hooks/git-push.sh | 2 ++
14 files/hooks/notify-desktop.sh | 2 ++
15 4 files changed, 7 insertions(+), 3 deletions(-)
16
17 diff --git a/files/hooks/create-metadata-cache.sh b/files/hooks/create-metadata-cache.sh
18 index 808f537..a406d7f 100644
19 --- a/files/hooks/create-metadata-cache.sh
20 +++ b/files/hooks/create-metadata-cache.sh
21 @@ -14,10 +14,10 @@ set -u
22 #$lf ...
23
24 : ${EGENCACHE:=egencache}
25 -#autodie qwhich "${EGENCACHE}"
26 +qwhich "${EGENCACHE}" || die_cannot_run "egencache is not available."
27
28 # a valid PORTDIR is required
29 -[ -d "${PORTDIR-}" ] || die "\$PORTDIR '${PORTDIR-}' does not exist."
30 +[ -d "${PORTDIR-}" ] || die_cannot_run "\$PORTDIR '${PORTDIR-}' does not exist."
31
32 # void cleanup()
33 #
34
35 diff --git a/files/hooks/git-commit-overlay.sh b/files/hooks/git-commit-overlay.sh
36 index 2e726fb..30aad1c 100644
37 --- a/files/hooks/git-commit-overlay.sh
38 +++ b/files/hooks/git-commit-overlay.sh
39 @@ -17,7 +17,7 @@ set -u
40
41 ## load git helper functions
42 $lf git
43 -#autodie qwhich ${GIT}
44 +qwhich "${GIT}" || die_cannot_run "git is not available."
45
46
47 ## functions
48
49 diff --git a/files/hooks/git-push.sh b/files/hooks/git-push.sh
50 index 7d79e64..d5a410a 100644
51 --- a/files/hooks/git-push.sh
52 +++ b/files/hooks/git-push.sh
53 @@ -13,6 +13,8 @@ set -u
54 # using line_iterator() from itertools
55 $lf git itertools
56
57 +qwhich "${GIT}" || die_cannot_run "git is not available."
58 +
59
60 ## functions
61
62
63 diff --git a/files/hooks/notify-desktop.sh b/files/hooks/notify-desktop.sh
64 index 9184c2f..32ae230 100644
65 --- a/files/hooks/notify-desktop.sh
66 +++ b/files/hooks/notify-desktop.sh
67 @@ -9,6 +9,8 @@ set -u
68 . "${FUNCTIONS?}" || exit
69 #dont_run_as_root
70
71 +qwhich notify-send || die_cannot_run "notify-send is not available."
72 +
73 ## load helper functions
74 #$lf ...