summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Walker <ka0ttic@gentoo.org>2005-04-08 15:56:39 +0000
committerAaron Walker <ka0ttic@gentoo.org>2005-04-08 15:56:39 +0000
commitb8aaa81bee6c71f8eaede4b501652e1c917be137 (patch)
tree9f861b1853283d457ae6a735ba97d3b6a90c78f2
parentFix actionre (diff)
downloadgentoo-bashcomp-b8aaa81bee6c71f8eaede4b501652e1c917be137.tar.gz
gentoo-bashcomp-b8aaa81bee6c71f8eaede4b501652e1c917be137.tar.bz2
gentoo-bashcomp-b8aaa81bee6c71f8eaede4b501652e1c917be137.zip
Add have() for local installations; bug 88326.
svn path=/trunk/; revision=37
-rw-r--r--gentoo9
1 files changed, 9 insertions, 0 deletions
diff --git a/gentoo b/gentoo
index ed1a1f4..bbc8ced 100644
--- a/gentoo
+++ b/gentoo
@@ -5,6 +5,15 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
+# also defined in bash_completion proper however, will produce command
+# not found warnings when this is only enabled "locally" so we define it
+# here as well.
+have()
+{
+ unset -v have
+ PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type $1 >&/dev/null && have="yes"
+}
+
#
# Retrieve PORTDIR/PORTDIR_OVERLAY location from user's make.conf or, if it
# is not defined there, from make.globals.