Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(962)

Side by Side Diff: third_party/lcov/bin/install.sh

Issue 57083: lcov-1.7 into third_party for code coverage on POSIX systems.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/lcov/bin/genpng ('k') | third_party/lcov/bin/lcov » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Name: svn:executable
+ *
OLDNEW
(Empty)
1 #!/bin/bash
2 #
3 # install.sh [--uninstall] sourcefile targetfile
4 #
5
6
7 # Check for uninstall option
8 if test "x$1" == "x--uninstall" ; then
9 UNINSTALL=true
10 SOURCE=$2
11 TARGET=$3
12 else
13 UNINSTALL=false
14 SOURCE=$1
15 TARGET=$2
16 fi
17
18 # Check usage
19 if test -z "$SOURCE" || test -z "$TARGET" ; then
20 echo Usage: install.sh [--uninstall] source target >&2
21 exit 1
22 fi
23
24
25 #
26 # do_install(SOURCE_FILE, TARGET_FILE)
27 #
28
29 do_install()
30 {
31 local SOURCE=$1
32 local TARGET=$2
33
34 install -D $SOURCE $TARGET
35 }
36
37
38 #
39 # do_uninstall(SOURCE_FILE, TARGET_FILE)
40 #
41
42 do_uninstall()
43 {
44 local SOURCE=$1
45 local TARGET=$2
46
47 # Does target exist?
48 if test -r $TARGET ; then
49 # Is target of the same version as this package?
50 if diff $SOURCE $TARGET >/dev/null; then
51 rm -f $TARGET
52 else
53 echo WARNING: Skipping uninstall for $TARGET - versions differ! >&2
54 fi
55 else
56 echo WARNING: Skipping uninstall for $TARGET - not installed! >&2
57 fi
58 }
59
60
61 # Call sub routine
62 if $UNINSTALL ; then
63 do_uninstall $SOURCE $TARGET
64 else
65 do_install $SOURCE $TARGET
66 fi
67
68 exit 0
OLDNEW
« no previous file with comments | « third_party/lcov/bin/genpng ('k') | third_party/lcov/bin/lcov » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698