Look for gzip in path and store binary to use in /usr/lib/rpmrc

CVS patchset: 1583
CVS date: 1997/05/01 19:08:15
This commit is contained in:
ewt 1997-05-01 19:08:15 +00:00
parent b86bcefc78
commit a4beb010aa
5 changed files with 12 additions and 7 deletions

View File

@ -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

View 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"

View 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);
}

View File

@ -5,6 +5,7 @@ dbpath: @varprefix@/lib/rpm
topdir: @prefix@/src/redhat
tmppath: @tmpdir@
cpiobin: @CPIOBIN@
gzip: @GZIPBIN@
defaultdocdir: @prefix@/doc
fixperms: @FIXPERMS@

View 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);