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

Unified Diff: user_tools/linux/recovery.sh

Issue 5516010: Use tr instead of sed to unDOSify the config file, so it works on Macs. (Closed) Base URL: http://git.chromium.org/git/vboot_reference.git@master
Patch Set: Created 10 years 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: user_tools/linux/recovery.sh
diff --git a/user_tools/linux/recovery.sh b/user_tools/linux/recovery.sh
index b63e91b8f998add946b19f03f6011ba1a692332e..6a0ba412348d06d459a99a0b6416436ad8dabd69 100755
--- a/user_tools/linux/recovery.sh
+++ b/user_tools/linux/recovery.sh
@@ -104,7 +104,7 @@ require_utils() {
local tool
local tmp
- external='cat cut dd grep ls mkdir mount readlink sed sync umount unzip wc'
+ external='cat cut dd grep ls mkdir mount readlink sed sync tr umount unzip wc'
if [ -z "$WORKDIR" ]; then
external="$external mktemp"
fi
@@ -658,8 +658,8 @@ fetch_url "$CONFIGURL" "$tmpfile" || \
gfatal "Unable to download the config file"
# Un-DOS-ify the config file and separate the version info from the images
-sed 's/\r//g' "$tmpfile" | grep '^recovery_tool' > "$version"
-sed 's/\r//g' "$tmpfile" | grep -v '^#' | grep -v '^recovery_tool' > "$config"
+tr -d '\015' < "$tmpfile" | grep '^recovery_tool' > "$version"
+tr -d '\015' < "$tmpfile" | grep -v '^#' | grep -v '^recovery_tool' > "$config"
# Add one empty line to the config file to terminate the last stanza
echo >> "$config"
@@ -725,7 +725,7 @@ Installing the recovery image
# Unmount anything on that device.
echo "unmounting..."
-for tmp in $(mount | grep ^"/dev/${user_choice}" | sed 's/[ \t].*//'); do
+for tmp in $(mount | grep ^"/dev/${user_choice}" | cut -d' ' -f1); do
umount $tmp || ufatal "Unable to unmount $tmp."
done
« 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