From b6fb706f3879bf34d11f5d776cfd6a96a6f2617e Mon Sep 17 00:00:00 2001 From: David McMahon Date: Tue, 9 Feb 2010 11:44:09 -0800 Subject: [PATCH] Re-use .h code for both files. Add a license header. Review URL: http://codereview.chromium.org/594006 --- enable_localaccount.sh | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/enable_localaccount.sh b/enable_localaccount.sh index fc87d82b9a..802d4ee348 100755 --- a/enable_localaccount.sh +++ b/enable_localaccount.sh @@ -1,5 +1,7 @@ #!/bin/bash - +# Copyright (c) 2010 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. set -e if [ -z $1 ] @@ -9,33 +11,26 @@ then fi echo "Enabling local account $1@gmail.com." -echo "Remove ../platform/pam_google/pam_localaccount.h and " -echo "../platform/pam_offline/pam_localaccount.h to disable." +echo "Remove these files to disable:" -cat < ../platform/pam_google/pam_localaccount.h +for namespace in pam_google pam_offline +do + file=../platform/$namespace/pam_localaccount.h + [ "$namespace" = pam_google ] && namespace=chromeos_pam + + echo $file + + cat < $file // local username for Chrome OS pam // This file is auto-generated by enable_localaccount.sh #ifndef CHROMEOS_PAM_LOCALACCOUNT_H_ #define CHROMEOS_PAM_LOCALACCOUNT_H_ -namespace chromeos_pam { -const char kLocalAccount[] = "$1@gmail.com"; -} - -#endif // CHROMEOS_PAM_LOCALACCOUNT_H_ -EOF - -cat < ../platform/pam_offline/pam_localaccount.h -// local username for Chrome OS pam -// This file is auto-generated by enable_localaccount.sh - -#ifndef CHROMEOS_PAM_LOCALACCOUNT_H_ -#define CHROMEOS_PAM_LOCALACCOUNT_H_ - -namespace pam_offline { +namespace $namespace { const char kLocalAccount[] = "$1@gmail.com"; } #endif // CHROMEOS_PAM_LOCALACCOUNT_H_ EOF +done