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

Issue 137433002: python_arch: return "unknown" when file does not exist (Closed)

Created:
6 years, 11 months ago by vapier
Modified:
6 years, 11 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

python_arch: return "unknown" when file does not exist The `file` program follows POSIX as outlined here: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/file.html Specifically, this part causes troubles: If the file named by the file operand does not exist, cannot be read, or the type of the file named by the file operand cannot be determined, this shall not be considered an error that affects the exit status. With older versions of `file` (that does not conform to POSIX), this script will exit 0 with "unknown" as its output when "$1" does not exist. But with recent releases (that conform to POSIX), this script will exit 1 and can break the build. Have the script explicitly check for the existence of $1 and if it does not exist, then runt he unknown logic like normal. BUG=chromium:332547 TEST=ran python_arch.sh on bogus files with new & old `file` programs Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=244778

Patch Set 1 #

Total comments: 4

Patch Set 2 : add comment explaining -e #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -1 line) Patch
M build/linux/python_arch.sh View 1 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
vapier
6 years, 11 months ago (2014-01-13 22:04:47 UTC) #1
Lei Zhang
Is anyone still using python_arch.py besides PyAuto, which is going away soonish?
6 years, 11 months ago (2014-01-13 22:19:59 UTC) #2
Mark Mentovai
https://codereview.chromium.org/137433002/diff/1/build/linux/python_arch.sh File build/linux/python_arch.sh (right): https://codereview.chromium.org/137433002/diff/1/build/linux/python_arch.sh#newcode14 build/linux/python_arch.sh:14: if [ $? -ne 0 ] || [ ! ...
6 years, 11 months ago (2014-01-13 22:39:23 UTC) #3
vapier
the code might be punted in the future, but i think we should fix this ...
6 years, 11 months ago (2014-01-13 22:45:18 UTC) #4
Mark Mentovai
LGTM
6 years, 11 months ago (2014-01-13 22:47:56 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vapier@chromium.org/137433002/70001
6 years, 11 months ago (2014-01-14 00:48:34 UTC) #6
commit-bot: I haz the power
6 years, 11 months ago (2014-01-14 18:52:37 UTC) #7
Message was sent while issue was closed.
Change committed as 244778

Powered by Google App Engine
This is Rietveld 408576698