Package: bash
Version: 4.1-3
Severity: wishlist
Tags: patch

See http://bugs.debian.org/316217 for rationale.  Applies on top of
the patch from Bug#602244 (bash.preinst: renames .bash_profile to
.profile in /etc/skel in rare circumstances).

-- 8< --
Subject: bash.preinst: remove dpkg Pre-Depends support assertion from preinst

Reasons (from the base-passwd changelog):

 - the 'dpkg --assert-support-predepends' check isn't guaranteed to be
   effective anyway (it tests the current version of dpkg on the system,
   not the one that's performing the upgrade);
 - dpkg has supported Pre-Depends since 1996;
 - it unnecessarily required dpkg to have been configured when running
   base-passwd.preinst (#316084).

Plus this simplifies bash.preinst further.
---
Thoughts?

 debian/bash.preinst.c |   37 -------------------------------------
 debian/changelog      |    1 +
 2 files changed, 1 insertions(+), 37 deletions(-)

diff --git a/debian/bash.preinst.c b/debian/bash.preinst.c
index 6ba532e..8eec85b 100644
--- a/debian/bash.preinst.c
+++ b/debian/bash.preinst.c
@@ -21,39 +21,6 @@
 #define PATH_MAX 4096
 #endif
 
-int check_predepends(void)
-{
-    pid_t child;
-
-    switch(child = fork()) {
-      case -1:
-        /* fork failed */
-        return EXIT_FAILURE;
-
-      case 0:
-        /* i'm the child */
-        {
-            execl( "/usr/bin/dpkg", "/usr/bin/dpkg",
-                   "--assert-support-predepends", NULL );
-           _exit(127);
-        }
-
-      default:
-        /* i'm the parent */
-        {
-            int status;
-            pid_t pid;
-            pid = wait(&status);
-            if (pid == child) {
-                if (WIFEXITED(status) && WEXITSTATUS(status) == 0) {
-                    return EXIT_SUCCESS;
-                }
-            }
-        }
-    }
-    return EXIT_FAILURE;
-}
-
 char *check_diversion(void)
 {
     pid_t child;
@@ -114,10 +81,6 @@ int main(void) {
     int targetlen;
     char target[PATH_MAX+1], answer[1024], *fn;
 
-    if (check_predepends() != EXIT_SUCCESS) {
-       printf("\nPlease upgrade to a new version of dpkg\n\n");
-       return EXIT_FAILURE;
-    }
     targetlen = readlink("/bin/sh", target, PATH_MAX);
     if (targetlen == -1) {
        // error reading link. Will be overwritten.
diff --git a/debian/changelog b/debian/changelog
index ca71391..1fd7738 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ bash (4.1-3.1) local; urgency=low
       obsolete .bash_profile would already have been removed in
       the upgrade to lenny.
     - Remove dead code for handling /etc/bash_completion.
+    - Remove dpkg --assert-support-predepends check.
 
  -- Jonathan Nieder <jrnie...@gmail.com>  Mon, 01 Nov 2010 17:41:40 -0500
 
-- 
1.7.2.3.557.gab647.dirty




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to