]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Reformat and comment scripts some to make it easier to follow what's
authorRuss Allbery <rra@debian.org>
Sun, 1 May 2005 06:25:31 +0000 (06:25 +0000)
committerRuss Allbery <rra@debian.org>
Sun, 1 May 2005 06:25:31 +0000 (06:25 +0000)
going on.

debian/openafs-client.postinst
debian/sysname

index 728ab32ffd6e4f95d0d88b68b4e2f7cdfe2a6449..8b4a3394ab409750e103a695933b550e42ae4535 100644 (file)
@@ -1,82 +1,88 @@
 #! /bin/sh
-# postinst script for openafs
+#
+# Summary of how this script can be called:
+#
+#  * <postinst> `configure' <most-recently-configured-version>
+#  * <old-postinst> `abort-upgrade' <new version>
+#  * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#    <new-version>
+#  * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#    <failed-install-package> <version> `removing'
+#    <conflicting-package> <version>
 
 set -e
 
-# summary of how this script can be called:
-#        * <postinst> `configure' <most-recently-configured-version>
-#        * <old-postinst> `abort-upgrade' <new version>
-#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
-#          <new-version>
-#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
-#          <failed-install-package> <version> `removing'
-#          <conflicting-package> <version>
-
 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 </etc/openafs/CellServDB.new` -eq 1 ] ; then
-                           echo None of the hostnames resolved to an address 2>&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 </etc/openafs/CellServDB.new` -eq 1 ] ; then
+                echo None of the hostnames resolved to an address 2>&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
-
-
index d1aa91492603be120dcca2aa07bf98ab20122616..bf7bc129af953c8deae02861a21555e554e1afda 100755 (executable)
@@ -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