Debian Codegraph @

debian/patches/paths.patch

raw
1 Author: Alastair McKinstry <[email protected]>
2 Description: Fix paths as used in Debian
3 Last-Updated: 2017-12-05
4 Forwarded: not-needed
5
6 Index: modules-4.1.1/init/bash.in
7 ===================================================================
8 --- modules-4.1.1.orig/init/bash.in
9 +++ modules-4.1.1/init/bash.in
10 @@ -66,13 +66,13 @@ export -f module
11 @compatversion@ typeset swfound=1
12 @compatversion@ if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then
13 @compatversion@ typeset swname='main'
14 -@compatversion@ if [ -e @libexecdir@/modulecmd.tcl ]; then
15 +@compatversion@ if [ -e /usr/lib/modulecmd.tcl ]; then
16 @compatversion@ typeset swfound=0
17 @compatversion@ unset MODULES_USE_COMPAT_VERSION
18 @compatversion@ fi
19 @compatversion@ else
20 @compatversion@ typeset swname='compatibility'
21 -@compatversion@ if [ -e @libexecdir@/modulecmd-compat ]; then
22 +@compatversion@ if [ -e /usr/lib/modulecmd-compat ]; then
23 @compatversion@ typeset swfound=0
24 @compatversion@ MODULES_USE_COMPAT_VERSION=1; export MODULES_USE_COMPAT_VERSION
25 @compatversion@ fi
26 @@ -81,7 +81,7 @@ export -f module
27 @compatversion@ # switch version only if command found
28 @compatversion@ if [ $swfound -eq 0 ]; then
29 @compatversion@ echo "Switching to Modules $swname version"
30 -@compatversion@ source @initdir@/bash
31 +@compatversion@ source /usr/share/modules/init/bash
32 @compatversion@ else
33 @compatversion@ echo "Cannot switch to Modules $swname version, command not found"
34 @compatversion@ return 1
35 @@ -92,13 +92,13 @@ export -f module
36 # setup ENV variables to get module defined in sub-shells (works for 'sh'
37 # and 'ksh' in interactive mode and 'sh' (zsh-compat), 'bash' and 'ksh'
38 # (zsh-compat) in non-interactive mode.
39 -ENV=@initdir@/profile.sh; export ENV
40 -BASH_ENV=@initdir@/bash; export BASH_ENV
41 +ENV=/usr/share/modules/init/profile.sh; export ENV
42 +BASH_ENV=/usr/share/modules/init/bash; export BASH_ENV
43
44 # enable completion only in interactive mode
45 if [ ${BASH_VERSINFO:-0} -ge 3 ] && [[ $- =~ i ]] &&
46 - [ -r @initdir@/bash_completion ]; then
47 - source @initdir@/bash_completion
48 + [ -r /usr/share/modules/init/bash_completion ]; then
49 + source /usr/share/modules/init/bash_completion
50 fi
51
52 @setbinpath@if [[ ! ":$PATH:" =~ ':@bindir@:' ]]; then
53 Index: modules-4.1.1/init/sh.in
54 ===================================================================
55 --- modules-4.1.1.orig/init/sh.in
56 +++ modules-4.1.1/init/sh.in
57 @@ -68,13 +68,13 @@ fi
58 @compatversion@ swfound=1
59 @compatversion@ if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then
60 @compatversion@ swname='main'
61 -@compatversion@ if [ -e @libexecdir@/modulecmd.tcl ]; then
62 +@compatversion@ if [ -e /usr/lib/modulecmd.tcl ]; then
63 @compatversion@ swfound=0
64 @compatversion@ unset MODULES_USE_COMPAT_VERSION
65 @compatversion@ fi
66 @compatversion@ else
67 @compatversion@ swname='compatibility'
68 -@compatversion@ if [ -e @libexecdir@/modulecmd-compat ]; then
69 +@compatversion@ if [ -e /usr/lib/modulecmd-compat ]; then
70 @compatversion@ swfound=0
71 @compatversion@ MODULES_USE_COMPAT_VERSION=1; export MODULES_USE_COMPAT_VERSION
72 @compatversion@ fi
73 @@ -83,7 +83,7 @@ fi
74 @compatversion@ # switch version only if command found
75 @compatversion@ if [ $swfound -eq 0 ]; then
76 @compatversion@ echo "Switching to Modules $swname version"
77 -@compatversion@ . @initdir@/sh
78 +@compatversion@ . /usr/share/modules/init/sh
79 @compatversion@ else
80 @compatversion@ echo "Cannot switch to Modules $swname version, command not found"
81 @compatversion@ return 1
82 @@ -96,8 +96,8 @@ fi
83 # setup ENV variables to get module defined in sub-shells (works for 'sh'
84 # and 'ksh' in interactive mode and 'sh' (zsh-compat), 'bash' and 'ksh'
85 # (zsh-compat) in non-interactive mode.
86 -ENV=@initdir@/profile.sh; export ENV
87 -BASH_ENV=@initdir@/bash; export BASH_ENV
88 +ENV=/usr/share/modules/init/profile.sh; export ENV
89 +BASH_ENV=/usr/share/modules/init/bash; export BASH_ENV
90
91 @setbinpath@case ":$PATH:" in
92 @setbinpath@ *:@bindir@:*) ;;
93 Index: modules-4.1.1/modulecmd.tcl.in
94 ===================================================================
95 --- modules-4.1.1.orig/modulecmd.tcl.in
96 +++ modules-4.1.1/modulecmd.tcl.in
97 @@ -6077,7 +6077,7 @@ proc cmdModuleAutoinit {} {
98 pushMode "load"
99
100 # default MODULESHOME
101 - setenv MODULESHOME "@prefix@"
102 + setenv MODULESHOME "/usr/share/modules"
103
104 # register command location
105 setenv MODULES_CMD [getAbsolutePath $argv0]
106 @@ -6091,8 +6091,8 @@ proc cmdModuleAutoinit {} {
107 # initialize default MODULEPATH and LOADEDMODULES
108 if {![info exists env(MODULEPATH)] || $env(MODULEPATH) eq ""} {
109 # set modpaths defined in .modulespath config file if it exists
110 - if {[file readable "@initdir@/.modulespath"]} {
111 - set fid [open "@initdir@/.modulespath" r]
112 + if {[file readable "/usr/share/modules/init/.modulespath"]} {
113 + set fid [open "/usr/share/modules/init/.modulespath" r]
114 set fdata [split [read $fid] "\n"]
115 close $fid
116 foreach fline $fdata {
117 @@ -6113,8 +6113,8 @@ proc cmdModuleAutoinit {} {
118
119 # source initialization modulerc if any and if no env already initialized
120 if {$env(MODULEPATH) eq "" && $env(LOADEDMODULES) eq ""\
121 - && [file exists "@initdir@/modulerc"]} {
122 - cmdModuleSource "@initdir@/modulerc"
123 + && [file exists "/usr/share/modules/init/modulerc"]} {
124 + cmdModuleSource "/usr/share/modules/init/modulerc"
125 }
126
127 popMode