Author: gotom
Date: 2005-04-02 05:39:04 +0000 (Sat, 02 Apr 2005)
New Revision: 869

Modified:
   glibc-package/branches/glibc-2.3.4/debian/changelog
   
glibc-package/branches/glibc-2.3.4/debian/debhelper.in/libc-otherbuild.postinst
   glibc-package/branches/glibc-2.3.4/debian/debhelper.in/libc-otherbuild.postrm
   glibc-package/branches/glibc-2.3.4/debian/debhelper.in/libc.postinst
   glibc-package/branches/glibc-2.3.4/debian/rules.d/debhelper.mk
Log:
glibc (2.3.4-3) experimental; urgency=low

  * GOTO Masanori <[EMAIL PROTECTED]>

    * The complete libc6 installation breakage is fixed when hwcap packages
      (libc6-i686 and libc6-sparcv9/sparcv9b) is installed.  It introduced
      /etc/ld.so.hwcappkgs to track hwcap packages.
      - debian/debhelper.in/libc.postinst: Create /etc/ld.so.hwcappkgs if
        such file is not existed.  Check hwcap packages and decide to keep
        /etc/ld.so.nohwcap.
      - debian/debhelper.in/libc-otherbuild.postinst: When it's configured,
        check /etc/ld.so.hwcappkgs and decides to keep /etc/ld.so.nohwcap.
      - debian/debhelper.in/libc-otherbuild.postrm: When it's removed,
        check /etc/ld.so.hwcappkgs and search other hwcap package's version
        consistency.  Then it decides to remove /etc/ld.so.nohwcap.
      - debian/rules.d/debhelper.mk: Include "libc-" into OPT string
        replacement.



Modified: glibc-package/branches/glibc-2.3.4/debian/changelog
===================================================================
--- glibc-package/branches/glibc-2.3.4/debian/changelog 2005-03-29 08:36:07 UTC 
(rev 868)
+++ glibc-package/branches/glibc-2.3.4/debian/changelog 2005-04-02 05:39:04 UTC 
(rev 869)
@@ -1,3 +1,23 @@
+glibc (2.3.4-3) experimental; urgency=low
+
+  * GOTO Masanori <[EMAIL PROTECTED]>
+
+    * The complete libc6 installation breakage is fixed when hwcap packages
+      (libc6-i686 and libc6-sparcv9/sparcv9b) is installed.  It introduced
+      /etc/ld.so.hwcappkgs to track hwcap packages.
+      - debian/debhelper.in/libc.postinst: Create /etc/ld.so.hwcappkgs if
+        such file is not existed.  Check hwcap packages and decide to keep
+        /etc/ld.so.nohwcap.
+      - debian/debhelper.in/libc-otherbuild.postinst: When it's configured,
+        check /etc/ld.so.hwcappkgs and decides to keep /etc/ld.so.nohwcap.
+      - debian/debhelper.in/libc-otherbuild.postrm: When it's removed,
+        check /etc/ld.so.hwcappkgs and search other hwcap package's version
+        consistency.  Then it decides to remove /etc/ld.so.nohwcap.
+      - debian/rules.d/debhelper.mk: Include "libc-" into OPT string
+        replacement.
+
+ -- GOTO Masanori <[EMAIL PROTECTED]>  Tue, 29 Mar 2005 17:22:25 +0900
+
 glibc (2.3.4-2) experimental; urgency=low
 
   * GOTO Masanori <[EMAIL PROTECTED]>

Modified: 
glibc-package/branches/glibc-2.3.4/debian/debhelper.in/libc-otherbuild.postinst
===================================================================
--- 
glibc-package/branches/glibc-2.3.4/debian/debhelper.in/libc-otherbuild.postinst 
    2005-03-29 08:36:07 UTC (rev 868)
+++ 
glibc-package/branches/glibc-2.3.4/debian/debhelper.in/libc-otherbuild.postinst 
    2005-04-02 05:39:04 UTC (rev 869)
@@ -2,14 +2,59 @@
 
 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=OPT
-  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
-    test -s /etc/ld.so.nohwcap || rm -f /etc/ld.so.nohwcap
-  fi
+    opt=OPT
+    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 < /etc/ld.so.hwcappkgs
+       if [ "$isrecorded" != yes ]; then
+           echo "$opt $curver" >> /etc/ld.so.hwcappkgs.tmp
+       fi
+       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
 fi
 
 #DEBHELPER#

Modified: 
glibc-package/branches/glibc-2.3.4/debian/debhelper.in/libc-otherbuild.postrm
===================================================================
--- 
glibc-package/branches/glibc-2.3.4/debian/debhelper.in/libc-otherbuild.postrm   
    2005-03-29 08:36:07 UTC (rev 868)
