This file is indexed.

config is in geneweb 6.05.1-1.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/bin/sh

set -e
# Some ideas stolen from the cvs package

# Config script for geneweb using debconf
. /usr/share/debconf/confmodule
db_version 2.0 || [ $? -lt 30 ]

db_title "Geneweb genealogy software"

# Needs Depends: iso-codes, isoquery
ISOQUERY=/usr/bin/isoquery

# These will be used here and there below
SERVICES=/etc/services
INITFILE=/etc/init.d/geneweb
OLDRCFILE=/etc/geneweb/genewebrc
NEWRCFILE=/etc/default/geneweb
OLD_GENEWEBDB=/var/geneweb
GENEWEBDB=/var/lib/geneweb
DEFAULTLNG="en"
DEFAULTFULLLNG="English"
DEFAULTPORT=2317
DEFAULTRUNMODE="Always on"
DEFAULTREMOVE=false
DEFAULTOPTIONS=""

read_rcfile() {
    # Default values
    if [ -f $NEWRCFILE ]; then
	LNG=$DEFAULTLNG
	PORT=$DEFAULTPORT
	RUN_MODE="$DEFAULTRUNMODE"
	REMOVE=$DEFAULTREMOVE
	OPTIONS=$DEFAULTOPTIONS
	. $NEWRCFILE || true
	# Handle the transition between LANG and LNG, in case
	# the $NEWRCFILE still had LANG
	if grep -q -E "^LANG=" $NEWRCFILE ; then
	    LNG=$LANG
	fi
    fi
}

translate_LNG() {
    # Get the full language name from the two letter code
    if [ -n "$LNG" ] ; then
       FULLLNG=`$ISOQUERY --iso=639 "$LNG" | cut -f4`
    fi
}

set_debconf() {
    # Still have to find a way to store the language setting
    # (kept as "en" in rcfile and "English" in debconf
    if [ "$RUN_MODE" ]; then
        db_set geneweb/run_mode "$RUN_MODE" || true
    fi
    if [ "$FULLLNG" ]; then
        db_set geneweb/lang "$FULLLNG" || true
    fi
    if [ "$PORT" ]; then
        db_set geneweb/port "$PORT" || true
    fi
    if [ "$REMOVE" ]; then
        db_set geneweb/remove_databases "$REMOVE" || true
    fi
}

get_debconf() {
    db_get geneweb/port
    PORT=$RET

    db_get geneweb/lang
    FULLLNG=$RET

    # Find the two letter code for language
    LNG=`$ISOQUERY --iso=639 | grep "${FULLLNG}\$" | cut -f3`


    db_get geneweb/run_mode
    RUN_MODE="$RET"
}


input_settings() {
    db_input low geneweb/run_mode || true
    db_go
    db_get geneweb/run_mode
    RUN_MODE=$RET
    # If not present, use default
    if [ -z "$RUN_MODE" ]
    then
	RUN_MODE="$DEFAULTRUNMODE"
    fi
    if [ "$RUN_MODE" = "Always on" ]
    then
	# These question will be asked only when running in daemon mode
	db_input medium geneweb/lang || true
	db_go
	
	db_input low geneweb/port || true
	db_go

	db_input medium geneweb/remove_databases || true
	db_go
    fi
}


## Main program
# We first read the settings file
# in order to get admin-modified settings
read_rcfile
# We get FULLLNG ("Name (code)" style) from LNG)
translate_LNG
# Debconf-stored values are updated accordingly
set_debconf
# They are re-read from Debconf
# mostly for having the correct value for LNG
get_debconf
# In case the package has never been configured, the settings
# are asked through debconf
input_settings
# They are re-re-read from debconf
# for updating variables (LNG again)
get_debconf