[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[glibc] 02/02: debian/debhelper.in/libc-bin.postinst: update /etc/nsswitch.conf to the current default if it matches a version shipped by bases-file or libc-bin. This is based on a patch from Santiago Vila, thanks. Closes: #827105.



This is an automated email from the git hooks/post-receive script.

aurel32 pushed a commit to branch sid
in repository glibc.

commit 6c1caf02331711a443ade95b5a7cba6486945c00
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Sun Jun 19 23:45:51 2016 +0200

    debian/debhelper.in/libc-bin.postinst: update /etc/nsswitch.conf to the current default if it matches a version shipped by bases-file or libc-bin. This is based on a patch from Santiago Vila, thanks.  Closes: #827105.
---
 debian/changelog                      |  4 ++++
 debian/debhelper.in/libc-bin.postinst | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 9d1690b..10c37d0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,10 @@ glibc (2.22-12) UNRELEASED; urgency=medium
     the build log.
   * debian/local/etc/nsswitch.conf: add gshadow line to default
     /etc/nsswitch.conf (addresses #699090).
+  * debian/debhelper.in/libc-bin.postinst: update /etc/nsswitch.conf to the
+    current default if it matches a version shipped by bases-file or
+    libc-bin. This is based on a patch from Santiago Vila, thanks.  Closes:
+    #827105.
 
   [ Samuel Thibault ]
   * hurd-i386/tg-eintr.diff: New patch to fix "Interrupted" issues in ghc.
diff --git a/debian/debhelper.in/libc-bin.postinst b/debian/debhelper.in/libc-bin.postinst
index 50f3e79..e6b7a40 100644
--- a/debian/debhelper.in/libc-bin.postinst
+++ b/debian/debhelper.in/libc-bin.postinst
@@ -8,10 +8,43 @@ install_from_default() {
   fi
 }
 
+update_to_current_default() {
+  if [ -f $2 ]; then
+    md5=`md5sum $2 | cut -f 1 -d " "`
+    case "$md5" in
+      # base-files 3.0.0 to 3.1.15
+      109e33e2c91d1853b5bc56078a96aa18)
+        ;;
+      # base-files 3.1.8 and 3.1.9
+      3114ea9cf2f3bd8d120b4da96e3832d5)
+        ;;
+      # base-files 3.1.16 to 7.2 and libc-bin 2.19-18 to 2.22-11
+      295c15c4bdac80e50b37689ef08f359c)
+        ;;
+      # base-files 6.6
+      30b82cb1ce20d480703da2208a4607b4)
+        ;;
+      # base-files 7.3 and libc-bin 2.22-12
+      f8e97bf611374634c7cb3a6085503ab5)
+        ;;
+      # modified file
+      *)
+        return
+        ;;
+    esac
+    echo "Updating $2 to current default."
+    cp -p $1 $2
+  fi
+}
+
 if [ "$1" = "configure" ] && [ "$2" = "" ] ; then
   install_from_default /usr/share/libc-bin/nsswitch.conf /etc/nsswitch.conf
 fi
 
+if [ "$1" = "configure" ] && [ "$2" != "" ]; then
+  update_to_current_default /usr/share/libc-bin/nsswitch.conf /etc/nsswitch.conf
+fi
+
 if [ "$1" = "triggered" ] || [ "$1" = "configure" ]; then
   ldconfig || ldconfig --verbose
   exit 0

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-glibc/glibc.git


Reply to: