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

Side by Side Diff: enable_localaccount.sh

Issue 6240018: This starts to fix the scripts so that they load from /usr/lib/crosutils (Closed) Base URL: http://git.chromium.org/git/crosutils.git@master
Patch Set: fixing bad merge Created 9 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « emit_gpt_scripts.sh ('k') | enter_chroot.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 set -e 5 set -e
6 6
7 if [ -z $1 ] 7 if [ -z $1 ]; then
8 then
9 echo "Usage: $0 localaccount_username [chroot_path]" 8 echo "Usage: $0 localaccount_username [chroot_path]"
10 exit 1 9 exit 1
11 fi 10 fi
12 11
13 # Default chroot_path to its standard location 12 # Default chroot_path to its standard location
14 chroot_path=${2:-"../../chroot"} 13 chroot_path=${2:-"../../chroot"}
15 14
16 echo "Enabling local account $1@gmail.com." 15 echo "Enabling local account $1@gmail.com."
17 16
18 # Add CHROMEOS_LOCAL_ACCOUNT var to /etc/make.conf.user 17 # Add CHROMEOS_LOCAL_ACCOUNT var to /etc/make.conf.user
19 echo "Setting CHROMEOS_LOCAL_ACCOUNT in $chroot_path/etc/make.conf.user..." 18 echo "Setting CHROMEOS_LOCAL_ACCOUNT in $chroot_path/etc/make.conf.user..."
20 VAR_NAME=CHROMEOS_LOCAL_ACCOUNT 19 VAR_NAME=CHROMEOS_LOCAL_ACCOUNT
21 if grep -q ${VAR_NAME} $chroot_path/etc/make.conf.user; then 20 if grep -q ${VAR_NAME} $chroot_path/etc/make.conf.user; then
22 regex="s/${VAR_NAME}=.*/${VAR_NAME}=$1@gmail.com/" 21 regex="s/${VAR_NAME}=.*/${VAR_NAME}=$1@gmail.com/"
23 sudo sed -i -e "${regex}" $chroot_path/etc/make.conf.user 22 sudo sed -i -e "${regex}" $chroot_path/etc/make.conf.user
24 else 23 else
25 sudo sh -c "echo ""${VAR_NAME}=$1@gmail.com"" >> \ 24 sudo sh -c "echo ""${VAR_NAME}=$1@gmail.com"" >> \
26 $chroot_path/etc/make.conf.user" 25 $chroot_path/etc/make.conf.user"
27 fi 26 fi
OLDNEW
« no previous file with comments | « emit_gpt_scripts.sh ('k') | enter_chroot.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698