]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Preserve AFS mount point and cache directory in cacheinfo
authorRuss Allbery <rra@debian.org>
Tue, 4 May 2010 21:27:36 +0000 (14:27 -0700)
committerRuss Allbery <rra@debian.org>
Tue, 4 May 2010 23:20:33 +0000 (16:20 -0700)
* 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)

debian/changelog
debian/openafs-client.postinst

index f504e7f30956db4a8d7d2a2a6b84243badf3c137..318ec03bd5bdc9d5e6fb49abab697e7256346a7c 100644 (file)
@@ -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 <rra@debian.org>  Tue, 04 May 2010 16:13:13 -0700
 
index f299168179dcb122d90f9548a240bb2ce7e7d4ab..a12673238098faa5e885c0ed3dc590fd7b4f384e 100644 (file)
@@ -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,