~ubuntu-branches/ubuntu/trusty/hyperestraier/trusty-proposed

« back to all changes in this revision

Viewing changes to debian/hyperestraier.postinst

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2006-11-14 05:28:32 UTC
  • mfrom: (2.1.4 feisty)
  • Revision ID: james.westby@ubuntu.com-20061114052832-0lzqzcefn8mt4yqe
Tags: 1.4.9-1.1
* Non-maintainer upload.
* High-urgency upload for RC bugfix.
* Set HOME=$(CURDIR)/junkhome when building, otherwise the package build
  will incorrectly look for headers there -- and fail when the directory
  exists and is unreadable, as happens sometimes on sudo-using
  autobuilders!

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
update_conf()
21
21
{
 
22
    if ! grep -q '^bindaddr:' $ROOTDIR/_conf; then
 
23
        cat <<EOF >> $ROOTDIR/_conf
 
24
# binding address of TCP (0.0.0.0 means every address)
 
25
bindaddr: 0.0.0.0
 
26
EOF
 
27
    fi
22
28
    if ! grep -q '^idleflush:' $ROOTDIR/_conf; then
23
29
        cat <<EOF >> $ROOTDIR/_conf
24
30
# idle time to start flushing (in seconds)
61
67
adminemail: webmaster@$(cat /etc/mailname)
62
68
EOF
63
69
    fi
 
70
    if ! grep -q '^backupcmd:' $ROOTDIR/_conf; then
 
71
        cat <<EOF >> $ROOTDIR/_conf
 
72
# command for backup (absolute path of a command)
 
73
backupcmd:
 
74
EOF
 
75
    fi
 
76
    if ! grep -q '^attrindex:' $ROOTDIR/_conf; then
 
77
        cat <<EOF >> $ROOTDIR/_conf
 
78
# attribute indexes (attribute name and data type)
 
79
attrindex: @mdate{{!}}seq
 
80
attrindex: @title{{!}}str
 
81
EOF
 
82
    fi
 
83
    if ! grep -q '^wildmax:' $ROOTDIR/_conf; then
 
84
        cat <<EOF >> $ROOTDIR/_conf
 
85
# maximum number of expansion of wild cards
 
86
wildmax: 256
 
87
EOF
 
88
    fi
 
89
    if ! grep -q '^limittextsize:' $ROOTDIR/_conf; then
 
90
        cat <<EOF >> $ROOTDIR/_conf
 
91
# text size limitation of indexing documents (in kilo bytes)
 
92
limittextsize: 128
 
93
EOF
 
94
    fi
 
95
    if ! grep -q '^uismlrtune:' $ROOTDIR/_conf; then
 
96
        cat <<EOF >> $ROOTDIR/_conf
 
97
# tuning parameters for similarity search
 
98
uismlrtune: 16 1024 4096
 
99
EOF
 
100
    fi
 
101
    if ! grep -q '^recvmax:' $ROOTDIR/_conf; then
 
102
        cat <<EOF >> $ROOTDIR/_conf
 
103
# maximum length of data to receive (in kilobytes)
 
104
recvmax: 1024
 
105
EOF
 
106
    fi
 
107
    if ! grep -q '^scalepred:' $ROOTDIR/_conf; then
 
108
        cat <<EOF >> $ROOTDIR/_conf
 
109
# scale prediction (1:small, 2:medium, 3:large, 4:huge)
 
110
scalepred: 2
 
111
EOF
 
112
    fi
 
113
    if ! grep -q '^scoreexpr:' $ROOTDIR/_conf; then
 
114
        cat <<EOF >> $ROOTDIR/_conf
 
115
# score expression (1:void, 2:char, 3:int, 4:asis)
 
116
scoreexpr: 2
 
117
EOF
 
118
    fi
 
119
    if ! grep -q '^uiphraseform:' $ROOTDIR/_conf; then
 
120
        cat <<EOF >> $ROOTDIR/_conf
 
121
# mode of phrase form (1:usual, 2:simplified, 3:rough, 4:union: 5:intersection)
 
122
uiphraseform: 2
 
123
EOF
 
124
    fi
 
125
 
64
126
}
65
127
 
66
 
make_tempdb()
 
128
update_kwd()
67
129
{
68
130
    tempdb=$(mktemp -d /tmp/estmaster.XXXXXX)
69
 
    estmaster init $tempdb > /dev/null 2>&1
70
 
    estmaster unittest $tempdb > /dev/null 2>&1
71
 
}
72
 
remove_tempdb()
73
 
{
74
 
    rm -rf $tempdb
75
 
}
76
 
 
77
 
update_kwd()
78
 
{
 
131
    estcmd gather $tempdb - < /dev/null > /dev/null
79
132
    for node in $ROOTDIR/_node/*
80
133
    do
81
134
      test -d "$node" || continue
82
135
      if ! test -d "$node/_kwd"; then
83
 
          cp -a $tempdb/_node/sample1/_kwd $node
 
136
          cp -a $tempdb/_attr $node/_kwd
84
137
      fi
85
138
    done
 
139
    rm -rf $tempdb
86
140
}
87
141
 
88
142
case "$1" in
100
154
                  rm -rf $nodedir
101
155
                  echo -n "node/$nodename"
102
156
                  nodetmp=$ROOTDIR.dpkg-tmp/_node/$nodename
 
157
                  # XXX: estcmd gather?
103
158
                  for id in $nodetmp/*
104
159
                  do
105
160
                    test -f $id || continue
109
164
                echo "done."
110
165
            fi
111
166
            update_conf
112
 
            make_tempdb
113
167
            update_kwd
114
 
            remove_tempdb
115
168
            chown -R $USER $ROOTDIR
116
169
        else
117
170
           # no db found. create now