This file is indexed.

config is in cvsd 1.0.22.

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
128
129
130
131
132
133
134
#!/bin/sh

set -e

# source debconf library.
. /usr/share/debconf/confmodule
db_version 2.0
db_capb backup

# set title
db_title "Configuring cvsd"

configfile="/etc/cvsd/cvsd.conf"

# read values from the current configuration file
if [ -r "$configfile" ]
then

  # Location of Chroot jail
  rootjail=`sed -n 's/^[[:space:]]*RootJail[[:space:]][[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\1/p' < "$configfile"`
  [ "x$rootjail" = "x" ] && rootjail="none"
  db_set cvsd/rootjail "$rootjail"

  # Maximum number of connections
  maxconnections=`sed -n 's/^[[:space:]]*MaxConnections[[:space:]][[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\1/p' < "$configfile"`
  [ "x$maxconnections" = "x" ] && maxconnections=0
  db_set cvsd/maxconnections "$maxconnections"

  # Nice value to run at
  nice=`sed -n 's/^[[:space:]]*Nice[[:space:]][[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\1/p' < "$configfile"`
  [ "x$nice" = "x" ] && nice=0
  db_set cvsd/nice "$nice"

  # Umask to use
  umask=`sed -n 's/^[[:space:]]*Umask[[:space:]][[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\1/p' < "$configfile"`
  [ "x$umask" = "x" ] && umask=027
  db_set cvsd/umask "$umask"

  # Address-Port combinations to listen on
  listen=`sed -n 's/^[[:space:]]*Listen[[:space:]][[:space:]]*\([^[:space:]]*\)[[:space:]][[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\1 \2/p' < "$configfile"`
  listen=`echo "$listen" | tr '\n' ' ' | sed 's/ *$//'`
  [ "x$listen" = "x" ] && listen="* 2401"
  db_set cvsd/listen "$listen"

  # get current repositories from configfile
  reposs=`sed -n 's/^[[:space:]]*Repos[[:space:]][[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\1/p' < "$configfile"`
  reposs=`echo "$reposs" | tr '\n' ':' | sed 's/:*$//'`
  db_set cvsd/repositories "$reposs"

  # read current limits
  limits=""
  for i in `sed -n 's/^[[:space:]]*Limit[[:space:]][[:space:]]*\([^[:space:]]*\)[[:space:]][[:space:]]*[^[:space:]]*[[:space:]]*$/\1/p' < "$configfile"`
  do
    limit=`sed -n 's/^[[:space:]]*Limit[[:space:]][[:space:]]*'"$i"'[[:space:]][[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\1/p' < "$configfile"`
    if db_set "cvsd/limit_$i" "$limit"
    then
      if [ -n "$limits" ]
      then
        limits="$limits, $i"
      else
        limits="$i"
      fi
    fi
  done
  db_set cvsd/limits "$limits"

fi

state="general"
while [ "$state" != "done" ]
do
  case "$state" in
  general)

    # Location of Chroot jail
    db_input medium cvsd/rootjail || true

    # Maximum number of connections
    db_input low cvsd/maxconnections || true

    # Nice value to run at
    db_input low cvsd/nice || true

    # Umask to use
    db_input low cvsd/umask || true

    # Address-Port combinations to listen on
    db_input low cvsd/listen || true

    state="repositories"
    db_go || exit 1

    # TODO: add error checking on options (especially listen)

    ;;
  repositories)

    # Repositories to have
    db_get cvsd/rootjail
    [ "$RET" = "/" ] || [ "$RET" = "none" ] && RET=""
    db_subst cvsd/repositories rootjail "$RET"
    db_input high cvsd/repositories || true

    state="whichlimits"
    db_go || state="general"

    ;;
  whichlimits)

    # Limits on cvs command
    db_capb multiselect
    db_input low cvsd/limits || true

    state="limitlist"
    db_go || state="repositories"

    ;;
  limitlist)

    # ask specific limits questions
    db_get cvsd/limits
    for i in `echo $RET | sed 's/,//g'`
    do
      db_input low "cvsd/limit_$i" || true
    done

    state="done"
    db_go || state="whichlimits"

    ;;
  esac
done

exit 0