[arch-commits] Commit in tcsh/trunk (PKGBUILD tcsh.install)

Sébastien Luttringer seblu at nymeria.archlinux.org
Thu May 30 22:46:04 UTC 2013


    Date: Friday, May 31, 2013 @ 00:46:03
  Author: seblu
Revision: 92011

upgpkg: tcsh 6.18.01-2

- /usr merge
- add manpage for csh (symlink to tcsh.1)
- improve install script

Modified:
  tcsh/trunk/PKGBUILD
  tcsh/trunk/tcsh.install

--------------+
 PKGBUILD     |   11 ++++++-----
 tcsh.install |   30 ++++++++++++++----------------
 2 files changed, 20 insertions(+), 21 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2013-05-30 22:43:44 UTC (rev 92010)
+++ PKGBUILD	2013-05-30 22:46:03 UTC (rev 92011)
@@ -5,7 +5,7 @@
 
 pkgname=tcsh
 pkgver=6.18.01
-pkgrel=1
+pkgrel=2
 pkgdesc='Enhanced version of the Berkeley C shell.'
 arch=('i686' 'x86_64')
 url='http://www.tcsh.org/Welcome'
@@ -24,19 +24,20 @@
 build() {
   cd "${srcdir}/${pkgname}-${pkgver}"
 
-  ./configure --prefix=/usr --sysconfdir=/etc --bindir=/bin
+  ./configure --prefix=/usr --sysconfdir=/etc --bindir=/usr/bin
   make
 }
 
 package() {
   cd "${srcdir}/${pkgname}-${pkgver}"
 
-  install -dm0755 "${pkgdir}/bin/"
-
   make DESTDIR="${pkgdir}" mandir=/usr/share/man install install.man
 
   install -Dm0644 "${srcdir}/csh.cshrc" "${pkgdir}/etc/csh.cshrc"
   install -Dm0644 "${srcdir}/csh.login" "${pkgdir}/etc/csh.login"
   install -Dm0644 Copyright "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
-  ln -s tcsh "${pkgdir}/bin/csh"
+  ln -s tcsh "${pkgdir}/usr/bin/csh"
+  ln -s tcsh.1 "${pkgdir}/usr/share/man/man1/csh.1"
 }
+
+# vim:set ts=2 sw=2 et:

Modified: tcsh.install
===================================================================
--- tcsh.install	2013-05-30 22:43:44 UTC (rev 92010)
+++ tcsh.install	2013-05-30 22:46:03 UTC (rev 92011)
@@ -1,25 +1,23 @@
 post_install() {
-  if [ ! "`grep /bin/tcsh etc/shells`" ]; then
-    echo "updating /etc/shells... done."
-    sed -i "s|/bin/bash|/bin/bash\n/bin/tcsh\n/bin/csh|" etc/shells
-  else
-    sed -i "s|/usr/bin/tcsh|/bin/tcsh|" etc/shells
-    sed -i "s|/usr/bin/csh|/bin/csh|" etc/shells
-
-    echo ""
-    echo ">> WARNING: /usr/bin/tcsh has moved to /bin/tcsh,"
-    echo ">> WARNING: /usr/bin/csh has moved to /bin/csh,"
-    echo ">> please update your user accounts as needed"
-    echo ""
+  if ! grep -q /bin/tcsh etc/shells; then
+    echo /bin/tcsh >> etc/shells
+    echo /bin/csh >> etc/shells
+    echo 'Added to /etc/shells.'
   fi
 }
 
 post_upgrade() {
-	post_install $1
+  if grep -q /usr/bin/tcsh etc/shells; then
+    sed -i 's|/usr/bin/tcsh|/bin/tcsh|' etc/shells
+    sed -i 's|/usr/bin/csh|/bin/csh|' etc/shells
+    echo 'Fixed path in /etc/shells.'
+  fi
 }
 
 pre_remove() {
-  echo "updating /etc/shells... done."
-  sed -i "\|/bin/tcsh|d" etc/shells
-  sed -i "\|/bin/csh|d" etc/shells
+  sed -i '\|/bin/tcsh|d' etc/shells
+  sed -i '\|/bin/csh|d' etc/shells
+  echo 'Removed from /etc/shells.'
 }
+
+# vim:set ts=2 sw=2 et:




More information about the arch-commits mailing list