From fb9b0b92c164d8781468616ee97e8b1223f1e580 Mon Sep 17 00:00:00 2001 From: ewt Date: Wed, 17 Jul 1996 20:00:49 +0000 Subject: [PATCH] 1) began adding support for proxy ftp, though it doesn't work yet 2) fixed spacing annoyance in dependency conflict printout CVS patchset: 875 CVS date: 1996/07/17 20:00:49 --- install.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/install.c b/install.c index b436d09..c265691 100644 --- a/install.c +++ b/install.c @@ -201,7 +201,10 @@ int doInstall(char * rootdir, char ** argv, char * location, int installFlags, numFailed++; *filename = NULL; } else if (isSource) { - freeHeader(binaryHeaders[numBinaryPackages]); + /* the header will be NULL if this is a v1 source package */ + if (binaryHeaders[numBinaryPackages]) + freeHeader(binaryHeaders[numBinaryPackages]); + numSourcePackages++; } else { numBinaryPackages++; @@ -426,6 +429,7 @@ static int getFtpURL(char * hostAndFile, char * dest) { char * chptr, * machineName, * fileName; char * userName = NULL; char * password = NULL; + char * proxy; int ftpconn; int fd; int rc; @@ -443,9 +447,9 @@ static int getFtpURL(char * hostAndFile, char * dest) { fileName = chptr; *fileName = '\0'; - chptr = machineName; - while (*chptr && *chptr != '@') chptr++; - if (*chptr) { /* we have a username */ + chptr = fileName; + while (chptr > buf && *chptr != '@') chptr--; + if (chptr > buf) { /* we have a username */ *chptr = '\0'; userName = machineName; machineName = chptr + 1; @@ -466,7 +470,9 @@ static int getFtpURL(char * hostAndFile, char * dest) { userName ? userName : "ftp", password ? password : "(username)"); - ftpconn = ftpOpen(machineName, userName, password); + proxy = getVar(RPMVAR_FTPPROXY); + + ftpconn = ftpOpen(machineName, userName, password, proxy); if (ftpconn < 0) return ftpconn; fd = creat(dest, 0600); @@ -512,8 +518,11 @@ static void printDepProblems(FILE * f, struct rpmDependencyConflict * conflicts, for (i = 0; i < numConflicts; i++) { fprintf(f, "\t%s", conflicts[i].needsName); - printDepFlags(stderr, conflicts[i].needsVersion, - conflicts[i].needsFlags); + if (conflicts[i].needsFlags) { + fprintf(f, " "); + printDepFlags(stderr, conflicts[i].needsVersion, + conflicts[i].needsFlags); + } fprintf(f, " is needed by %s-%s-%s\n", conflicts[i].byName, conflicts[i].byVersion, conflicts[i].byRelease); } -- 2.7.4