[2517] in SIPB_Linux_Development

home help back first fref pref prev next nref lref last post

Proposed changes to package install scripts

daemon@ATHENA.MIT.EDU (Salvatore Valente)
Sat Feb 6 03:48:18 1999

Date: Sat, 6 Feb 1999 03:48:03 -0500 (EST)
To: linux-dev@MIT.EDU
From: Salvatore Valente <svalente@MIT.EDU>


I'd like the package post-removal scripts to be more conservative.
That is, I'd like them to make an honest attempt to remove any Athena
changes, but it "Don't accidentally remove local changes" should take
precedence over "Remove Athena changes."  So, if this looks ok, I'd
like to commit these changes to package-lists.

Rationale for each hunk of this patch:

1.  Use "cat" instead of "apply-patch" for /etc/services.  This way,
we avoid adding accidentally adding the Athena services more than
once, and we avoid accidentally removing local services when athena-rc
gets removed.

2.  Use "sed" instead of "apply-patch" for /etc/inetd.conf so we don't
remove local modifications when athena-rc gets removed.  This means
that the daemons that athena-rc commented out remain commented out.
This is arguably a good thing.

3.  Instead of copying /etc/athena/sendmail.cf to /etc, symlink it.
This makes it easier to make local changes.  (You can't accidentally
change the wrong one.)

4.  Only remove /etc/sendmail.cf if it's a symlink.

5.  Instead of copying /bin/athena/login, symlink it.  (It's a bit
cleaner, IMHO.)  When the package is removed, only remove /bin/login
if it's a symlink.

6.  Use "sed" instead of "apply-patch" for /etc/inittab.  The usual.

7.  Use sed and grep to remove the Athena changes from /etc/inittab.
Don't erase other local changes.

Have a nice day,
Sal.

(1) ***************
*** 934,936 ****
  
! /etc/athena/apply-patch sed /etc/services /etc/athena/services.sed athena-rc
  
--- 934,938 ----
  
! /bin/grep -q "Athena additions" /etc/services ||
! ( mv -f /etc/services /etc/services.orig &&
!   cat /etc/services.orig /etc/athena/services.add > /etc/services )
  
(2) ***************
*** 938,941 ****
  
! /etc/athena/apply-patch sed /etc/inetd.conf /etc/athena/inetd.conf.sed \
! 	athena-rc
  
--- 940,943 ----
  
! mv -f /etc/inetd.conf /etc/inetd.conf.orig &&
! sed -f /etc/athena/inetd.conf.sed < /etc/inetd.conf.orig > /etc/inetd.conf
  
(3) ***************
*** 950,953 ****
  
! /etc/athena/apply-patch replace /etc/sendmail.cf /etc/athena/sendmail.cf \
! 	athena-rc
  
--- 952,955 ----
  
! mv -f /etc/sendmail.cf /etc/sendmail.cf.orig
! ln -s /etc/athena/sendmail.cf /etc/sendmail.cf
  
(4) ***************
*** 976,980 ****
  %postun
! # remove this when nothing is left
! if [ ! -e /etc/athena/sendmail.cf -a \
! 	-f /var/athena/patched-files.athena-rc ]; then
  	for f in `cat /var/athena/patched-files.athena-rc` do;
--- 978,984 ----
  %postun
! test -L /etc/sendmail.cf && rm /etc/sendmail.cf
! test -f /etc/sendmail.cf.orig -a ! -f /etc/sendmail.cf &&
! mv /etc/sendmail.cf.orig /etc/sendmail.cf
! 
! if [ -f /var/athena/patched-files.athena-rc ]; then
  	for f in `cat /var/athena/patched-files.athena-rc` do;
(5) ***************
*** 1194,1210 ****
  
! /etc/athena/apply-patch replace /bin/login /bin/athena/login ttylogin
  
  %post
! if [ `grep -c /bin/athena/tcsh /etc/shells` = 0 ]; then
! 	echo "/bin/athena/tcsh" >> /etc/shells
! fi
  
  %postun
! if [ ! -e /bin/athena/login -a -f /var/athena/patched-files.ttylogin ]; then
!     # Restore login when we erase this package for good.
!     cd /bin
!     rm -f login
!     mv login.athsave login
!     rm -f /var/athena/patched-files.ttylogin
! fi
  
--- 1198,1210 ----
  
! mv -f /bin/login /bin/login.orig
! ln -s /bin/athena/login /bin/login
  
  %post
! /bin/grep -q /bin/athena/tcsh /etc/shells ||
! echo "/bin/athena/tcsh" >> /etc/shells
  
  %postun
! test -L /bin/login && rm /bin/login
! test -f /bin/login.orig -a ! -f /bin/login &&
! mv /bin/login.orig /bin/login
  
(6) ***************
*** 1246,1248 ****
  
! /etc/athena/apply-patch sed /etc/inittab /etc/athena/inittab.sed xlogin
  
--- 1246,1249 ----
  
! mv -f /etc/inittab /etc/inittab.orig &&
! sed -f /etc/athena/inittab.sed < /etc/inittab.orig > /etc/inittab
  
(7) ***************
*** 1255,1265 ****
  %postun
! # remove this when nothing is left
! if [ ! -e /etc/athena/inittab.sed -a -f /var/athena/patched-files.xlogin ]; then
! 	for f in `cat /var/athena/patched-files.xlogin` do;
! 		if [ -f $f.athsave ]; then
! 			mv -f $f.athsave $f
! 		fi
! 	fi
! 	rm -f /var/athena/patched-files.xlogin
! fi
  
--- 1256,1263 ----
  %postun
! #
! #  Uncomment the commented "x:5" line, and then delete the athena one.
! #
! mv -f /etc/inittab /etc/inittab.athena &&
! sed -e 's,^#x:5:,x:5:,' < /etc/inittab.athena |
! grep -v /etc/athena/dm > /etc/inittab
  

home help back first fref pref prev next nref lref last post