~ubuntu-branches/ubuntu/hardy/glibc/hardy-updates

« back to all changes in this revision

Viewing changes to debian/debhelper.in/libc.preinst

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2008-04-03 21:50:42 UTC
  • Revision ID: james.westby@ubuntu.com-20080403215042-nstfsfokfxagm2k8
Tags: 2.7-10ubuntu1
* Merge remaining changes from 2.7-10 (r2869:2892).
* If RELEASE_UPGRADE_MODE is set to `desktop', make the glibc/restart-services,
  glibc/restart-failed and glibc/upgrade questions of medium priority (and
  restarting the services automatically).  LP: #174002.
  Works as well around the upgrade errors mentioned in LP #205079 in a KDE
  environment, when the upgrade is done using the update-manager.
* debian/rules: Always use the package settings for *FLAGS, not the settings
  from the environment.
* Fail the build if regressions are found running the testsuite compared to
  expected results from debian/expected_test_summary. Take initial values
  from a PPA build predating this upload.
* Merge from Debian trunk:
  - local/manpages/ld.so.8: fix libraries search order.  Closes: #473458.
  - Update Finish debconf translation, by Esko Arajärvi.  Closes: #473802.
  - Add any/cvs-strerror_r.diff to make strerror_r actually thread safe.
    Closes: #456531.
* debian/rules.d/build.mk: Call `sync' before building the tarball of
  supported locales. Our buildds trigger http://lkml.org/lkml/2007/8/1/337
  on every build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
set -e
3
3
export LC_ALL=C
4
4
 
5
 
if [ "$1" = upgrade ]
 
5
type=$1
 
6
preversion=$2
 
7
 
 
8
if [ "$type" = upgrade ]
6
9
then
7
 
    if dpkg --compare-versions "$2" le 2.2.2-4 && test -e /lib/libdb.so.3; then
8
 
        # Make upgrades to newer libdb.so.3 easier
9
 
        cat /lib/libdb.so.3 > /lib/libdb.so.3.old
10
 
    fi
11
 
    if dpkg --compare-versions "$2" le 2.1.1-0.1; then
12
 
        if [ -f /var/run/utmpd.pid ]; then
13
 
            if kill -s TERM `cat /var/run/utmpd.pid` > /dev/null 2>&1
14
 
            then
15
 
                if [ -f /var/run/utmp ]; then
16
 
                    cp /dev/null /var/run/utmp
17
 
                    if grep '^utmp:' /etc/group; then
18
 
                        chown root:utmp /var/run/utmp
19
 
                        chmod 664 /var/run/utmp
20
 
                    else
21
 
                        chown root:root /var/run/utmp
22
 
                        chmod 644 /var/run/utmp
23
 
                    fi
24
 
                fi
25
 
                if [ -f /var/log/wtmp ]; then
26
 
                    savelog /var/log/wtmp
27
 
                    touch /var/log/wtmp
28
 
                    if grep '^utmp:' /etc/group; then
29
 
                        chown root:utmp /var/log/wtmp
30
 
                        chmod 664 /var/log/wtmp
31
 
                    else
32
 
                        chown root:root /var/log/wtmp
33
 
                        chmod 644 /var/log/wtmp
34
 
                    fi
35
 
                fi
36
 
                rm -f /etc/init.d/utmpd
37
 
                update-rc.d utmpd remove > /dev/null
38
 
            fi
39
 
        fi
40
 
        if [ -f /var/run/utmpx ]; then rm -f /var/run/utmpx; fi
41
 
        if [ -f /var/log/wtmpx ]; then rm -f /var/log/wtmpx*; fi
42
 
        if [ -e /var/run/utmpd.ro ]; then rm -f /var/run/utmpd.ro; fi
43
 
        if [ -e /var/run/utmpd.rw ]; then rm -f /var/run/utmpd.rw; fi
44
 
    fi
45
 
 
46
10
    # Load debconf module if available
47
11
    if [ -f /usr/share/debconf/confmodule ] ; then
48
12
        . /usr/share/debconf/confmodule
49
13
    fi
50
 
    # NSS authentication trouble guard
51
 
    if dpkg --compare-versions $2 lt 2.6-1; then
52
 
 
53
 
        check="gdm kdm proftpd postgresql xscreensaver xdm"
54
 
        # NSS services check: NSS_CHECK
55
 
        if [ -n "$services" ]; then 
56
 
            if [ -f /usr/share/debconf/confmodule ] ; then
57
 
                db_version 2.0
58
 
                db_reset glibc/upgrade
59
 
                db_subst glibc/upgrade services $services
60
 
                db_input critical glibc/upgrade || true
61
 
                db_go || true
62
 
                db_get glibc/upgrade
63
 
                answer=$RET
64
 
            else
65
 
                echo "Name Service Switch update in the GNU C Library"
66
 
                echo
67
 
                echo "Running services and programs that are using NSS need to be restarted,"
68
 
                echo "otherwise they might not be able to do lookup or authentication any more."
69
 
                echo "The installation process is able to restart some services (such as ssh or"
70
 
                echo "telnetd), but other programs cannot be restarted automatically.  One such"
