Look for gzip in path and store binary to use in /usr/lib/rpmrc
authorewt <devnull@localhost>
Thu, 1 May 1997 19:08:15 +0000 (19:08 +0000)
committerewt <devnull@localhost>
Thu, 1 May 1997 19:08:15 +0000 (19:08 +0000)
CVS patchset: 1583
CVS date: 1997/05/01 19:08:15

CHANGES
build/build.c
build/pack.c
lib-rpmrc.in
lib/rpmlib.h

diff --git a/CHANGES b/CHANGES
index 3843127..4d1501d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -23,6 +23,8 @@
        - requirements which begin with a leading / require files (in
          the database!) instead of packages
        - clean up conflictsindex during --rebuilddb
+       - get path to gzip from /usr/lib/rpmrc rather then just hoping it's 
+         in the path
 
 2.3.10 -> 2.3.11:
        - fixed newlines in --scripts output
index b0f0388..06701c1 100644 (file)
@@ -400,11 +400,11 @@ static char *do_untar(Spec spec, int c, int quietly)
     
     if (isCompressed(file)) {
        sprintf(buf,
-               "gzip -dc %s | tar %s -\n"
+               "%s -dc %s | tar %s -\n"
                "if [ $? -ne 0 ]; then\n"
                "  exit $?\n"
                "fi",
-               file, taropts);
+               rpmGetVar(RPMVAR_GZIPBIN), file, taropts);
     } else {
        sprintf(buf, "tar %s %s", taropts, file);
     }
@@ -452,11 +452,11 @@ static char *do_patch(Spec spec, int c, int strip, char *db,
     if (isCompressed(file)) {
        sprintf(buf,
                "echo \"Patch #%d:\"\n"
-               "gzip -dc %s | patch -p%d %s -s\n"
+               "%s -dc %s | patch -p%d %s -s\n"
                "if [ $? -ne 0 ]; then\n"
                "  exit $?\n"
                "fi",
-               c, file, strip, args);
+               rpmGetVar(RPMVAR_GZIPBIN), c, file, strip, args);
     } else {
        sprintf(buf,
                "echo \"Patch #%d:\"\n"
index 284f5ac..8c371c0 100644 (file)
@@ -175,6 +175,7 @@ static int cpio_gzip(int fd, char *tempdir, char *writePtr,
     int fromCpio[2];
     int toGzip[2];
     char * cpiobin;
+    char * gzipbin;
 
     int writeBytesLeft, bytesWritten;
 
@@ -188,7 +189,7 @@ static int cpio_gzip(int fd, char *tempdir, char *writePtr,
     void *oldhandler;
 
     cpiobin = rpmGetVar(RPMVAR_CPIOBIN);
-    if (!cpiobin) cpiobin = "cpio";
+    gzipbin = rpmGetVar(RPMVAR_CPIOBIN);
  
     *archiveSize = 0;
     
@@ -254,7 +255,7 @@ static int cpio_gzip(int fd, char *tempdir, char *writePtr,
        dup2(toGzip[0], 0);  /* Make stdin the in pipe       */
        dup2(fd, 1);         /* Make stdout the passed-in fd */
 
-       execlp("gzip", "gzip", "-c9fn", NULL);
+       execlp(gzipbin, gzipbin, "-c9fn", NULL);
        rpmError(RPMERR_EXEC, "Couldn't exec gzip");
        _exit(RPMERR_EXEC);
     }
index 8db04b5..0746cd6 100644 (file)
@@ -5,6 +5,7 @@ dbpath:         @varprefix@/lib/rpm
 topdir:                @prefix@/src/redhat
 tmppath:       @tmpdir@
 cpiobin:       @CPIOBIN@
+gzip:          @GZIPBIN@
 defaultdocdir:  @prefix@/doc
 fixperms:      @FIXPERMS@
 
index 03492d4..9b285bd 100644 (file)
@@ -186,7 +186,8 @@ extern const int rpmTagTableSize;
 #define RPMVAR_NETSHAREDPATH           33
 #define RPMVAR_DEFAULTDOCDIR           34
 #define RPMVAR_FIXPERMS                        35
-#define RPMVAR_LASTVAR                 36 /* IMPORTANT to keep right! */
+#define RPMVAR_GZIPBIN                 36
+#define RPMVAR_LASTVAR                 37 /* IMPORTANT to keep right! */
 
 char *rpmGetVar(int var);
 int rpmGetBooleanVar(int var);