|
From: Jeff S. <jsq...@us...> - 2002-05-24 06:45:03
|
Update of /cvsroot/env-switcher/modules-oscar/dist
In directory usw-pr-cvs1:/tmp/cvs-serv8215/modules-oscar/dist
Modified Files:
modules-oscar.spec
Log Message:
Fix env-switcher bug 559978. Make "rpm -Uvh" be able to occur cleanly --
need to delineate between the additions to /etc/bashrc and /etc/csh.cshrc
from the old RPM and the new RPM.
Index: modules-oscar.spec
===================================================================
RCS file: /cvsroot/env-switcher/modules-oscar/dist/modules-oscar.spec,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** modules-oscar.spec 24 May 2002 03:53:03 -0000 1.6
--- modules-oscar.spec 24 May 2002 06:44:59 -0000 1.7
***************
*** 259,271 ****
# /etc/bashrc is run, and all /etc/profile.d/*.sh scripts are run
%__cp /etc/bashrc /etc/bashrc.rpmsave
! egrep -v '^.*# MODULES-RPM-ADDITION' /etc/bashrc > /etc/bashrc.tmp
! %__cat >> /etc/bashrc.tmp <<EOF
! if test "\$MODULE_OSCAR" = "" -a -f %{_profiledir}/00-modules.sh; then # MODULES-RPM-ADDITION
! . %{_profiledir}/00-modules.sh # MODULES-RPM-ADDITION
! fi # MODULES-RPM-ADDITION
EOF
- %__cp /etc/bashrc.tmp /etc/bashrc
- %__rm -f /etc/bashrc.tmp
# We have to do essentially the same thing for /etc/csh.cshrc for
--- 259,270 ----
# /etc/bashrc is run, and all /etc/profile.d/*.sh scripts are run
+ special_string="MODULES-%{version}-%{release}-RPM-ADDITION"
+
%__cp /etc/bashrc /etc/bashrc.rpmsave
! %__cat >> /etc/bashrc <<EOF
! if test "\$MODULE_OSCAR" = "" -a -f %{_profiledir}/00-modules.sh; then # $special_string
! . %{_profiledir}/00-modules.sh # $special_string
! fi # $special_string
EOF
# We have to do essentially the same thing for /etc/csh.cshrc for
***************
*** 273,284 ****
%__cp /etc/csh.cshrc /etc/csh.cshrc.rpmsave
! egrep -v '^.*# MODULES-RPM-ADDITION' /etc/csh.cshrc > /etc/csh.cshrc.tmp
! %__cat >> /etc/csh.cshrc.tmp <<EOF
! if ("\$?MODULE_OSCAR" == "0" && -f %{_profiledir}/00-modules.csh) then # MODULES-RPM-ADDITION
! source %{_profiledir}/00-modules.csh # MODULES-RPM-ADDITION
! endif # MODULES-RPM-ADDITION
EOF
! %__cp /etc/csh.cshrc.tmp /etc/csh.cshrc
! %__rm -f /etc/csh.cshrc.tmp
--- 272,282 ----
%__cp /etc/csh.cshrc /etc/csh.cshrc.rpmsave
! %__cat >> /etc/csh.cshrc <<EOF
! if ("\$?MODULE_OSCAR" == "0" && -f %{_profiledir}/00-modules.csh) then # $special_string
! source %{_profiledir}/00-modules.csh # $special_string
! endif # $special_string
EOF
!
! unset special_string
***************
*** 290,296 ****
%postun
# Remove the addition that we put in the /etc/bashrc file in %post.
! egrep -v '^.*# MODULES-RPM-ADDITION' /etc/bashrc > /etc/bashrc.tmp
%__cp /etc/bashrc.tmp /etc/bashrc
%__rm -f /etc/bashrc.tmp
--- 288,296 ----
%postun
+ special_string="MODULES-%{version}-%{release}-RPM-ADDITION"
+
# Remove the addition that we put in the /etc/bashrc file in %post.
! egrep -v '^.*# '$special_string /etc/bashrc > /etc/bashrc.tmp
%__cp /etc/bashrc.tmp /etc/bashrc
%__rm -f /etc/bashrc.tmp
***************
*** 298,302 ****
# Ditto for /etc/csh.cshrc
! egrep -v '^.*# MODULES-RPM-ADDITION' /etc/csh.cshrc > /etc/csh.cshrc.tmp
%__cp /etc/csh.cshrc.tmp /etc/csh.cshrc
%__rm -f /etc/csh.cshrc.tmp
--- 298,302 ----
# Ditto for /etc/csh.cshrc
! egrep -v '^.*# '$special_string /etc/csh.cshrc > /etc/csh.cshrc.tmp
%__cp /etc/csh.cshrc.tmp /etc/csh.cshrc
%__rm -f /etc/csh.cshrc.tmp
|