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

Unified Diff: src/scripts/enable_localaccount.sh

Issue 594006: Re-use .h code for both files. Add a license header. (Closed)
Patch Set: localacct Created 10 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 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: src/scripts/enable_localaccount.sh
diff --git a/src/scripts/enable_localaccount.sh b/src/scripts/enable_localaccount.sh
index fc87d82b9a02039b6929f7b3fa8cd6e6edeeebc0..802d4ee348ec7540aac63fc148ef9691a0d77bbb 100755
--- a/src/scripts/enable_localaccount.sh
+++ b/src/scripts/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."
-
-cat <<EOF > ../platform/pam_google/pam_localaccount.h
-// local username for Chrome OS pam
-// This file is auto-generated by enable_localaccount.sh
+echo "Remove these files to disable:"
-#ifndef CHROMEOS_PAM_LOCALACCOUNT_H_
-#define CHROMEOS_PAM_LOCALACCOUNT_H_
+for namespace in pam_google pam_offline
+do
+ file=../platform/$namespace/pam_localaccount.h
+ [ "$namespace" = pam_google ] && namespace=chromeos_pam
-namespace chromeos_pam {
-const char kLocalAccount[] = "$1@gmail.com";
-}
-
-#endif // CHROMEOS_PAM_LOCALACCOUNT_H_
-EOF
+ echo $file
-cat <<EOF > ../platform/pam_offline/pam_localaccount.h
+ cat <<EOF > $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 pam_offline {
+namespace $namespace {
const char kLocalAccount[] = "$1@gmail.com";
}
#endif // CHROMEOS_PAM_LOCALACCOUNT_H_
EOF
+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