summaryrefslogtreecommitdiffstats
path: root/third_party/ffmpeg/copy_binaries.sh
diff options
context:
space:
mode:
authorajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-29 21:31:02 +0000
committerajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-29 21:31:02 +0000
commit16e21d487fed1f20a7e8065c2fcd03f507d65924 (patch)
tree7606e13bbba53f1a8945beada83e36f95400dece /third_party/ffmpeg/copy_binaries.sh
parented0d9e421521daec1528febdb302dbb1b5f185dc (diff)
downloadchromium_src-16e21d487fed1f20a7e8065c2fcd03f507d65924.zip
chromium_src-16e21d487fed1f20a7e8065c2fcd03f507d65924.tar.gz
chromium_src-16e21d487fed1f20a7e8065c2fcd03f507d65924.tar.bz2
Add in support for copying the ffmpeg binaries in linux and mac.
Review URL: http://codereview.chromium.org/149121 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19534 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/ffmpeg/copy_binaries.sh')
-rwxr-xr-xthird_party/ffmpeg/copy_binaries.sh38
1 files changed, 32 insertions, 6 deletions
diff --git a/third_party/ffmpeg/copy_binaries.sh b/third_party/ffmpeg/copy_binaries.sh
index fb59e15..5c7f412 100755
--- a/third_party/ffmpeg/copy_binaries.sh
+++ b/third_party/ffmpeg/copy_binaries.sh
@@ -1,13 +1,39 @@
#!/bin/bash
#
-# Copies FFmpeg binaries due to gyp limitations on how much you can cram
-# into a rules action.
+# This is meant to replicate the behavior of cp, except that it will not fail
+# if the source files are not present. Something like
+# "cp ${SOURCES} ${DEST} || true" would also have worked except that
+# gyp does not allow for specifying || in the action, and the windows
+# cygwin envrionment does not include "true" making a script like this the
+# least ugly solution.
-SOURCE=$1
-DESTINATION=$2
+SOURCES=""
+DESTINATION=""
-# Our cygwin environment is very limited: "if" isn't available.
-test -f $SOURCE && cp -v -f $SOURCE $DESTINATION
+# Shift off every argument but the last and consider them the sources.
+# It would have probably been easier to put the destination first, but
+# this is not too hard and it replicates the argument ordering of cp.
+while (( "$#" != 1 )); do
+ SOURCES="$SOURCES $1"
+ shift
+done
+
+DESTINATION=$1
+
+# Early out if there was not enough parameters to discern a destination.
+# Also fail the command because this means we are being invoked incorrectly.
+if test -z "$DESTINATION"; then
+ echo "ERROR: Destination empty."
+ exit 1
+fi
+
+# Only try to copy the source file if it exists. It is not an error
+# if the input does not exist; we just silently ignore the input.
+for i in $SOURCES; do
+ if test -f $i; then
+ cp -v -f $i $DESTINATION
+ fi
+done
# Make sure we always succeed.
exit 0