r2081 - in glibc-package/trunk/debian: . debhelper.in rules.d script.in
Author: aurel32
Date: 2007-04-17 00:11:51 +0000 (Tue, 17 Apr 2007)
New Revision: 2081
Added:
glibc-package/trunk/debian/script.in/nohwcap.sh
Removed:
glibc-package/trunk/debian/debhelper.in/libc-otherbuild.preinst
Modified:
glibc-package/trunk/debian/changelog
glibc-package/trunk/debian/debhelper.in/libc-otherbuild.postinst
glibc-package/trunk/debian/debhelper.in/libc-otherbuild.postrm
glibc-package/trunk/debian/debhelper.in/libc.postinst
glibc-package/trunk/debian/debhelper.in/libc.preinst
glibc-package/trunk/debian/rules.d/debhelper.mk
Log:
* Rewrite from scratch /etc/ld.so.nohwcap handling. Closes: #419036
- script.in/nohwcap.sh: new snipplet to check dpkg and handle
/etc/ld.so.nohwcap
- rules.d/debhelper.mk: replace NOHWCAP with nohwcap.sh in debhelper
scripts
- debhelper.in/libc.preinst: only touch /etc/ld.so.nohwcap
- debhelper.in/libc.postinst: replace the old code with NOHWCAP,
add code to remove /etc/ld.so.hwcappkgs file on upgrade
- debhelper.in/libc-otherbuild.postrm: replace the old code with NOHWCAP
- debhelper.in/libc-otherbuild.postinst: ditto
- debhelper.in/libc-otherbuild.preinst: remove
Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog 2007-04-16 20:51:32 UTC (rev 2080)
+++ glibc-package/trunk/debian/changelog 2007-04-17 00:11:51 UTC (rev 2081)
@@ -15,8 +15,19 @@
no measurable difference on the unpacking time.
* patches/any/submitted-gethostbyname_r.diff: new patch to fix unaligned
memory access in gethostbyname_r.diff(). Closes: #419459.
+ * Rewrite from scratch /etc/ld.so.nohwcap handling. Closes: #419036
+ - script.in/nohwcap.sh: new snipplet to check dpkg and handle
+ /etc/ld.so.nohwcap
+ - rules.d/debhelper.mk: replace NOHWCAP with nohwcap.sh in debhelper
+ scripts
+ - debhelper.in/libc.preinst: only touch /etc/ld.so.nohwcap
+ - debhelper.in/libc.postinst: replace the old code with NOHWCAP,
+ add code to remove /etc/ld.so.hwcappkgs file on upgrade
+ - debhelper.in/libc-otherbuild.postrm: replace the old code with NOHWCAP
+ - debhelper.in/libc-otherbuild.postinst: ditto
+ - debhelper.in/libc-otherbuild.preinst: remove
- -- Aurelien Jarno <aurel32@debian.org> Mon, 16 Apr 2007 22:35:26 +0200
+ -- Aurelien Jarno <aurel32@debian.org> Tue, 17 Apr 2007 01:57:59 +0200
glibc (2.5-2) unstable; urgency=low
Modified: glibc-package/trunk/debian/debhelper.in/libc-otherbuild.postinst
===================================================================
--- glibc-package/trunk/debian/debhelper.in/libc-otherbuild.postinst 2007-04-16 20:51:32 UTC (rev 2080)
+++ glibc-package/trunk/debian/debhelper.in/libc-otherbuild.postinst 2007-04-17 00:11:51 UTC (rev 2081)
@@ -2,59 +2,9 @@
set -e
-checkpkgver () {
- local status pkg
- pkg=$1
- status=$(dpkg -s $pkg 2>/dev/null | grep ^Status: | sed -e 's/^Status: \(.*\) \(.*\) \(.*\)/\3/g')
- if [ -n "$status" ] && [ "$status" != "not-installed" ] && [ "$status" != "config-files" ]; then
- echo $(dpkg -s $pkg 2>/dev/null | grep ^Version: | sed -e 's/^Version: *//');
- fi
-}
-
if [ "$1" = "configure" ]
then
- opt=LIBC-FLAVOR
- curver=CURRENT_VER
-
- if [ -f /etc/ld.so.hwcappkgs ]; then
- rm -f /etc/ld.so.hwcappkgs.tmp
- (while read LINE; do
- case $LINE in
- \#*|"") continue
- esac
- set -- $LINE
- pkg=$1
- if [ "$pkg" = "$opt" ]; then
- # this package
- ver=$curver
- isrecorded=yes
- else
- # other packages
- ver=$(checkpkgver $pkg)
- if [ -n "$ver" ]; then
- dpkg --compare-versions $curver ne $ver && optunmatch=yes
- fi
- fi
- echo "$pkg $ver" >> /etc/ld.so.hwcappkgs.tmp
- done
- if [ "$isrecorded" != yes ]; then
- echo "$opt $curver" >> /etc/ld.so.hwcappkgs.tmp
- fi) < /etc/ld.so.hwcappkgs
- mv /etc/ld.so.hwcappkgs.tmp /etc/ld.so.hwcappkgs
- else
- # libc6 did not create ld.so.hwcappkgs correctly or ld.so.hwcappkgs
- # was unexpectedly removed. Don't remove ld.so.nohwcap.
- optunmatch=yes
- fi
-
- # nohwcap during upgrade.
- if [ -f /etc/ld.so.nohwcap ]; then
- grep -v "^$opt\$" /etc/ld.so.nohwcap > /etc/ld.so.nohwcap.tmp || true
- mv -f /etc/ld.so.nohwcap.tmp /etc/ld.so.nohwcap
- if [ "$optunmatch" != "yes" ]; then
- test -s /etc/ld.so.nohwcap || rm -f /etc/ld.so.nohwcap
- fi
- fi
+ # /etc/ld.so.nohwcap code: NOHWCAP
fi
#DEBHELPER#
Modified: glibc-package/trunk/debian/debhelper.in/libc-otherbuild.postrm
===================================================================
--- glibc-package/trunk/debian/debhelper.in/libc-otherbuild.postrm 2007-04-16 20:51:32 UTC (rev 2080)
+++ glibc-package/trunk/debian/debhelper.in/libc-otherbuild.postrm 2007-04-17 00:11:51 UTC (rev 2081)
@@ -2,50 +2,8 @@
set -e
-checkpkgver () {
- local status pkg
- pkg=$1
- status=$(dpkg -s $pkg 2>/dev/null | grep ^Status: | sed -e 's/^Status: \(.*\) \(.*\) \(.*\)/\3/g')
- if [ -n "$status" ] && [ "$status" != "not-installed" ] && [ "$status" != "config-files" ]; then
- echo $(dpkg -s $pkg 2>/dev/null | grep ^Version: | sed -e 's/^Version: *//');
- fi
-}
-
if [ "$1" = "remove" ]; then
- opt=LIBC-FLAVOR
- curver=CURRENT_VER
-
- if [ -f /etc/ld.so.hwcappkgs ]; then
- # Remove this package's entry
- grep -v "^$opt " /etc/ld.so.hwcappkgs > /etc/ld.so.hwcappkgs.tmp
- mv /etc/ld.so.hwcappkgs.tmp /etc/ld.so.hwcappkgs
-
- # Check other hwcap packges are consistent.
- while read LINE; do
- case $LINE in
- \#*|"") continue
- esac
- set -- $LINE
- pkg=$1
- if [ -z "$prever" ]; then
- prever=$(checkpkgver $pkg)
- else
- ver=$(checkpkgver $pkg)
- if [ -n "$ver" ]; then
- dpkg --compare-versions $prever ne $ver && optunmatch=yes
- fi
- fi
- done < /etc/ld.so.hwcappkgs
- else
- # libc6 did not create ld.so.hwcappkgs correctly or ld.so.hwcappkgs
- # was unexpectedly removed. Don't remove ld.so.nohwcap.
- optunmatch=yes
- fi
-
- # Remove ld.so.nohwcap
- if [ -f /etc/ld.so.nohwcap ] && [ ! -s /etc/ld.so.nohwcap ] && [ "$optunmatch" != yes ]; then
- rm -f /etc/ld.so.nohwcap
- fi
+ # /etc/ld.so.nohwcap code: NOHWCAP
fi
#DEBHELPER#
Deleted: glibc-package/trunk/debian/debhelper.in/libc-otherbuild.preinst
===================================================================
--- glibc-package/trunk/debian/debhelper.in/libc-otherbuild.preinst 2007-04-16 20:51:32 UTC (rev 2080)
+++ glibc-package/trunk/debian/debhelper.in/libc-otherbuild.preinst 2007-04-17 00:11:51 UTC (rev 2081)
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ "$1" != abort-upgrade ]; then
- opt=LIBC-FLAVOR
- touch /etc/ld.so.nohwcap
- echo $opt >> /etc/ld.so.nohwcap
-fi
-
-#DEBHELPER#
-
-exit 0
Modified: glibc-package/trunk/debian/debhelper.in/libc.postinst
===================================================================
--- glibc-package/trunk/debian/debhelper.in/libc.postinst 2007-04-16 20:51:32 UTC (rev 2080)
+++ glibc-package/trunk/debian/debhelper.in/libc.postinst 2007-04-17 00:11:51 UTC (rev 2081)
@@ -143,79 +143,11 @@
fi
fi
- # Handle upgrades when libc-opt package has been installed.
- # We check the version between the current installed libc and libc-opt.
- # If they're unmatched, we keep /etc/ld.so.nohwcap file until libc-opt
- # package is installed or removed.
- if [ -f /etc/ld.so.nohwcap ]; then
- # We check the availability of ld.so.hwcappkgs. If it's not existed,
- # it's first time to install ld.so.hwcappkgs aware packages. We record
- # all current hwcap package status.
- if [ ! -f /etc/ld.so.hwcappkgs ]; then
- case $(dpkg --print-architecture) in
- i386)
- hwcappkgs="libc6 libc6-i686 libc6-xen"
- ;;
- kfreebsd-i386)
- hwcappkgs="libc0.1 libc0.1-i686"
- ;;
- sparc)
- hwcappkgs="libc6 libc6-sparcv9 libc6-sparcv9b"
- ;;
- esac
- if [ -n "$hwcappkgs" ]; then
- for pkg in $hwcappkgs; do
- ver=$(checkpkgver $pkg)
- if [ -n "$ver" ]; then
- echo "$pkg $ver" >> /etc/ld.so.hwcappkgs
- new_hwcappkgs=yes
- fi
- done
- fi
- fi
+ # We don't use a registry anymore, remove the old file
+ rm -f /etc/ld.so.hwcappkgs
+
+ # /etc/ld.so.nohwcap code: NOHWCAP
- # If ld.so.hwcappkgs is existed, it may have one or more opt packages.
- # Update the current package's version, and compare the consistency of
- # those optimized packages. If inconsistency is found, keep
- # /etc/ld.so.nohwcap.
- if [ -f /etc/ld.so.hwcappkgs ]; then
- curver=CURRENT_VER
- rm -f /etc/ld.so.hwcappkgs.tmp
- while read LINE; do
- case $LINE in
- \#*|"") continue
- esac
- set -- $LINE
- pkg=$1; ver=$2
- if [ "$pkg" = "$package" ]; then
- # libc6
- ver=$curver
- isrecorded=yes
- else
- if [ "$new_hwcappkgs" != yes ]; then
- ver=$(checkpkgver $pkg)
- fi
- if [ -z "$ver" ]; then
- continue
- fi
- dpkg --compare-versions $curver ne $ver && optunmatch=yes
- fi
- echo "$pkg $ver" >> /etc/ld.so.hwcappkgs.tmp
- done < /etc/ld.so.hwcappkgs
- if [ "$isrecorded" != yes ]; then
- echo "$package $curver" >> /etc/ld.so.hwcappkgs.tmp
- fi
- mv /etc/ld.so.hwcappkgs.tmp /etc/ld.so.hwcappkgs
- fi
-
- # nohwcap during upgrade.
- egrep -v '^glibc$|^downgrade-to-old-glibc$' /etc/ld.so.nohwcap > /etc/ld.so.nohwcap.tmp || true
- mv /etc/ld.so.nohwcap.tmp /etc/ld.so.nohwcap
- if [ "$optunmatch" != "yes" ]; then
- test -s /etc/ld.so.nohwcap || rm -f /etc/ld.so.nohwcap
- fi
- fi
-
if [ ! -z $preversion ]; then
if [ ! -d /var/mail ] && [ ! -L /var/mail ]; then
ln -sf spool/mail /var/mail
Modified: glibc-package/trunk/debian/debhelper.in/libc.preinst
===================================================================
--- glibc-package/trunk/debian/debhelper.in/libc.preinst 2007-04-16 20:51:32 UTC (rev 2080)
+++ glibc-package/trunk/debian/debhelper.in/libc.preinst 2007-04-17 00:11:51 UTC (rev 2081)
@@ -100,7 +100,6 @@
# This will keep us from using hwcap libs (optimized) during an
# upgrade.
touch /etc/ld.so.nohwcap
- echo glibc >> /etc/ld.so.nohwcap
fi
# Sanity check.
Modified: glibc-package/trunk/debian/rules.d/debhelper.mk
===================================================================
--- glibc-package/trunk/debian/rules.d/debhelper.mk 2007-04-16 20:51:32 UTC (rev 2080)
+++ glibc-package/trunk/debian/rules.d/debhelper.mk 2007-04-17 00:11:51 UTC (rev 2081)
@@ -176,9 +176,10 @@
z=`echo $$y | sed -e 's#/libc#/$(libc)#'`; \
cp $$x $$z; \
sed -e "s#DEB_SRCDIR#$(DEB_SRCDIR)#" -i $$z; \
+ sed -e "/KERNEL_VERSION_CHECK/r debian/script.in/kernelcheck.sh" -i $$z; \
+ sed -e "/NOHWCAP/r debian/script.in/nohwcap.sh" -i $$z; \
sed -e "s#LIBC#$(libc)#" -i $$z; \
sed -e "s#CURRENT_VER#$(DEB_VERSION)#" -i $$z; \
- sed -e "/KERNEL_VERSION_CHECK/r debian/script.in/kernelcheck.sh" -i $$z; \
sed -e "s#EXIT_CHECK##" -i $$z; \
sed -e "s#DEB_HOST_ARCH#$(DEB_HOST_ARCH)#" -i $$z; \
case $$z in \
Added: glibc-package/trunk/debian/script.in/nohwcap.sh
===================================================================
--- glibc-package/trunk/debian/script.in/nohwcap.sh 2007-04-16 20:51:32 UTC (rev 2080)
+++ glibc-package/trunk/debian/script.in/nohwcap.sh 2007-04-17 00:11:51 UTC (rev 2081)
@@ -0,0 +1,30 @@
+ # Handle upgrades when libc-opt package has been installed.
+
+ # Get the list of optimized package for a given architecture
+ case $(dpkg --print-architecture) in
+ i386)
+ hwcappkgs="libc6-i686 libc6-xen"
+ ;;
+ kfreebsd-i386)
+ hwcappkgs="libc0.1-i686"
+ ;;
+ sparc)
+ hwcappkgs="libc6-sparcv9 libc6-sparcv9b"
+ ;;
+ esac
+
+ # We check the version between the current installed libc and
+ # all optimized packages. If they're unmatched, we keep /etc/ld.so.nohwcap
+ # file until all optimized packages are installed or removed.
+ all_upgraded=yes
+ if [ -n "$hwcappkgs" ]; then
+ for pkg in $hwcappkgs ; do
+ ver=$(dpkg -l $pkg | awk '/^i/ { print $3 }')
+ if [ -n "$ver" ] && [ "$ver" != "CURRENT_VER" ]; then
+ all_upgraded=no
+ fi
+ done
+ fi
+ if [ "$all_upgraded" = yes ] ; then
+ rm -f /etc/ld.so.nohwcap
+ fi
Reply to: