Trying to adap some SCL to scl-utils and environment-modules according to https://www.softwarecollections.org/en/docs/guide/#sect-Converting_Software_Collection_Scriptlets_into_Environment_Modules This result (in build.log) + /usr/share/Modules/bin/createmodule.sh enable + tee envmod /usr/share/Modules/bin/createmodule.sh: eval: line 60: unexpected EOF while looking for matching `]' /usr/share/Modules/bin/createmodule.sh: eval: line 61: syntax error: unexpected end of file /usr/share/Modules/bin/createmodule.sh: eval: line 66: unexpected EOF while looking for matching `]' /usr/share/Modules/bin/createmodule.sh: eval: line 67: syntax error: unexpected end of file #%Module 1.0 And the empty file is obviously unusable. Broken with 3.2.10-6.fc20 and 3.2.10-12.fc21, but works fine with 3.2.10-13.fc22
The problem is that script createmodule.sh can't parse bash functions properly. Probably it can't do that in f22 either but you haven't set any such problematic function in your environment. I think the problem is function "scl" in your case. The workaround can be "unset scl". I will also attach some possible patch of the script createmodule.sh in the next comment.
Created attachment 997012 [details] Patch to parse bash function properly.
@Lubox please notice that it works in Fedora 22
(In reply to Remi Collet from comment #3) > @Lubox please notice that it works in Fedora 22 I tried also the script createmodules.sh from package environment-modules-3.2.10-13.fc22.x86_64.rpm and it was broken too. It is obvious beacuse the script createmodules.sh from f22 is identical with the script createmodule.sh from f21.
Very strange.... it doesn't work in mock (rpmdbuild), but works from the shell... $ mock .... + /usr/share/Modules/bin/createmodule.sh enable + tee envmod /usr/share/Modules/bin/createmodule.sh: eval: line 60: unexpected EOF while looking for matching `]' /usr/share/Modules/bin/createmodule.sh: eval: line 61: syntax error: unexpected end of file /usr/share/Modules/bin/createmodule.sh: eval: line 66: unexpected EOF while looking for matching `]' /usr/share/Modules/bin/createmodule.sh: eval: line 67: syntax error: unexpected end of file #%Module 1.0 $ mock ... shell <mock-chroot>sh-4.2# /usr/share/Modules/bin/createmodule.sh enable #%Module 1.0 prepend-path LD_LIBRARY_PATH /opt/remi/php54/root/usr/lib64 prepend-path MANPATH /opt/remi/php54/root/usr/share/man: prepend-path PATH /opt/remi/php54/root/usr/bin:/opt/remi/php54/root/usr/sbin
Probably because environment isn't same. You can try to put command "env" before calling script createmodule.sh and diff the outputs for these two cases (work / doesn't work). The problem is that script createmodule.sh parses output from command "env" but it expects format "key=value" on each line and it is confused if e. g. the following function is defined and it is in output of env command: BASH_FUNC_scl()=() { local CMD=$1; if [ "$CMD" = "load" -o "$CMD" = "unload" ]; then eval "module $@"; else /usr/bin/scl "$@"; fi }
Ľuboš - thanks for the patch. I've applied it.
environment-modules-3.2.10-14.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/environment-modules-3.2.10-14.fc20
With environment-modules-3.2.10-14.fc20 in the buildroot: + /usr/share/Modules/bin/createmodule.sh enable + tee envmod #%Module 1.0 prepend-path LD_LIBRARY_PATH /opt/remi/php54/root/usr/lib64 prepend-path MANPATH /opt/remi/php54/root/usr/share/man: prepend-path PATH /opt/remi/php54/root/usr/bin:/opt/remi/php54/root/usr/sbin @Orion, can you please also fix F21 ?
(In reply to Remi Collet from comment #9) > @Orion, can you please also fix F21 ? Sorry for the noise, I just found https://admin.fedoraproject.org/updates/environment-modules-3.2.10-14.fc21 (not attached to fix bug)
Package environment-modules-3.2.10-14.fc20: * should fix your issue, * was pushed to the Fedora 20 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing environment-modules-3.2.10-14.fc20' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2015-2982/environment-modules-3.2.10-14.fc20 then log in and leave karma (feedback).
environment-modules-3.2.10-14.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.