diff --git a/CHANGES b/CHANGES index 3843127e3..4d1501da9 100644 --- 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 diff --git a/build/build.c b/build/build.c index b0f03881d..06701c1c6 100644 --- a/build/build.c +++ b/build/build.c @@ -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" diff --git a/build/pack.c b/build/pack.c index 284f5acbc..8c371c0b1 100644 --- a/build/pack.c +++ b/build/pack.c @@ -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); } diff --git a/lib-rpmrc.in b/lib-rpmrc.in index 8db04b520..0746cd608 100644 --- a/lib-rpmrc.in +++ b/lib-rpmrc.in @@ -5,6 +5,7 @@ dbpath: @varprefix@/lib/rpm topdir: @prefix@/src/redhat tmppath: @tmpdir@ cpiobin: @CPIOBIN@ +gzip: @GZIPBIN@ defaultdocdir: @prefix@/doc fixperms: @FIXPERMS@ diff --git a/lib/rpmlib.h b/lib/rpmlib.h index 03492d4b9..9b285bdcc 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -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);