~ubuntu-branches/debian/lenny/cracklib2/lenny

« back to all changes in this revision

Viewing changes to debian/cracklib-runtime.preinst

  • Committer: Bazaar Package Importer
  • Author(s): Jan Dittberner, Steve Langasek, Jan Dittberner
  • Date: 2008-10-16 21:04:24 UTC
  • mfrom: (4.1.2 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081016210424-bp06uo8c6xkjabzi
Tags: 2.8.12-8lenny1
[ Steve Langasek ]
* debian/update-cracklib: don't rely on [ -nt ] to return true when
  the second file is non-existent, since this fails under dash.
  LP: #278743.

[ Jan Dittberner ]
* integrate Ubuntu bugfix
* use set -e in debian/cracklib-runtime.preinst to fix lintian warning
  maintainer-script-ignores-errors

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
 
 
3
set -e
 
4
 
3
5
case "$1" in
4
6
install|upgrade)
5
7
    # /etc/cron.daily/cracklib -> cracklib-runtime transition
6
8
    if dpkg --compare-versions "$2" le "2.7-17"; then
7
 
            CONFFILE=/etc/cron.daily/cracklib
8
 
            if [ -e "$CONFFILE" ]; then
 
9
          CONFFILE=/etc/cron.daily/cracklib
 
10
          if [ -e "$CONFFILE" ]; then
9
11
            md5sum="`md5sum \"$CONFFILE\" | sed -e 's/ .*//'`"
10
 
            old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE'{s/.* //;p}}\" /var/lib/dpkg/status`"
 
12
            old_md5sum="`dpkg-query -W -f='${Conffiles}' cracklib-runtime|sed -n -e \"{\\\\' $CONFFILE'{s/.* //;p}}\"`"
11
13
            if [ "$md5sum" = "$old_md5sum" ]; then
12
 
                rm -f "$CONFFILE"
 
14
                  rm -f "$CONFFILE"
13
15
            fi
14
 
    fi
 
16
      fi
15
17
    fi
16
18
esac
 
19
 
 
20
#DEBHELPER#
 
21
 
 
22
exit 0