From 2ecd88f42aea6237fab25793906a7760375e537c Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Sun, 1 May 2005 06:25:31 +0000 Subject: [PATCH] Reformat and comment scripts some to make it easier to follow what's going on. --- debian/openafs-client.postinst | 142 +++++++++++++++++---------------- debian/sysname | 53 ++++++------ 2 files changed, 102 insertions(+), 93 deletions(-) diff --git a/debian/openafs-client.postinst b/debian/openafs-client.postinst index 728ab32ff..8b4a3394a 100644 --- a/debian/openafs-client.postinst +++ b/debian/openafs-client.postinst @@ -1,82 +1,88 @@ #! /bin/sh -# postinst script for openafs +# +# Summary of how this script can be called: +# +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# set -e -# summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' -# -# * `abort-deconfigure' `in-favour' -# `removing' -# - case "$1" in - configure) - - update-alternatives --install /usr/bin/pagsh pagsh /usr/bin/pagsh.openafs 100 +configure) + update-alternatives --install /usr/bin/pagsh pagsh \ + /usr/bin/pagsh.openafs 100 + test -d /afs || mkdir /afs - test -d /afs || mkdir /afs . /usr/share/debconf/confmodule - - db_version 2.0 - - db_get openafs-client/thiscell - echo $RET >/etc/openafs/ThisCell - THISCELL=$RET - - if test -f /etc/openafs/CellServDB; then : - else cp /usr/share/openafs/CellServDB \ - /etc/openafs - fi - if grep -q -F "$RET" /etc/openafs/CellServDB&& [ "x$RET" != "x" ] ; then : - else db_input critical openafs-client/cell-info || true - db_input high openafs-client/run-client ||true - db_go - db_get openafs-client/cell-info - if [ "x$RET" != "x" ] ; then - echo \>$THISCELL >/etc/openafs/CellServDB.new - perl -MSocket -e 'foreach (@ARGV) {' \ - -e '@a=gethostbyname($_) and ' \ - -e 'printf("%s\t\t# %s\n",inet_ntoa($a[4]),$a[0]) }' $RET \ - >>/etc/openafs/CellServDB.new - if [ `wc -l &1 - db_reset openafs-client/cell-info ||true - exit 1 - fi - cat /etc/openafs/CellServDB.new \ - /etc/openafs/CellServDB >/etc/openafs/CellServDB.tmp - mv /etc/openafs/CellServDB.tmp \ - /etc/openafs/CellServDB - rm /etc/openafs/CellServDB.new - fi - fi - - db_get openafs-client/cachesize - echo /afs:/var/cache/openafs:$RET >/etc/openafs/cacheinfo - - db_get openafs-client/run-client - echo AFS_CLIENT=$RET >/etc/openafs/afs.conf.client - db_get openafs-client/afsdb - echo AFS_AFSDB=$RET >>/etc/openafs/afs.conf.client - db_get openafs-client/crypt - echo AFS_CRYPT=$RET >>/etc/openafs/afs.conf.client -db_get openafs-client/dynroot -echo AFS_DYNROOT=$RET >>/etc/openafs/afs.conf.client -db_get openafs-client/fakestat -echo AFS_FAKESTAT=$RET >>/etc/openafs/afs.conf.client + db_version 2.0 + + db_get openafs-client/thiscell + echo $RET >/etc/openafs/ThisCell + THISCELL=$RET + + if test -f /etc/openafs/CellServDB ; then + : + else + cp /usr/share/openafs/CellServDB /etc/openafs + fi + + # If ThisCell is not in CellServDB, we have to prompt the user for the + # VLDB servers. Unfortunately, we can't do this in config because we + # need the CellServDB file, which is part of the package. We have to + # override a lintian warning for this since prompts at installation time + # are frowned upon. + if grep -q -F "$RET" /etc/openafs/CellServDB && [ "x$RET" != "x" ] ; then + : + else + db_input critical openafs-client/cell-info || true + db_input high openafs-client/run-client || true + db_go + db_get openafs-client/cell-info + if [ "x$RET" != "x" ] ; then + echo \>$THISCELL > /etc/openafs/CellServDB.new + perl -MSocket -e 'foreach (@ARGV) {' \ + -e '@a=gethostbyname($_) and ' \ + -e 'printf("%s\t\t# %s\n",inet_ntoa($a[4]),$a[0]) }' $RET \ + >>/etc/openafs/CellServDB.new + if [ `wc -l &1 + db_reset openafs-client/cell-info || true + exit 1 + fi + cat /etc/openafs/CellServDB.new /etc/openafs/CellServDB \ + >/etc/openafs/CellServDB.tmp + mv /etc/openafs/CellServDB.tmp /etc/openafs/CellServDB + rm /etc/openafs/CellServDB.new + fi + fi + + db_get openafs-client/cachesize + echo /afs:/var/cache/openafs:$RET >/etc/openafs/cacheinfo + + db_get openafs-client/run-client + echo AFS_CLIENT=$RET >/etc/openafs/afs.conf.client + db_get openafs-client/afsdb + echo AFS_AFSDB=$RET >>/etc/openafs/afs.conf.client + db_get openafs-client/crypt + echo AFS_CRYPT=$RET >>/etc/openafs/afs.conf.client + db_get openafs-client/dynroot + echo AFS_DYNROOT=$RET >>/etc/openafs/afs.conf.client + db_get openafs-client/fakestat + echo AFS_FAKESTAT=$RET >>/etc/openafs/afs.conf.client ;; - abort-upgrade|abort-remove|abort-deconfigure) - +abort-upgrade|abort-remove|abort-deconfigure) ;; - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 0 +*) + echo "postinst called with unknown argument '$1'" >&2 + exit 0 ;; esac @@ -86,5 +92,3 @@ esac #DEBHELPER# exit 0 - - diff --git a/debian/sysname b/debian/sysname index d1aa91492..bf7bc129a 100755 --- a/debian/sysname +++ b/debian/sysname @@ -1,31 +1,36 @@ #!/bin/sh +# Maps Debian architectures to AFS sysnames for building the clients and +# libraries. This doesn't worry about the kernel version; kern-sysname +# does that when building the kernel module. +# +# Not all architectures are listed, only those that OpenAFS supports. + case `dpkg --print-installation-architecture` in - alpha) - echo alpha_linux_24 - ;; +alpha) + echo alpha_linux_24 + ;; +amd64) + echo amd64_linux24 + ;; +hppa) + echo parisc_linux24 + ;; i[3456]86) - echo i386_linux24 -;; - ia64) + echo i386_linux24 + ;; +ia64) echo ia64_linux24 -;; - hppa) - echo parisc_linux24 - ;; - powerpc) - echo ppc_linux24 - ;; - sparc|sparc64) - echo sparc_linux24 - ;; - s390) + ;; +powerpc) + echo ppc_linux24 + ;; +s390) echo s390_linux24 ;; - amd64) - echo amd64_linux24 - ;; - *) - echo ERROr: sysname not yet known - exit 1 - +sparc|sparc64) + echo sparc_linux24 + ;; +*) + echo ERROr: sysname not yet known + exit 1 esac -- 2.39.5