~ubuntu-branches/ubuntu/karmic/sbuild/karmic

« back to all changes in this revision

Viewing changes to debian/postinst

  • Committer: Bazaar Package Importer
  • Author(s): Roger Leigh
  • Date: 2006-10-21 21:23:16 UTC
  • mfrom: (2.1.6 edgy)
  • Revision ID: james.westby@ubuntu.com-20061021212316-nh89o5rnhyk1epnn
Tags: 0.52
* New upstream release.
* sbuild: Remove incorrect WannaBuild:: prefix from version_compare.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh
2
 
3
 
# vim:et
 
2
# postinst script for sbuild
 
3
#
4
4
# see: dh_installdeb(1)
5
5
 
6
6
set -e
22
22
#     installation fails and the `postinst' is called with `abort-upgrade',
23
23
#     `abort-remove' or `abort-deconfigure'.
24
24
 
 
25
# Move a conffile without triggering a dpkg question
 
26
mv_conffile() {
 
27
    OLDCONFFILE="$1"
 
28
    NEWCONFFILE="$2"
 
29
 
 
30
    if [ -e "$OLDCONFFILE" ]; then
 
31
        echo "Preserving user changes to $NEWCONFFILE ..."
 
32
        mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new
 
33
        mv -f "$OLDCONFFILE" "$NEWCONFFILE"
 
34
    fi
 
35
}
 
36
 
25
37
case "$1" in
26
38
    configure)
27
39
 
28
 
        if [ -z "`getent group sbuild`" ]; then                        
 
40
        if dpkg --compare-versions "$2" le "0.42"; then
 
41
            mv_conffile "/etc/sbuild.conf.local" "/etc/sbuild/sbuild.conf"
 
42
        fi
 
43
 
 
44
        if [ -z "`getent group sbuild`" ]; then
29
45
            adduser --group --quiet sbuild
30
46
        fi
31
47
 
38
54
        chown -R :sbuild /var/lib/sbuild
39
55
 
40
56
        if dpkg --compare-versions "$2" le-nl "0.34"; then
41
 
          ln -sf ../share/sbuild /usr/lib/sbuild
 
57
            ln -sf ../share/sbuild /usr/lib/sbuild
42
58
        fi
43
59
 
44
60
        ;;
48
64
        ;;
49
65
 
50
66
    *)
 
67
 
51
68
        echo "postinst called with unknown argument \`$1'" >&2
52
69
        exit 0
53
 
    ;;
 
70
 
 
71
        ;;
54
72
esac
55
73
 
56
74
# dh_installdeb will replace this with shell code automatically