The following commit has been merged in the master branch:
commit 20dcd4f212fe9cfe928349de2d5a1ace735e18e9
Author: Guillem Jover <[email protected]>
Date:   Tue Mar 17 02:35:33 2009 +0200

    install-info: Generalize by using macros for paths

diff --git a/utils/install-info.c b/utils/install-info.c
index 6ef8b68..d360bc6 100644
--- a/utils/install-info.c
+++ b/utils/install-info.c
@@ -24,24 +24,27 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#define SELF "/usr/sbin/install-info"
+#define WRAPPED "/usr/bin/install-info"
+
 #define WARN "install-info: warning: "
 #define FAIL "install-info: failure: "
 
 int
 main(int argc, char **argv)
 {
-    if (strcmp(argv[0], "/usr/sbin/install-info") == 0) {
+    if (strcmp(argv[0], SELF) == 0) {
        fprintf(stderr, WARN "don't call programs like install-info with "
                        "an absolute path\n");
-       fprintf(stderr, WARN "/usr/sbin/install-info provided by "
-                       "dpkg is deprecated and will go away soon\n");
+       fprintf(stderr, WARN "%s provided by "
+                       "dpkg is deprecated and will go away soon\n", SELF);
        fprintf(stderr, WARN "its replacement lives in /usr/bin/\n");
     }
 
-    if (access("/usr/bin/install-info", X_OK) == 0) {
-       execv("/usr/bin/install-info", argv);
-       fprintf(stderr, FAIL "can't execute /usr/bin/install-info: %s\n",
-               strerror(errno));
+    if (access(WRAPPED, X_OK) == 0) {
+       execv(WRAPPED, argv);
+       fprintf(stderr, FAIL "can't execute %s: %s\n",
+               WRAPPED, strerror(errno));
        return 1; /* exec failed */
     } else {
        if (errno == ENOENT) {
@@ -52,12 +55,12 @@ main(int argc, char **argv)
                                "package takes care of the job\n");
                fprintf(stderr, WARN "this package should be updated\n");
            } else {
-               fprintf(stderr, WARN "nothing done since /usr/bin/install-info "
-                               "doesn't exist\n");
+               fprintf(stderr, WARN "nothing done since %s doesn't exist\n",
+                       WRAPPED);
            }
        } else {
-           fprintf(stderr, FAIL "can't execute /usr/bin/install-info: %s\n",
-                   strerror(errno));
+           fprintf(stderr, FAIL "can't execute %s: %s\n",
+                   WRAPPED, strerror(errno));
            return 1;
        }
     }

-- 
dpkg's main repository


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

Reply via email to