+++ 
glibc-package/branches/glibc-2.3.4/debian/debhelper.in/libc-otherbuild.postrm   
    2005-04-02 05:39:04 UTC (rev 869)
@@ -2,8 +2,48 @@
 
 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
-    if [ -f /etc/ld.so.nohwcap ] && [ ! -s /etc/ld.so.nohwcap ]; then
+    opt=OPT
+    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
 fi

Modified: glibc-package/branches/glibc-2.3.4/debian/debhelper.in/libc.postinst
===================================================================
--- glibc-package/branches/glibc-2.3.4/debian/debhelper.in/libc.postinst        
2005-03-29 08:36:07 UTC (rev 868)
+++ glibc-package/branches/glibc-2.3.4/debian/debhelper.in/libc.postinst        
2005-04-02 05:39:04 UTC (rev 869)
@@ -145,6 +145,15 @@
     echo ""
 }
 
+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
+}
+
 # We remove a relic of the past /usr/doc/<package> symlinks.
 # This script should keep at least until sarge release.
 package=LIBC
@@ -180,26 +189,61 @@
     # 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
-       curver=CURRENT_VER
-       case "`uname -m`" in
-           i?86)
-               optpkgs=libc6-i686
-               ;;
-           sparc*)
-               optpkgs="libc6-sparcv9 libc6-sparcv9b"
-               ;;
-       esac
-       if [ -n "$optpkgs" ]; then
-           for optpkg in $optpkgs; do
-               status=$(dpkg -s $optpkg 2>/dev/null | grep ^Status: | sed -e 
's/^Status: \(.*\) \(.*\) \(.*\)/\3/g')
-               if [ -n "$status" ] && \
-                  [ "$status" != "not-installed" ] && [ "$status" != 
"config-files" ]; then
-                   optver=$(dpkg -s $optpkg 2>/dev/null | grep ^Version: | sed 
-e 's/^Version: *//');
-                   dpkg --compare-versions $curver ne $optver && optunmatch=yes
+       # 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 "`uname -m`" in
+               i?86)
+                   pkgs="libc6 libc6-i686"
+                   ;;
+               sparc*)
+                   pkgs="libc6 libc6-sparcv9 libc6-sparcv9b"
+                   ;;
+           esac
+           if [ -n "$pkgs" ]; then
+               for pkg in $pkgs; do
+                   ver=$(checkpkgver $pkg)
+                   if [ -n "$ver" ]; then
+                       echo "$pkg $ver" >> /etc/ld.so.hwcappkgs
+                       new_hwcappkgs=yes
+                   fi
+               done
+           fi
+       fi
+
+       # 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
+                   dpkg --compare-versions $curver ne $ver && optunmatch=yes
                fi
-           done
-        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.
        grep -v '^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

Modified: glibc-package/branches/glibc-2.3.4/debian/rules.d/debhelper.mk
===================================================================
--- glibc-package/branches/glibc-2.3.4/debian/rules.d/debhelper.mk      
2005-03-29 08:36:07 UTC (rev 868)
+++ glibc-package/branches/glibc-2.3.4/debian/rules.d/debhelper.mk      
2005-04-02 05:39:04 UTC (rev 869)
@@ -192,8 +192,11 @@
            cp debian/debhelper.in/libc-otherbuild.preinst 
debian/$(libc)-$$x.preinst ; \
            cp debian/debhelper.in/libc-otherbuild.postinst 
debian/$(libc)-$$x.postinst ; \
            cp debian/debhelper.in/libc-otherbuild.postrm 
debian/$(libc)-$$x.postrm ; \
-           sed -e "s#OPT#$$x#" -i debian/$(libc)-$$x.preinst; \
-           sed -e "s#OPT#$$x#" -i debian/$(libc)-$$x.postinst; \
+           sed -e "s#OPT#$(libc)-$$x#" -i debian/$(libc)-$$x.preinst; \
+           sed -e "s#OPT#$(libc)-$$x#" -i debian/$(libc)-$$x.postinst; \
+           sed -e "s#OPT#$(libc)-$$x#" -i debian/$(libc)-$$x.postrm; \
+           sed -e "s#CURRENT_VER#$(DEB_VERSION)#" -i 
debian/$(libc)-$$x.postinst; \
+           sed -e "s#CURRENT_VER#$(DEB_VERSION)#" -i 
debian/$(libc)-$$x.postrm; \
          fi; \
          sed -e "s#TMPDIR#debian/tmp-$$x#" -i $$z; \
          sed -e "s#DEB_SRCDIR#$(DEB_SRCDIR)#" -i $$z; \


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to