~ubuntu-branches/ubuntu/lucid/bogofilter/lucid-security

« back to all changes in this revision

Viewing changes to src/bf_copy.in

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2009-05-06 05:41:52 UTC
  • mfrom: (1.1.11 upstream) (2.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090506054152-tgameecssbuv4np6
Tags: 1.2.0-2ubuntu1
* Merge from debian unstable, remaining changes: LP: #372497
  - don't build qdbm.
  - Don't build tokyocabinet support as it's in universe.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
#    use to copy wordlist.db and related files
6
6
#    from one directory to another
7
7
 
8
 
# $Id: bf_copy.in 5906 2005-05-08 20:09:53Z m-a $
 
8
# $Id: bf_copy.in 6750 2008-10-15 23:18:45Z clint $
9
9
 
10
10
set -e # die on errors
11
11
 
 
12
: ${BOGOUTIL:=@transformed_bogoutil@}
 
13
 
12
14
COMPACT=0
13
15
while test "$1" ; do
14
16
    case "$1" in
30
32
DST="$2"
31
33
 
32
34
# flush mempools
33
 
bogoutil --db-checkpoint="$SRC" || :
 
35
$BOGOUTIL --db-checkpoint="$SRC" || :
34
36
 
35
37
mkdir "$DST"
36
38
 
39
41
trap "rm -rf $TMP \"$DST\"" 0
40
42
if test $COMPACT -eq 1 ; then
41
43
  # don't copy unneeded logs
42
 
  bogoutil --db-list-logfiles="$SRC" >$TMP
 
44
  $BOGOUTIL --db-list-logfiles="$SRC" >$TMP
43
45
else
44
46
  : >$TMP
45
47
fi
50
52
if test -f "$SRC"/DB_CONFIG ; then cp -p "$SRC"/DB_CONFIG "$DST" ; fi
51
53
 
52
54
for FILE in "$SRC"/*.db ; do
53
 
    SIZE=`bogoutil --db-print-pagesize="$FILE"`
 
55
    SIZE=`$BOGOUTIL --db-print-pagesize="$FILE"`
54
56
    dd bs=$SIZE if=$FILE of="$DST/"`basename "$FILE"`
55
57
done
56
58
 
57
 
if test "$LOGS" ; then bogoutil --db-recover="$DST" ; fi
 
59
if test "$LOGS" ; then $BOGOUTIL --db-recover="$DST" ; fi
58
60
rm -f $TMP
59
61
trap - 0