ACCC1380 commited on
Commit
1d37b1d
1 Parent(s): 9b47298

Upload var/lib/dpkg/info/libc6:amd64.postinst with huggingface_hub

Browse files
var/lib/dpkg/info/libc6:amd64.postinst ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ set -e
3
+ export LC_ALL=C
4
+
5
+ type=$1
6
+ preversion=$2
7
+
8
+ checkpkgver () {
9
+ local status pkg
10
+ pkg=$1
11
+ status=$(dpkg -s $pkg 2>/dev/null | grep ^Status: | sed -e 's/^Status: \(.*\) \(.*\) \(.*\)/\3/g')
12
+ if [ -n "$status" ] && [ "$status" != "not-installed" ] && [ "$status" != "config-files" ]; then
13
+ echo $(dpkg -s $pkg 2>/dev/null | grep ^Version: | sed -e 's/^Version: *//');
14
+ fi
15
+ }
16
+
17
+ if [ "$type" = "configure" ]
18
+ then
19
+ # We don't use a registry anymore, remove the old file
20
+ rm -f /etc/ld.so.hwcappkgs
21
+
22
+ # /etc/ld.so.nohwcap code:
23
+ # Handle upgrades when libc-opt package has been installed.
24
+ # When a /etc/ld.so.nohwcap file exists, ld.so only use libraries
25
+ # from /lib, and ignore all optimised libraries. This file is
26
+ # inconditionaly created in the preinst script of libc.
27
+
28
+ # We check the version between the current installed libc and
29
+ # all optimized packages. Due to multiarch, this has to be done
30
+ # independently of the architecture of the package.
31
+ all_upgraded=yes
32
+ for pkg in libc6.1-alphaev67 libc6-xen ; do
33
+ ver=$(dpkg-query -l $pkg 2>/dev/null | sed -e '/^[a-z][a-z]\s/!d;/^.[nc]/d;' -e "s/^..\s\+$pkg[0-9a-z:]*\s\+//;s/\s.*//g")
34
+ if [ -n "$ver" ] && [ "$ver" != "2.31-0ubuntu9.14" ]; then
35
+ all_upgraded=no
36
+ fi
37
+ done
38
+
39
+ # If the versions of all optimized packages are the same as the libc
40
+ # one, we could remove /etc/ld.so.nohwcap. Otherwise, it will be removed
41
+ # when all optimized packages are upgraded or removed.
42
+ if [ "$all_upgraded" = yes ] ; then
43
+ rm -f /etc/ld.so.nohwcap
44
+ fi
45
+
46
+
47
+ # Load debconf module if available
48
+ if [ -f /usr/share/debconf/confmodule ] ; then
49
+ . /usr/share/debconf/confmodule
50
+ fi
51
+
52
+ if [ -n "$preversion" ] && [ -x "$(which ischroot)" ] && ! ischroot; then
53
+ if dpkg --compare-versions "$preversion" lt 2.31; then
54
+ check=""
55
+ [ -f /var/run/services.need_restart ] && check=$(sort -u /var/run/services.need_restart 2>/dev/null)
56
+ # Change service names back into package names, so that we can
57
+ # double-check package installation.
58
+ check=$(echo "$check" | \
59
+ sed -e's/\batd\b/at/g' \
60
+ -e's/\bdovecot\b/dovecot-common/g' \
61
+ -e's/\bexim4\b/exim4-base/g' \
62
+ -e's/\blpd\b/lpr/g' \
63
+ -e's/\blpd-ppd\b/lpr-ppd/g' \
64
+ -e's/\bmysql\b/mysql-server/g' \
65
+ -e's/\bsaslauthd\b/sasl2-bin/g' \
66
+ -e's/\bsmbd\b/samba/g' \
67
+ -e's/\bpostgresql\b/postgresql-common/g' \
68
+ )
69
+
70
+ # Check to see which of the services that were running at unpack
71
+ # time are still around
72
+ # the following substitution processes the check variable
73
+ # and returns results in the services variable
74
+ # NSS services check:
75
+ echo -n "Checking for services that may need to be restarted..."
76
+ # Only get the ones that are installed, of the same architecture
77
+ # as libc (or arch all) and configured
78
+ [ -n "$check" ] && check=$(dpkg-query -W -f='${binary:Package} ${Status} ${Architecture}\n' $check 2> /dev/null | \
79
+ grep -E "installed (all|${DPKG_MAINTSCRIPT_ARCH})$" | sed 's/[: ].*//')
80
+ # some init scripts don't match the package names
81
+ check=$(echo $check | \
82
+ sed -e's/\bat\b/atd/g' \
83
+ -e's/\bdovecot-common\b/dovecot/g' \
84
+ -e's/\bexim4-base\b/exim4/g' \
85
+ -e's/\blpr\b/lpd/g' \
86
+ -e's/\blpr-ppd\b/lpd-ppd/g' \
87
+ -e's/\bmysql-server\b/mysql/g' \
88
+ -e's/\bsasl2-bin\b/saslauthd/g' \
89
+ -e's/\bsamba\b/smbd/g' \
90
+ -e's/\bpostgresql-common\b/postgresql/g' \
91
+ )
92
+ echo
93
+ echo "Checking init scripts..."
94
+ for service in $check; do
95
+ invoke-rc.d ${service} status >/dev/null 2>/dev/null && status=0 || status=$?
96
+ if [ "$status" = "0" ] || [ "$status" = "2" ] ; then
97
+ services="$service $services"
98
+ elif [ "$status" = "100" ] ; then
99
+ echo "WARNING: init script for $service not found."
100
+ fi
101
+ done
102
+
103
+ # If there are services that we *stopped* in the preinst, don't
104
+ # forget to restart them now
105
+ if [ -e /var/run/services.need_start ]; then
106
+ services="$(sort -u /var/run/services.need_start) $services"
107
+ fi
108
+ if [ -n "$services" ]; then
109
+ echo "Restarting services possibly affected by the upgrade:"
110
+ failed=""
111
+ for service in $services; do
112
+ case "$service" in
113
+ gdm*)
114
+ idlopt="reload"
115
+ ;;
116
+ *)
117
+ idlopt="restart"
118
+ ;;
119
+ esac
120
+ echo -n " $service: restarting..."
121
+ if invoke-rc.d ${service} $idlopt > /dev/null 2>&1; then
122
+ echo "done."
123
+ else
124
+ echo "FAILED! ($?)"
125
+ failed="$service $failed"
126
+ fi
127
+ done
128
+
129
+ echo
130
+ if [ -n "$failed" ]; then
131
+ if [ -f /usr/share/debconf/confmodule ] ; then
132
+ db_fset glibc/restart-failed seen false
133
+ db_subst glibc/restart-failed services "$failed"
134
+ if [ "$RELEASE_UPGRADE_MODE" = desktop ]; then
135
+ db_input medium glibc/restart-failed || true
136
+ else
137
+ db_input critical glibc/restart-failed || true
138
+ fi
139
+ db_go || true
140
+ else
141
+ echo "The following services failed to start: $failed"
142
+ echo
143
+ echo "You will need to start these manually by running \`invoke-rc.d <service> start'"
144
+ echo "If the service still fails to start, you may need to file a bug on"
145
+ echo "${DPKG_MAINTSCRIPT_PACKAGE}:${DPKG_MAINTSCRIPT_ARCH} or the service involved."
146
+ frontend=`echo "$DEBIAN_FRONTEND" | tr '[:upper:]' '[:lower:]'`
147
+ if [ "$frontend" != noninteractive ]; then
148
+ echo
149
+ echo -n "Press ENTER to continue: "
150
+ read foo
151
+ fi
152
+ fi
153
+ else
154
+ echo "Services restarted successfully."
155
+ rm -f /var/run/services.need_start /var/run/services.need_restart
156
+ fi
157
+
158
+ # Shut down the frontend, to make sure none of the
159
+ # restarted services keep a connection open to it
160
+ if [ -f /usr/share/debconf/confmodule ] ; then
161
+ db_stop
162
+ fi
163
+ else
164
+ echo "Nothing to restart."
165
+ fi
166
+ fi # end upgrading and $preversion lt 2.31
167
+ # give a reboot notification on al upgrades (LP: #1546457)
168
+ if [ -x /usr/share/update-notifier/notify-reboot-required ]; then
169
+ /usr/share/update-notifier/notify-reboot-required
170
+ fi
171
+ fi # Upgrading
172
+
173
+ # Restart init. Currently handles chroots, systemd and upstart, and
174
+ # assumes anything else is going to not fail at behaving like
175
+ # sysvinit:
176
+ TELINIT=yes
177
+ if ischroot 2>/dev/null; then
178
+ # Don't bother trying to re-exec init from a chroot:
179
+ TELINIT=no
180
+ elif [ -d /run/systemd/system ]; then
181
+ # Skip if systemd is the active PID 1, since systemd doesn't
182
+ # need a reexec for a clean shutdown
183
+ TELINIT=no
184
+ elif [ -x "`which initctl`" ]; then
185
+ UPSTART=$(initctl version 2>/dev/null | awk '/upstart/ {print $3}' | tr -d ')')
186
+ if dpkg --compare-versions "$UPSTART" lt-nl 1.6.1; then
187
+ # This is an old upstart that can't re-exec statefully:
188
+ TELINIT=no
189
+ touch /var/run/init.upgraded
190
+ fi
191
+ fi
192
+ if [ "$TELINIT" = "yes" ]; then
193
+ telinit u 2>/dev/null || true ; sleep 1
194
+ fi
195
+ fi
196
+
197
+
198
+
199
+ exit 0