[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/N] Detect cache variable collision.
From: |
Ralf Wildenhues |
Subject: |
[PATCH 6/N] Detect cache variable collision. |
Date: |
Mon, 18 Jan 2010 22:20:11 +0100 |
User-agent: |
Mutt/1.5.20 (2009-10-28) |
* gnulib-tool (func_cache_lookup_module): Store the module name
belonging to the cache variable; error out if two different
module names map to the same cache variable name.
---
gnulib-tool | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/gnulib-tool b/gnulib-tool
index 4a030cf..3c389ea 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -1423,7 +1423,7 @@ func_cache_lookup_module ()
# following line with an opening quote, if any.
# 4) Special treatment if two headers are only separated by one newline.
sed_cache_module='
- 1i\'$nl$cachevar'_cached='\''yes\'$nl'
+ 1i\'$nl$cachevar'_name='\'$1\'\\$nl$cachevar'_cached='\''yes\'$nl'
:match
t match
@@ -1467,6 +1467,10 @@ func_cache_lookup_module ()
cache_script=`sed "$sed_cache_module" < "$lookedup_file" \
| sed "$sed_strip_trailing_nl"`
eval "$cache_script"
+ else
+ if eval test "$1" != \"\$${cachevar}_name\"; then
+ eval 'func_fatal_error "cache variable collision: $1 and
$'${cachevar}'_name"'
+ fi
fi
}
--
1.6.6.244.g4b0c
- [PATCH 0/5] speed up gnulib-tool some more, Ralf Wildenhues, 2010/01/17
- [PATCH 1/5] gnulib-tool: cache module metainformation., Ralf Wildenhues, 2010/01/17
- [PATCH 2/5] gnulib-tool: avoid forks with func_get_* functions., Ralf Wildenhues, 2010/01/17
- [PATCH 3/5] gnulib-tool: small sed optimization., Ralf Wildenhues, 2010/01/17
- [PATCH 4/5] Efficient license compatibility checks with --test/--create-testdir., Ralf Wildenhues, 2010/01/17
- [PATCH 5/5] Drop self-dependencies in modules/unistdio/*., Ralf Wildenhues, 2010/01/17
- Re: [PATCH 0/5] speed up gnulib-tool some more, Bruno Haible, 2010/01/17