From 7b637e97b2ec145c1246efff297b716c7c9d2c92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Achim=20Gsell=C3=BC?= Date: Thu, 30 Aug 2018 11:07:06 +0200 Subject: [PATCH] Pmodules/libmodules.tcl: - set P,V, V_{MAJOR,MINOR,PATCHLVL,RELEASE,PKG} as global variable, so they are available in modulesfiles --- Pmodules/libmodules.tcl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Pmodules/libmodules.tcl b/Pmodules/libmodules.tcl index 998e715..9f0d1d2 100644 --- a/Pmodules/libmodules.tcl +++ b/Pmodules/libmodules.tcl @@ -282,7 +282,15 @@ proc ModulesHelp { } { proc _pmodules_init_global_vars { } { global group global name + global P global version + global V + global V_MAJOR + global V_MINOR + global V_PATCHLVL + global V_RELEASE + global V_PKG + global implementation global PREFIX # prefix of package @@ -302,7 +310,11 @@ proc _pmodules_init_global_vars { } { set rel_modulefile [lrange $modulefile [llength $pmodules_root] end] set group [lindex $rel_modulefile 0] set name [lindex $modulefile end-1] + set P "${name}" set version [lindex $modulefile end] + set V "${version}" + lassign [split $V -] V_PKG V_RELEASE + lassign [split $V_PKG .] V_MAJOR V_MINOR V_PATCHLVL set implementation [lrange $rel_modulefile 2 end] set prefix "$pmodules_root $group [lreverse_n $implementation 2]" set PREFIX [file join {*}$prefix]