From f277d5191f3f8e018e9c6721f134fa283af5c01a Mon Sep 17 00:00:00 2001 From: "Ralf S. Engelschall" Date: Tue, 16 Apr 2002 19:36:56 +0000 Subject: [PATCH] Switch from editing /etc/shells to displaying just a hint about editing /etc/shells. This way we no longer touch anything outside the OpenPKG instance in a package except the bootstrap package. --- bash/bash.spec | 26 +++++++++++--------------- ksh/ksh.spec | 26 +++++++++++--------------- pdksh/pdksh.spec | 28 ++++++++++++---------------- tcsh/tcsh.spec | 27 +++++++++++---------------- zsh/zsh.spec | 26 +++++++++++--------------- 5 files changed, 56 insertions(+), 77 deletions(-) diff --git a/bash/bash.spec b/bash/bash.spec index 09df7aa272..a794ccfb45 100644 --- a/bash/bash.spec +++ b/bash/bash.spec @@ -33,7 +33,7 @@ Distribution: OpenPKG [REL] Group: Shell License: GPL Version: 2.05a -Release: 20020308 +Release: 20020416 # list of sources Source0: ftp://ftp.cwru.edu/pub/bash/bash-%{version}.tar.gz @@ -42,8 +42,8 @@ Source1: profile # build information Prefix: %{l_prefix} BuildRoot: %{l_buildroot} -BuildPreReq: OpenPKG, openpkg >= 20020206 -PreReq: OpenPKG, openpkg >= 20020206 +BuildPreReq: OpenPKG, openpkg >= 20020416 +PreReq: OpenPKG, openpkg >= 20020416 AutoReq: no AutoReqProv: no @@ -91,17 +91,13 @@ AutoReqProv: no rm -rf $RPM_BUILD_ROOT %post - if [ ".$1" = .1 -a -w /etc/shells ]; then - cp -p /etc/shells /tmp/shells - grep -v "$RPM_INSTALL_PREFIX/bin/bash" /etc/shells - echo "$RPM_INSTALL_PREFIX/bin/bash" >>/etc/shells - rm -f /tmp/shells + if [ ".$1" = .1 ]; then + if [ -f /etc/shells ]; then + if [ ".`grep $RPM_INSTALL_PREFIX/bin/bash /etc/shells`" = . ]; then + ( echo "Hint: If you want to use $RPM_INSTALL_PREFIX/bin/bash as the login" + echo "shell for users you have to add this path to /etc/shells, please." + ) | %{l_rpmtool} msg -b -t notice + fi + fi fi -%postun - if [ ".$1" = .0 -a -w /etc/shells ]; then - cp -p /etc/shells /tmp/shells - grep -v "$RPM_INSTALL_PREFIX/bin/bash" /etc/shells - rm -f /tmp/shells - fi - diff --git a/ksh/ksh.spec b/ksh/ksh.spec index 42e49e40d8..0b855091ec 100644 --- a/ksh/ksh.spec +++ b/ksh/ksh.spec @@ -37,7 +37,7 @@ Distribution: OpenPKG [EXP] Group: Shell License: AT&T Version: %{V_pkg} -Release: 20020327 +Release: 20020416 # list of sources Source0: http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{V_ksh}.tgz @@ -46,8 +46,8 @@ Source1: http://www.research.att.com/~gsf/download/tgz/INIT.%{V_init}.tgz # build information Prefix: %{l_prefix} BuildRoot: %{l_buildroot} -BuildPreReq: OpenPKG, openpkg >= 20020206 -PreReq: OpenPKG, openpkg >= 20020206 +BuildPreReq: OpenPKG, openpkg >= 20020416 +PreReq: OpenPKG, openpkg >= 20020416 AutoReq: no AutoReqProv: no @@ -85,17 +85,13 @@ AutoReqProv: no rm -rf $RPM_BUILD_ROOT %post - if [ ".$1" = .1 -a -w /etc/shells ]; then - cp -p /etc/shells /tmp/shells - grep -v "$RPM_INSTALL_PREFIX/bin/ksh" /etc/shells - echo "$RPM_INSTALL_PREFIX/bin/ksh" >>/etc/shells - rm -f /tmp/shells + if [ ".$1" = .1 ]; then + if [ -f /etc/shells ]; then + if [ ".`grep $RPM_INSTALL_PREFIX/bin/ksh /etc/shells`" = . ]; then + ( echo "Hint: If you want to use $RPM_INSTALL_PREFIX/bin/ksh as the login" + echo "shell for users you have to add this path to /etc/shells, please." + ) | %{l_rpmtool} msg -b -t notice + fi + fi fi -%postun - if [ ".$1" = .0 -a -w /etc/shells ]; then - cp -p /etc/shells /tmp/shells - grep -v "$RPM_INSTALL_PREFIX/bin/ksh" /etc/shells - rm -f /tmp/shells - fi - diff --git a/pdksh/pdksh.spec b/pdksh/pdksh.spec index 2650524953..7ef5f93384 100644 --- a/pdksh/pdksh.spec +++ b/pdksh/pdksh.spec @@ -31,9 +31,9 @@ Vendor: Eric Gisin, Charles Forsyth Packager: The OpenPKG Project Distribution: OpenPKG [REL] Group: Shell -License: ? +License: unknown Version: 5.2.14 -Release: 20020206 +Release: 20020416 # list of sources Source0: ftp://ftp.cs.mun.ca/pub/pdksh/pdksh-%{version}.tar.gz @@ -41,8 +41,8 @@ Source0: ftp://ftp.cs.mun.ca/pub/pdksh/pdksh-%{version}.tar.gz # build information Prefix: %{l_prefix} BuildRoot: %{l_buildroot} -BuildPreReq: OpenPKG, openpkg >= 20020206 -PreReq: OpenPKG, openpkg >= 20020206 +BuildPreReq: OpenPKG, openpkg >= 20020416 +PreReq: OpenPKG, openpkg >= 20020416 AutoReq: no AutoReqProv: no @@ -76,17 +76,13 @@ AutoReqProv: no rm -rf $RPM_BUILD_ROOT %post - if [ ".$1" = .1 -a -w /etc/shells ]; then - cp -p /etc/shells /tmp/shells - grep -v "$RPM_INSTALL_PREFIX/bin/pdksh" /etc/shells - echo "$RPM_INSTALL_PREFIX/bin/pdksh" >>/etc/shells - rm -f /tmp/shells + if [ ".$1" = .1 ]; then + if [ -f /etc/shells ]; then + if [ ".`grep $RPM_INSTALL_PREFIX/bin/pdksh /etc/shells`" = . ]; then + ( echo "Hint: If you want to use $RPM_INSTALL_PREFIX/bin/pdksh as the login" + echo "shell for users you have to add this path to /etc/shells, please." + ) | %{l_rpmtool} msg -b -t notice + fi + fi fi -%postun - if [ ".$1" = .0 -a -w /etc/shells ]; then - cp -p /etc/shells /tmp/shells - grep -v "$RPM_INSTALL_PREFIX/bin/pdksh" /etc/shells - rm -f /tmp/shells - fi - diff --git a/tcsh/tcsh.spec b/tcsh/tcsh.spec index 7de34f3455..248f5fc000 100644 --- a/tcsh/tcsh.spec +++ b/tcsh/tcsh.spec @@ -33,17 +33,16 @@ Distribution: OpenPKG [REL] Group: Shell License: BSD Version: 6.11 -Release: 20020206 +Release: 20020416 # list of sources Source0: ftp://ftp.astron.com/pub/tcsh/tcsh-%{version}.tar.gz -#Source0: ftp://ftp.fujitsu.co.jp/pub/misc/shells/tcsh/tcsh-%{version}.tgz # build information Prefix: %{l_prefix} BuildRoot: %{l_buildroot} -BuildPreReq: OpenPKG, openpkg >= 20020206 -PreReq: OpenPKG, openpkg >= 20020206 +BuildPreReq: OpenPKG, openpkg >= 20020416 +PreReq: OpenPKG, openpkg >= 20020416 AutoReq: no AutoReqProv: no @@ -79,17 +78,13 @@ AutoReqProv: no rm -rf $RPM_BUILD_ROOT %post - if [ ".$1" = .1 -a -w /etc/shells ]; then - cp -p /etc/shells /tmp/shells - grep -v "$RPM_INSTALL_PREFIX/bin/tcsh" /etc/shells - echo "$RPM_INSTALL_PREFIX/bin/tcsh" >>/etc/shells - rm -f /tmp/shells + if [ ".$1" = .1 ]; then + if [ -f /etc/shells ]; then + if [ ".`grep $RPM_INSTALL_PREFIX/bin/tcsh /etc/shells`" = . ]; then + ( echo "Hint: If you want to use $RPM_INSTALL_PREFIX/bin/tcsh as the login" + echo "shell for users you have to add this path to /etc/shells, please." + ) | %{l_rpmtool} msg -b -t notice + fi + fi fi -%postun - if [ ".$1" = .0 -a -w /etc/shells ]; then - cp -p /etc/shells /tmp/shells - grep -v "$RPM_INSTALL_PREFIX/bin/tcsh" /etc/shells - rm -f /tmp/shells - fi - diff --git a/zsh/zsh.spec b/zsh/zsh.spec index 5d0c8fccaf..0a1ec66442 100644 --- a/zsh/zsh.spec +++ b/zsh/zsh.spec @@ -33,7 +33,7 @@ Distribution: OpenPKG [REL] Group: Shell License: BSD-style Version: 4.0.4 -Release: 20020206 +Release: 20020416 # list of sources Source0: ftp://ftp.zsh.org/pub/zsh/zsh-%{version}.tar.bz2 @@ -41,8 +41,8 @@ Source0: ftp://ftp.zsh.org/pub/zsh/zsh-%{version}.tar.bz2 # build information Prefix: %{l_prefix} BuildRoot: %{l_buildroot} -BuildPreReq: OpenPKG, openpkg >= 20020206 -PreReq: OpenPKG, openpkg >= 20020206 +BuildPreReq: OpenPKG, openpkg >= 20020416 +PreReq: OpenPKG, openpkg >= 20020416 AutoReq: no AutoReqProv: no @@ -84,17 +84,13 @@ AutoReqProv: no rm -rf $RPM_BUILD_ROOT %post - if [ ".$1" = .1 -a -w /etc/shells ]; then - cp -p /etc/shells /tmp/shells - grep -v "$RPM_INSTALL_PREFIX/bin/zsh" /etc/shells - echo "$RPM_INSTALL_PREFIX/bin/zsh" >>/etc/shells - rm -f /tmp/shells + if [ ".$1" = .1 ]; then + if [ -f /etc/shells ]; then + if [ ".`grep $RPM_INSTALL_PREFIX/bin/zsh /etc/shells`" = . ]; then + ( echo "Hint: If you want to use $RPM_INSTALL_PREFIX/bin/zsh as the login" + echo "shell for users you have to add this path to /etc/shells, please." + ) | %{l_rpmtool} msg -b -t notice + fi + fi fi -%postun - if [ ".$1" = .0 -a -w /etc/shells ]; then - cp -p /etc/shells /tmp/shells - grep -v "$RPM_INSTALL_PREFIX/bin/zsh" /etc/shells - rm -f /tmp/shells - fi -