env variable is not defined when running rpmbuild --rebuild

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

 



Hi,

I have a problem with an env variable while running rpmbuild --rebuild
/usr/src/redhat/SRPMS/mypackage-0-0.1.src.rpm:

before running rpmbuild, I run the following commands:

[erez.zilber@klab002:~/work/]$ sudo bash -c 'export MY_ENV_VAR=some_val'
[erez.zilber@klab002:~/work/]$ sudo echo $MY_ENV_VAR
some_val

In the spec file, I print this env var:

%build
echo "MY_ENV_VAR = $MY_ENV_VAR"

but when I run rpmbuild --rebuild
/usr/src/redhat/SRPMS/mypackage-0-0.1.src.rpm, I get:

+ LANG=C
+ export LANG
+ unset DISPLAY
+ echo 'MY_ENV_VAR = '
MY_ENV_VAR =

I guess that it opens another shell in which the env var is not
defined. How can I solve that (without adding the env var to .bashrc
which is not a possible solution for me).

Thanks,
Erez

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/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