annotate lib/swig/swigwin-2.0.11/CCache/debian/update-ccache @ 2383:342b73a61a60

sub_407A1C - refactoring min-max
author zipi
date Sun, 22 Jun 2014 14:39:50 +0100
parents b3009adc0e2f
children
rev   line source
1899
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
1 #!/bin/sh
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
2 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
3 # Update compiler links to ccache (in /usr/local/bin)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
4 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
5 # The idea is that /usr/local/bin is ahead of /usr/bin in your PATH, so adding
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
6 # the link /usr/local/bin/cc -> /usr/bin/ccache means that it is run instead of
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
7 # /usr/bin/cc
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
8 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
9 # Written by: Behan Webster <behanw@websterwood.com>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
10 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
11
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
12 DIRECTORY=/usr/local/bin
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
13 CCACHE=/usr/bin/ccache
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
14 CCDIR=/usr/lib/ccache
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
15
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
16 usage() {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
17 echo "Usage: `basename $0` [--directory <dir>] [--remove]"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
18 exit 0
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
19 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
20
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
21 while [ $# -gt 0 ] ; do
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
22 case "$1" in
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
23 -d*|--d*|--directory) DIRECTORY=$2; shift; shift;;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
24 -h*|--h*|--help) usage;;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
25 -r*|--r*|--remove) REMOVE=1; shift;;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
26 -t*|--t*|--test) TEST=echo; shift;;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
27 esac
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
28 done
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
29
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
30 for FILE in `cd $CCDIR; ls` ; do
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
31 LINK=$DIRECTORY/$FILE
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
32 if [ -z "$REMOVE" ] ; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
33 # Add link
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
34 $TEST ln -fs $CCACHE $LINK
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
35 else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
36 # Remove link
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
37 if [ -L "$LINK" ] ; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
38 $TEST rm -f $LINK
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
39 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
40 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
41 done
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
42
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
43 # vim: sw=4 ts=4