Re: rpmbuild, environment modules and zsh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 12, 2014 at 13:43:43 -0300, Fabricio Cannini wrote:
> Hi there
> 
> When packaging a software, i usually use environment modules [
> http://modules.sourceforge.net/ ] to configure things like compilers,
> libraries and etc.
> 
> It all used to work fine when my user account used bash as shell, but since
> I've changed to zsh, I always have to explicitly run 'source
> /etc/profile.d/modules.sh' after '%build' so that the 'module' command will
> work ok. I even explicitly set '%__build_shell' to '/bin/bash' , but it did
> not help.
> 
> I'm using :
> 
> - centos 6.5 x86_64
> - rpm-build 4.8.0-37
> - environment-modules 3.2.10-1
> - zsh 4.3.10-7
> 
> Does anybody have a clue of what happened when I switched from bash to zsh ?

Hi Fabricio, I have also run into this problem when building
modules-based rpms when the user shell is zsh or (sadly) tcsh.

I think the reason why the module command works when your shell is bash
is because bash is the only shell that supports exporting shell
functions (export -f). In all other shells, the module command is a
shell function or alias, but can't be exported through the environment
to subshells. Since /etc/profile.d/modules.sh is only loaded in
interactive shells, it isn't loaded by the rpm build shell scriptlets
for example.

The only solution I've found is to start an interactive bash shell
before rpmbuild, or source the file as you've done.

HTH,

-- 
mike

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux