[SM-Commit] GIT changes to master cauldron by Justin Boffemmyer (cec9eb4169173ffd95f0c871bd0fa0d46a139a0d)
Justin Boffemmyer
scm at sourcemage.org
Mon Mar 29 19:22:11 EDT 2010
GIT changes to master cauldron by Justin Boffemmyer <flux at sourcemage.org>:
delint/libdelint | 6 +++++-
1 files changed, 5 insertions(+), 1 deletion(-)
New commits:
commit cec9eb4169173ffd95f0c871bd0fa0d46a139a0d
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>
delint: ensure sane LC_COLLATE
Set LC_COLLATE to "C" (the "default" locale) so that it doesn't break
grep/sort etc. when the user has it set to a locale which collates
differently.
commit 825f0d3cae9cb579fd3e35f67215b326e8978536
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>
delint: strip variables before sort -u
Strip possible variable bound markers ('{' and '}') from around variable
names before "uniqueing" them, rather than the other way around.
Otherwise two variables that are the same but are used/referenced
differently will appear different to sort -u, resulting in duplicates
after stripping.
diff --git a/delint/libdelint b/delint/libdelint
index 16ef376..f32a7a8 100644
--- a/delint/libdelint
+++ b/delint/libdelint
@@ -15,6 +15,10 @@
##
#-------------------------------------------------------------------------------
+# set LC_COLLATE to C so we don't get affected by the user's locale
+# when grepping, sorting, etc.
+export LC_COLLATE="C"
+
# ensure that DELINT_PATH has a value
[[ -z "$DELINT_PATH" ]] && DELINT_PATH="$(dirname $0)"
@@ -57,7 +61,7 @@ function delint_global_variables() {
# as per the API specification, all global variables are required to be
# uppercase, and must begin with a letter, containing only letters,
# underscores, and trailing numbers
- for search in $(grep -o '${\?[A-Z][A-Z_]*[0-9]*' "$file" | sort -u | sed 's/^\${\?//')
+ for search in $(grep -o '${\?[A-Z][A-Z_]*[0-9]*' "$file" | sed 's/^\${\?//' | sort -u)
do
if ! grep -q "$search=" "$defines"
then
More information about the SM-Commit
mailing list