71
 
                echo "program that needs manual stopping and restart after the glibc upgrade by"
72
 
                echo "yourself is xdm - because automatic restart might disconnect your active"
73
 
                echo "X11 sessions."
74
 
                echo
75
 
                echo "This script detected the following installed services which must be"
76
 
                echo "stopped before the upgrade: $services"
77
 
                echo
78
 
                echo "If you want to interrupt the upgrade now and continue later, please"
79
 
                echo "answer No to the question below."
80
 
                echo 
81
 
                frontend=`echo "$DEBIAN_FRONTEND" | tr '[:upper:]' '[:lower:]'`
82
 
                if [ "$frontend" = noninteractive ]; then
83
 
                    echo "Non-interactive mode, upgrade glibc forcibly"
84
 
                    answer=true
 
14
 
 
15
    if [ -n "$preversion" ]; then
 
16
        # NSS authentication trouble guard
 
17
        if dpkg --compare-versions "$preversion" lt 2.6-1; then
 
18
 
 
19
            check="gdm kdm proftpd postgresql xscreensaver xdm"
 
20
            # NSS services check: NSS_CHECK
 
21
            if [ -n "$services" ]; then 
 
22
                if [ -f /usr/share/debconf/confmodule ] ; then
 
23
                    db_version 2.0
 
24
                    db_reset glibc/upgrade
 
25
                    db_subst glibc/upgrade services $services
 
26
                    if [ "$RELEASE_UPGRADE_MODE" = desktop ]; then
 
27
                        db_input medium glibc/upgrade || true
 
28
                    else
 
29
                        db_input critical glibc/upgrade || true
 
30
                    fi
 
31
                    db_go || true
 
32
                    db_get glibc/upgrade
 
33
                    answer=$RET
85
34
                else
86
 
                    echo -n "Do you want to upgrade glibc now? [Y/n] "
87
 
                    read answer
88
 
                    case $answer in
89
 
                        Y*|y*) answer=true ;;
90
 
                        N*|n*) answer=false ;;
91
 
                        *) answer=true ;;
92
 
                    esac
 
35
                    echo "Name Service Switch update in the GNU C Library"
 
36
                    echo
 
37
                    echo "Running services and programs that are using NSS need to be restarted,"
 
38
                    echo "otherwise they might not be able to do lookup or authentication any more."
 
39
                    echo "The installation process is able to restart some services (such as ssh or"
 
40
                    echo "telnetd), but other programs cannot be restarted automatically.  One such"
 
41
                    echo "program that needs manual stopping and restart after the glibc upgrade by"
 
42
                    echo "yourself is xdm - because automatic restart might disconnect your active"
 
43
                    echo "X11 sessions."
 
44
                    echo
 
45
                    echo "This script detected the following installed services which must be"
 
46
                    echo "stopped before the upgrade: $services"
 
47
                    echo
 
48
                    echo "If you want to interrupt the upgrade now and continue later, please"
 
49
                    echo "answer No to the question below."
 
50
                    echo 
 
51
                    frontend=`echo "$DEBIAN_FRONTEND" | tr '[:upper:]' '[:lower:]'`
 
52
                    if [ "$frontend" = noninteractive ]; then
 
53
                        echo "Non-interactive mode, upgrade glibc forcibly"
 
54
                        answer=true
 
55
                    else
 
56
                        echo -n "Do you want to upgrade glibc now? [Y/n] "
 
57
                        read answer
 
58
                        case $answer in
 
59
                            Y*|y*) answer=true ;;
 
60
                            N*|n*) answer=false ;;
 
61
                            *) answer=true ;;
 
62
                        esac
 
63
                    fi
 
64
                    echo
93
65
                fi
94
 
                echo
95
 
            fi
96
66
 
97
 
            if [ "x$answer" != "xtrue" ]; then
98
 
                echo "Stopped glibc upgrade.  Please retry the upgrade after you have"
99
 
                echo "checked or stopped services by hand."
100
 
                exit 1
 
67
                if [ "x$answer" != "xtrue" ]; then
 
68
                    echo "Stopped glibc upgrade.  Please retry the upgrade after you have"
 
69
                    echo "checked or stopped services by hand."
 
70
                    exit 1
 
71
                fi
101
72
            fi
102
 
        fi
103
 
    fi
 
73
        fi # end upgrading and $preversion lt 2.6-1
 
74
    fi # Upgrading
104
75
 
105
76
    # This will keep us from using hwcap libs (optimized) during an
106
77
    # upgrade.
154
125
  return 1
155
126
}
156
127
 
157
 
if [ "$1" != abort-upgrade ]
 
128
if [ "$type" != abort-upgrade ]
158
129
then
159
130
  ldbytes=`head -c 20 RTLD | od -c`
160
131
  dirs="/lib32 /lib64 /usr/local/lib /usr/local/lib32 /usr/local/lib64"
222
193
  fi
223
194
fi
224
195
 
225
 
if [ "$1" != abort-upgrade ]
 
196
if [ "$type" != abort-upgrade ]
226
197
then
227
198
    # glibc kernel version check: KERNEL_VERSION_CHECK
228
199
fi