From: Russ Allbery Date: Tue, 23 Aug 2005 06:19:31 +0000 (+0000) Subject: * Fill in the server CellServDB with information about the local cell, X-Git-Tag: debian/1.4rc1-1~20 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=b58d5f87f521b8f1fc6e5dc0e421add4f03c313a;p=packages%2Fo%2Fopenafs.git * Fill in the server CellServDB with information about the local cell, if available in the client CellServDB, rather than always initializing it to contain just the name of the cell. Also reformat openafs-fileserver.postinst to make it a bit easier to read. --- diff --git a/debian/changelog b/debian/changelog index a18b233d9..525248e7e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,9 @@ openafs (1.3.87-2) unstable; urgency=low dynroot. afs-newcell generates the server CellServDB directly to work around oddities with bos addhost. Thanks to Fahemm Mitha and Sergio Gelato for analysis and patches. (Closes: #322638) + * Fill in the server CellServDB with information about the local cell, + if available in the client CellServDB, rather than always initializing + it to contain just the name of the cell. * Detect AFS caches on non-ext2/ext3 file systems and abort AFS client initialization. (Closes: #249315) * Don't create the unused /etc/openafs/AFSLog file. (Closes: #120097) diff --git a/debian/openafs-fileserver.postinst b/debian/openafs-fileserver.postinst index bc234b06f..2c49fc320 100644 --- a/debian/openafs-fileserver.postinst +++ b/debian/openafs-fileserver.postinst @@ -1,48 +1,55 @@ #!/bin/sh -e - -# summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' -# -# * `abort-deconfigure' `in-favour' -# `removing' -# +# +# Summary of how this script can be called: +# +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# + +set -e case "$1" in - configure) - - . /usr/share/debconf/confmodule - - db_version 2.0 - - db_get openafs-fileserver/thiscell - echo $RET >/etc/openafs/server/ThisCell - if [ -f /etc/openafs/server/CellServDB ] ; then : - else echo \>$RET >/etc/openafs/server/CellServDB - fi - if [ "x$2" != "x" ] ; then - if dpkg --compare-versions $2 lt 1.2.0-1 ; then - mv /etc/openafs/server-local/BosConfig /etc/openafs/BosConfig ||true - mv /etc/openafs/server-local/sysid /var/lib/openafs ||true - fi - fi - db_stop +configure) + . /usr/share/debconf/confmodule + db_version 2.0 + + db_get openafs-fileserver/thiscell + echo $RET >/etc/openafs/server/ThisCell + + if [ -f /etc/openafs/server/CellServDB ] ; then + : + else + sed -n "/^>$RET/,/^>/p" /etc/openafs/CellServDB | sed '$d' \ + >/etc/openafs/server/CellServDB + if [ ! -s /etc/openafs/server/CellServDB ] ; then + echo ">$RET" >/etc/openafs/server/CellServDB + fi + fi + if [ "x$2" != "x" ] ; then + if dpkg --compare-versions $2 lt 1.2.0-1 ; then + mv /etc/openafs/server-local/BosConfig \ + /etc/openafs/BosConfig || true + mv /etc/openafs/server-local/sysid /var/lib/openafs || true + fi + fi + db_stop ;; - 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 - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. +# dh_installdeb will replace this with shell code automatically generated by +# other debhelper scripts. #DEBHELPER# exit 0