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

Unified Diff: build/linux/python_arch.sh

Issue 137433002: python_arch: return "unknown" when file does not exist (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add comment explaining -e Created 6 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/linux/python_arch.sh
diff --git a/build/linux/python_arch.sh b/build/linux/python_arch.sh
index 3a41f94a980f16675a57baf6422a71fa4fd0f673..e0f63bc6b0471b609d9cf2ccdcec2f4a5903a1f4 100755
--- a/build/linux/python_arch.sh
+++ b/build/linux/python_arch.sh
@@ -11,7 +11,9 @@
#
file_out=$(file --dereference "$1")
-if [ $? -ne 0 ]; then
+# The POSIX spec says that `file` should not exit(1) if the file does not
+# exist, so do our own -e check to catch things.
+if [ $? -ne 0 ] || [ ! -e "$1" ] ; then
echo unknown
exit 0
fi
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698