summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Väth <martin@mvath.de>2014-12-23 10:33:18 +0100
committerMartin Väth <martin@mvath.de>2015-10-11 10:49:20 +0200
commitc703f57ed5cb189ca0a8b3a01ef585ad3260e16f (patch)
tree540f4d8f52c2f575f19c07427eb177a19d68d0ce /dev-util/ccache/files
parentBump systemd-cron (diff)
downloadmv-c703f57ed5cb189ca0a8b3a01ef585ad3260e16f.tar.gz
mv-c703f57ed5cb189ca0a8b3a01ef585ad3260e16f.tar.bz2
mv-c703f57ed5cb189ca0a8b3a01ef585ad3260e16f.zip
Bump chklref, ccache, noscript
Diffstat (limited to 'dev-util/ccache/files')
-rw-r--r--dev-util/ccache/files/ccache-config-3 (renamed from dev-util/ccache/files/ccache-config-2)31
1 files changed, 17 insertions, 14 deletions
diff --git a/dev-util/ccache/files/ccache-config-2 b/dev-util/ccache/files/ccache-config-3
index 5d31d86c..7f604f00 100644
--- a/dev-util/ccache/files/ccache-config-2
+++ b/dev-util/ccache/files/ccache-config-3
@@ -3,7 +3,7 @@
# ccache-config - helper script for ccache and its ebuild
#
# Copyright 2003-2014 Superlucidity Services, LLC
-# Copyright 2013 Gentoo Foundation
+# Copyright 2013-2014 Gentoo Foundation
# This program licensed under the GNU GPL version 2.
#
# This script developed by Zachary T Welch at Superlucidity Services, LLC
@@ -13,7 +13,7 @@
EPREFIX=''
-. "${EPREFIX}"/etc/init.d/functions.sh 2>/dev/null || {
+. "${EPREFIX}"/lib/gentoo/functions.sh 2>/dev/null || {
ebegin() { echo " * $* ..."; }
eend() {
local r=${1:-$?}
@@ -48,16 +48,23 @@ cc_remove_link() {
c_ebegin "Removing ${t}"
rm -f "${t}"
c_eend
+
+ # Trim the empty dir if possible. #517242
+ t=${t%/*}
+ if rmdir "${t}" 2>/dev/null; then
+ rmdir "${t%/*}" 2>/dev/null
+ fi
+ :
fi
}
cc_install_link() {
# Search the PATH for the specified compiler
# then create shadow link in /usr/lib/ccache/bin to ccache
- if [ -n "$(type -p ${1})" ]; then
+ if command -v "$1" >/dev/null ; then
# first be sure any old link is removed
_CC_QUIET=1
- cc_remove_link "${1}"
+ cc_remove_link "$1"
unset _CC_QUIET
# then create the new link
@@ -69,26 +76,22 @@ cc_install_link() {
}
cc_links() {
local a
- for a in gcc cc c++ g++ ; do
- eval "cc_${1}_link" "${2}${2:+-}${a}"
- done
- [ "${1}" = install ] && [ -n "${2}" ] && return
- for a in icc icpc clang clang++ ; do
- eval "cc_${1}_link" "${2}${2:+-}${a}"
+ for a in gcc cc c++ g++ icc icpc clang clang++ ; do
+ "cc_${1}_link" "${2}${2:+-}${a}"
done
}
###
# main routine
-case "${1}" in
+case $1 in
--install-links )
- cc_links install "${2}"
+ cc_links install "$2"
;;
--remove-links )
- cc_links remove "${2}"
+ cc_links remove "$2"
;;
* )
- echo "usage: ${0} {--install-links|--remove-links} [ CHOST ]"
+ echo "usage: $0 {--install-links|--remove-links} [ CHOST ]"
;;
esac