Skip to content

Commit 1d3c4e7

Browse files
committed
Change approach with version req in cache file magic cookie
Version in magic cookie of cache files was previously set to the current version of Modules. As a result, only the same Modules version would be able to use cache file generated. This is changed to enable use of cache files by several Modules release. Only a cache format change would imply a magic cookie version upgrade. So as of now, the version required is set to 5.3. This will change if the cache format evolves (with new cache file Tcl commands or a change in the arguments of the existing commands). Version requirement is set to 5.3 as commands in cache files as not been changed since the introduction of the cache feature in Modules 5.3 release. Signed-off-by: Xavier Delaruelle <[email protected]>
1 parent 4a675b6 commit 1d3c4e7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tcl/cache.tcl.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ proc formatModuleCacheContent {modpath} {
186186

187187
# prepend header if some content has been generated
188188
if {[string length $content]} {
189-
regexp {^\d+\.\d+} [getState modules_release] majmin
190-
set content "#%Module$majmin$content"
189+
set cache_header "#%Module[getState cache_mcookie_version]"
190+
set content $cache_header$content
191191
}
192192

193193
return $content

tcl/init.tcl.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@
2222

2323
# Runtime state properties (default value, proc to call to initialize state
2424
# value?)
25-
##nagelfar ignore +37 Found constant
25+
##nagelfar ignore +38 Found constant
2626
array set g_state_defs [list\
2727
autoinit {0}\
28+
cache_mcookie_version {5.3}\
2829
clock_seconds {<undef> initStateClockSeconds}\
2930
domainname {<undef> {runCommand domainname}}\
3031
error_count {0}\

0 commit comments

Comments
 (0)