~ubuntu-branches/ubuntu/hoary/lurker/hoary

« back to all changes in this revision

Viewing changes to debian/config

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Meurer
  • Date: 2004-09-26 16:27:51 UTC
  • Revision ID: james.westby@ubuntu.com-20040926162751-jlaijtarp1fbo45o
Tags: 1.2-3
* the "what have i done?" release
* built in up-to-date sid to make autobuilders happy
* improved README.mailman

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh 
 
2
# config script for lurker
 
3
#
 
4
set -e
 
5
 
 
6
. /usr/share/debconf/confmodule
 
7
 
 
8
# Use a state machine to allow jumping back to previous questions.
 
9
STATE=1
 
10
while [ "$STATE" != 0 -a "$STATE" != 3 ]; do
 
11
  case "$STATE" in
 
12
    1)
 
13
       if test -d /etc/apache/conf.d || test -d /etc/apache-ssl/conf.d \
 
14
                        || test -d /etc/apache-perl/conf.d; then
 
15
         db_input high lurker/apache_config || true
 
16
       else
 
17
         db_input high lurker/webserver || true
 
18
       fi
 
19
       if [ -e /etc/lurker/lurker.conf ]; then
 
20
         if dpkg --compare-versions "$2" ">=" 0.9; then
 
21
           export archve=`lurker-params -c /etc/lurker/lurker.conf -a`
 
22
           export admnme=`lurker-params -c /etc/lurker/lurker.conf -n`
 
23
           export admadr=`lurker-params -c /etc/lurker/lurker.conf -e`
 
24
         else
 
25
           export archve=`grep "^[[:space:]]*archive[[:space:]]*=" /etc/lurker/lurker.conf | sed 's/^[^=]*=[[:space:]]*\([[:graph:]]*[[:print:]]\)[[:space:]]*/\1/' | tail -1`
 
26
           export admnme=`grep "^[[:space:]]*admin_name[[:space:]]*=" /etc/lurker/lurker.conf | sed 's/^[^=]*=[[:space:]]*\([[:graph:]]*[[:print:]]\)[[:space:]]*/\1/' | tail -1`
 
27
           export admadr=`grep "^[[:space:]]*admin_address[[:space:]]*=" /etc/lurker/lurker.conf | sed 's/^[^=]*=[[:space:]]*\([[:graph:]]*[[:print:]]\)[[:space:]]*/\1/' | tail -1`
 
28
         fi
 
29
         if [ "$archve" ]; then
 
30
           db_set lurker/archive $archve
 
31
         fi
 
32
         if [ "$admnme" ]; then
 
33
           db_set lurker/admin_name $admnme
 
34
         fi
 
35
         if [ "$admadr" ]; then
 
36
           db_set lurker/admin_address $admadr
 
37
         fi
 
38
       fi
 
39
    
 
40
      db_input low lurker/archive || true
 
41
      db_input low lurker/admin_name || true
 
42
      db_input low lurker/admin_address || true
 
43
    ;;
 
44
    
 
45
    2)
 
46
       case "$1" in
 
47
         configure)
 
48
           if [ "$2" ] && dpkg --compare-versions "$2" "<" 0.6; then
 
49
             db_input high lurker/obsolete_db || true
 
50
           elif [ "$2" ] && dpkg --compare-versions "$2" "<" 1.0; then
 
51
             if [ -e /var/lib/lurker/db ]; then
 
52
                 db_input high lurker/upgrade_db || true
 
53
             fi
 
54
           fi
 
55
         ;;
 
56
       esac
 
57
    ;;
 
58
  esac
 
59
 
 
60
  if db_go || true; then
 
61
    STATE=$(($STATE + 1))
 
62
  else
 
63
    STATE=$(($STATE - 1))
 
64
  fi
 
65
done
 
66
exit 0