~ubuntu-branches/ubuntu/maverick/postfix/maverick-backports

« back to all changes in this revision

Viewing changes to debian/postfix.preinst

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2006-12-12 15:33:53 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20061212153353-q7mkymc0ti2uqzsn
Tags: 2.3.5-1
* New upstream version
* mydomain needs some cleanup if we're upgrading from < 2.3.5-1 on a machine
  where hostname(2) is a short name.  Bug introduced in 2.3.3-2.  Closes: #402788

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
    fi
47
47
}
48
48
 
 
49
mydomain_warning() {
 
50
    if [ -n "$DEBCONF" ]; then
 
51
        db_fset postfix/mydomain_warning seen false
 
52
        db_input medium postfix/mydomain_warning || true
 
53
        db_go || true
 
54
        db_get postfix/mydomain_warning
 
55
        if [ "$RET" = "false" ]; then
 
56
            echo "aborting postfix install"
 
57
            exit 1
 
58
        fi
 
59
    else
 
60
        # no debconf, fall back
 
61
        cat << EOF
 
62
Postfix version 2.3.3-2 and later require changes in main.cf.
 
63
Specifically, mydomain must be specified, since hostname(2) is not
 
64
an FQDN.
 
65
EOF
 
66
        echo -n "Shall I make the change? "
 
67
        read line
 
68
        case ${line} in
 
69
            [nN]*)      echo "aborting postfix install"
 
70
                        exit 1
 
71
                        ;;
 
72
        esac
 
73
    fi
 
74
}
49
75
tlsmgr_warning() {
50
76
    if [ -n "$DEBCONF" ]; then
51
77
        db_fset postfix/tlsmgr_upgrade_warning seen false
254
280
          tlsmgr_warning
255
281
        fi
256
282
 
 
283
        if dpkg --compare-versions $version lt 2.3.5-1; then
 
284
          # droping 10hostname.dpatch forces cleanup.
 
285
          if [ -z $(postconf -n mydomain 2>/dev/null || true) ]; then
 
286
            myhost=$(hostname)
 
287
            if [ "X${myhost%.*}" = "X${myhost}" ]; then
 
288
              mydomain_warning
 
289
              touch /var/spool/postfix/mydomain-upgrade
 
290
            fi
 
291
          fi
 
292
        fi
257
293
        invoke-rc.d --quiet postfix stop || true
258
294
        ;;
259
295