From 797ce11ae1cda63f8ba84e29a216b310da4d5388 Mon Sep 17 00:00:00 2001 From: kcr Date: Sun, 10 Jun 2001 11:38:59 +0000 Subject: [PATCH] changelog: see below rules default.subcriptions zephyr-server.files: * zephyr-server should have a default.subscriptions file now, closes: #94125 control: * libzephyr3-krb and zephyr-server-krb now depend on krb4-config, should improve out-of-box functionality zephyr-clients.init: * alter init script to print a message and exit 0 if no zephyr servers were specified. closes: #96723 zephyr-{clients,server}.{config,postinst,templates}: * rework debconf stuff to be more clever about where the data is coming from. git-svn-id: svn://svn.1ts.org/debian/trunk/zephyr@60 cbed1d16-5ef5-0310-b6a1-d4a37b08ba1f --- debian/changelog | 12 +++++++++++ debian/default.subscriptions | 3 +++ debian/rules | 1 + debian/zephyr-clients.config | 28 ++++++++++++++++++++------ debian/zephyr-clients.init | 12 +++++++++++ debian/zephyr-clients.postinst | 28 ++++++++++++++------------ debian/zephyr-clients.templates | 11 +++++++++++ debian/zephyr-server.config | 35 +++++++++++++++++++++++++++++++++ debian/zephyr-server.files | 1 + debian/zephyr-server.postinst | 3 +++ debian/zephyr-server.templates | 11 +++++++++++ 11 files changed, 126 insertions(+), 19 deletions(-) create mode 100644 debian/default.subscriptions diff --git a/debian/changelog b/debian/changelog index 7a6ca84..6400c9b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +zephyr (2.1.20000421.SNAPSHOT-13) unstable; urgency=low + + * The unlucky version. No warranty express or implied. YMMV. + * zephyr-server should have a default.subscriptions file now, closes: #94125 + * libzephyr3-krb and zephyr-server-krb now depend on krb4-config, should + improve out-of-box functionality + * alter init script to print a message and exit 0 if no zephyr servers + were specified. closes: #96723 + * rework debconf stuff to be more clever about where the data is coming from. + + -- Karl Ramm Sun, 10 Jun 2001 07:29:56 -0400 + zephyr (2.1.20000421.SNAPSHOT-12) unstable; urgency=low * libzephyr-dev failed to have any files in it... and no one noticed. diff --git a/debian/default.subscriptions b/debian/default.subscriptions new file mode 100644 index 0000000..2ef3863 --- /dev/null +++ b/debian/default.subscriptions @@ -0,0 +1,3 @@ +operations,message,* +message,personal,%me% +message,urgent,%me% diff --git a/debian/rules b/debian/rules index fb15d2a..36ca0d2 100755 --- a/debian/rules +++ b/debian/rules @@ -78,6 +78,7 @@ install: build mkdir -p debian/tmp/etc/zephyr/acl set -x; for i in debian/acl/*; do install -c -m 644 -o root $$i debian/tmp/etc/zephyr/acl; done; set +x install -c -m 644 debian/zephyr.vars debian/tmp/etc/zephyr + install -c -m 644 debian/default.subscriptions debian/tmp/etc/zephyr cp -pr debian/tmp/etc/zephyr/acl debian/tmp-krb/etc/zephyr # Build architecture-independent files here. diff --git a/debian/zephyr-clients.config b/debian/zephyr-clients.config index 16a003d..e07b0d0 100644 --- a/debian/zephyr-clients.config +++ b/debian/zephyr-clients.config @@ -1,14 +1,30 @@ #!/bin/sh -e . /usr/share/debconf/confmodule +db_version 2.0 -zhm_args="" -if test -f /etc/default/zephyr-clients +db_get zephyr-clients/servers || true +if test -z "$RET" then - . /etc/default/zephyr-client + # if there happens to be a zephyr server running on this machine, + # see what its debconf knows about zephyr servers... + if db_get zephyr-server/servers && -n "$RET" + then + db_set zephyr-clients/servers $RET + fi fi -if test -z "$zhm_args" + +db_get zephyr-clients/read_conf +if test -f /etc/default/zephyr-clients -a \( "$RET" = true \) then - db_input high zephyr-clients/servers || true - db_go + zhm_args="" + . /etc/default/zephyr-client + if test -n "$zhm_args" + then + db_set zephyr-clients/read_conf false + db_set zephyr-clients/servers "$zhm_args" + fi fi + +db_input high zephyr-clients/servers || true +db_go diff --git a/debian/zephyr-clients.init b/debian/zephyr-clients.init index 293d7be..bfed4a7 100644 --- a/debian/zephyr-clients.init +++ b/debian/zephyr-clients.init @@ -27,6 +27,18 @@ fi case "$1" in start) + # note that the following will need revisting when we get hesiod support + if test -z "$zhm_args" + then + cat < $tmpfile || true - fi - echo zhm_args=\"${RET}\" >> $tmpfile - cat $tmpfile > /etc/default/zephyr-clients + grep -v ^zhm_args /etc/default/zephyr-clients > $tmpfile || true + else + cat > $tmpfile << EOF +# This file is automatically rewritten by the zephyr-clients post-install +# script. So treat it right. +EOF fi + echo zhm_args=\"${RET}\" >> $tmpfile + cat $tmpfile > /etc/default/zephyr-clients ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/zephyr-clients.templates b/debian/zephyr-clients.templates index eca3119..16a1b5c 100644 --- a/debian/zephyr-clients.templates +++ b/debian/zephyr-clients.templates @@ -3,3 +3,14 @@ Type: string Description: What are your zephyr servers? Please type the full names of your zephyr servers, seperated by spaces. (note that this can be a subset of what you're telling the servers) + +Template: zephyr-clients/read_conf +Type: boolean +Default: true +Description: You should never see this + We want to try and capture user changes when they edit a config file + manually. To do this we look at the file in the config script. + However, in the case of preconfigure, the config script is run twice + before the postinst is run. Thus we may read the wrong value before the + edited value is written out in postinst. + If this is false we skip reading config files until postinst runs. diff --git a/debian/zephyr-server.config b/debian/zephyr-server.config index 762108a..a883fbb 100644 --- a/debian/zephyr-server.config +++ b/debian/zephyr-server.config @@ -1,6 +1,41 @@ #!/bin/sh -e . /usr/share/debconf/confmodule +db_version 2.0 + +db_get zephyr-server/servers || true +if -z "$RET" +then + # if there happens to be zephyr-clients runnin on this machine + # it might know something about servers. + # else default to just the current host + z="`hostname --fqdn`" + if db_get zephyr-clients/servers && -n "$RET" + then + z="$RET $z" + fi + db_set zephyr-server/servers "$z" +fi + +db_get zephyr-server/read_conf +if test -f /etc/zephyr/server.list -a \( "$RET" = true \) +then + z="" + while read x + do + z="$z $x" + done < /etc/zephyr-server.list + + # remove exterraneous whitespace + set $z + z="$*" + + if test -n "$z" + then + db_set zephyr-server/read_conf false + db_set zephyr-server/servers "$z" + fi +fi db_input high zephyr-server/servers || true db_go diff --git a/debian/zephyr-server.files b/debian/zephyr-server.files index 9bebf95..f0f9687 100644 --- a/debian/zephyr-server.files +++ b/debian/zephyr-server.files @@ -33,3 +33,4 @@ etc/zephyr/acl/xmt-user_locate.acl etc/zephyr/acl/xmt-wg_ctl.acl etc/zephyr/acl/xmt-zephyr_admin.acl etc/zephyr/acl/xmt-zephyr_ctl.acl +etc/zephyr/default.subscriptions diff --git a/debian/zephyr-server.postinst b/debian/zephyr-server.postinst index d076eec..3157084 100644 --- a/debian/zephyr-server.postinst +++ b/debian/zephyr-server.postinst @@ -26,6 +26,9 @@ case "$1" in configure) . /usr/share/debconf/confmodule + db_version 2.0 + + db_set zephyr-server/read_conf true db_get zephyr-server/servers : > /etc/zephyr/server.list diff --git a/debian/zephyr-server.templates b/debian/zephyr-server.templates index 6c53f2d..d6686a7 100644 --- a/debian/zephyr-server.templates +++ b/debian/zephyr-server.templates @@ -3,3 +3,14 @@ Type: string Description: What are your zephyr servers? Please type the full names of your zephyr servers, seperated by spaces. (Note that this can be a superset of that you're telling the clients.) + +Template: zephyr-server/read_conf +Type: boolean +Default: true +Description: You should never see this + We want to try and capture user changes when they edit a config file + manually. To do this we look at the file in the config script. + However, in the case of preconfigure, the config script is run twice + before the postinst is run. Thus we may read the wrong value before the + edited value is written out in postinst. + If this is false we skip reading config files until postinst runs. -- 2.45.2