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

Unified 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, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/lcov/bin/genpng ('k') | third_party/lcov/bin/lcov » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/lcov/bin/install.sh
===================================================================
--- third_party/lcov/bin/install.sh (revision 0)
+++ third_party/lcov/bin/install.sh (revision 0)
@@ -0,0 +1,68 @@
+#!/bin/bash
+#
+# install.sh [--uninstall] sourcefile targetfile
+#
+
+
+# Check for uninstall option
+if test "x$1" == "x--uninstall" ; then
+ UNINSTALL=true
+ SOURCE=$2
+ TARGET=$3
+else
+ UNINSTALL=false
+ SOURCE=$1
+ TARGET=$2
+fi
+
+# Check usage
+if test -z "$SOURCE" || test -z "$TARGET" ; then
+ echo Usage: install.sh [--uninstall] source target >&2
+ exit 1
+fi
+
+
+#
+# do_install(SOURCE_FILE, TARGET_FILE)
+#
+
+do_install()
+{
+ local SOURCE=$1
+ local TARGET=$2
+
+ install -D $SOURCE $TARGET
+}
+
+
+#
+# do_uninstall(SOURCE_FILE, TARGET_FILE)
+#
+
+do_uninstall()
+{
+ local SOURCE=$1
+ local TARGET=$2
+
+ # Does target exist?
+ if test -r $TARGET ; then
+ # Is target of the same version as this package?
+ if diff $SOURCE $TARGET >/dev/null; then
+ rm -f $TARGET
+ else
+ echo WARNING: Skipping uninstall for $TARGET - versions differ! >&2
+ fi
+ else
+ echo WARNING: Skipping uninstall for $TARGET - not installed! >&2
+ fi
+}
+
+
+# Call sub routine
+if $UNINSTALL ; then
+ do_uninstall $SOURCE $TARGET
+else
+ do_install $SOURCE $TARGET
+fi
+
+exit 0
Property changes on: third_party/lcov/bin/install.sh
___________________________________________________________________
Name: svn:executable
+ *
« 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