From: Russ Allbery Date: Tue, 4 May 2010 21:27:36 +0000 (-0700) Subject: Preserve AFS mount point and cache directory in cacheinfo X-Git-Tag: debian/1.5.74.1-1~9 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=d3dd2cc44931767c140f5a34e72b745d7b08e895;p=packages%2Fo%2Fopenafs.git Preserve AFS mount point and cache directory in cacheinfo * Preserve the AFS mount point and cache directorys set in /etc/openafs/cacheinfo if the file already exists rather than overwriting them with the defaults. Thanks, Liam Healy. (Closes: #580077) --- diff --git a/debian/changelog b/debian/changelog index f504e7f30..318ec03bd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,10 @@ openafs (1.5.74.1-1) UNRELEASED; urgency=low and invalidate the old cache. - Resolve symlinks in fs rmmount. - Include PID in byte-range lock warning. + * Preserve the AFS mount point and cache directorys set in + /etc/openafs/cacheinfo if the file already exists rather than + overwriting them with the defaults. Thanks, Liam Healy. + (Closes: #580077) -- Russ Allbery Tue, 04 May 2010 16:13:13 -0700 diff --git a/debian/openafs-client.postinst b/debian/openafs-client.postinst index f29916817..a12673238 100644 --- a/debian/openafs-client.postinst +++ b/debian/openafs-client.postinst @@ -62,8 +62,17 @@ if [ "$1" = configure ] || [ "$1" = reconfigure ] ; then fi fi + # Our config script will have already taken care of extracting the cache + # size from the cacheinfo file and using it as the default for the debconf + # prompt, but the mount point and cache directory have no debconf prompts. + # For those, we need to get the default from the file. + mountpoint=/afs + cachedir=/var/cache/openafs + if [ -r /etc/openafs/cacheinfo ] ; then + IFS=: read mountpoint cachedir < /etc/openafs/cacheinfo + fi db_get openafs-client/cachesize - echo /afs:/var/cache/openafs:$RET >/etc/openafs/cacheinfo + echo "${mountpoint}:${cachedir}:${RET}" > /etc/openafs/cacheinfo echo <<'EOF' > /etc/openafs/afs.conf.client # This file is managed by debconf. You may change the parameters set below,