From 76f9720b8937679467aceacac4c0a5823a302543 Mon Sep 17 00:00:00 2001 From: ewt Date: Sun, 20 Oct 1996 18:24:42 +0000 Subject: [PATCH] added --ftpproxy, --ftpport CVS patchset: 1107 CVS date: 1996/10/20 18:24:42 --- rpm.c | 53 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/rpm.c b/rpm.c index 383519a..8853d45 100755 --- a/rpm.c +++ b/rpm.c @@ -31,6 +31,8 @@ #define GETOPT_PREFIX 1011 #define GETOPT_TIMECHECK 1012 #define GETOPT_REBUILDDB 1013 +#define GETOPT_FTPPORT 1014 +#define GETOPT_FTPPROXY 1015 char * version = VERSION; @@ -70,26 +72,29 @@ void printUsage(void) { puts(_("usage: rpm {--help}")); puts(_(" rpm {--version}")); - puts(_(" rpm {--initdb} [--dbpath ]")); + puts(_(" rpm {--initdb} [--dbpath ]")); puts(_(" rpm {--install -i} [-v] [--hash -h] [--percent] [--force] [--test]")); - puts(_(" [--replacepkgs] [--replacefiles] [--root ]")); - puts(_(" [--excludedocs] [--includedocs] [--noscripts]")); - puts(_(" [--rcfile ] [--ignorearch] [--dbpath ]")); - puts(_(" [--prefix ] [--ignoreos] [--nodeps]")); - puts(_(" file1.rpm ... fileN.rpm")); + puts(_(" [--replacepkgs] [--replacefiles] [--root ]")); + puts(_(" [--excludedocs] [--includedocs] [--noscripts]")); + puts(_(" [--rcfile ] [--ignorearch] [--dbpath ]")); + puts(_(" [--prefix ] [--ignoreos] [--nodeps]")); + puts(_(" [--ftpproxy ] [--ftpport ]")); + puts(_(" file1.rpm ... fileN.rpm")); puts(_(" rpm {--upgrade -U} [-v] [--hash -h] [--percent] [--force] [--test]")); - puts(_(" [--oldpackage] [--root ] [--noscripts]")); - puts(_(" [--excludedocs] [--includedocs] [--rcfile ]")); - puts(_(" [--ignorearch] [--dbpath ] [--prefix ] ")); - puts(_(" [--ignoreos] [--nodeps] file1.rpm ... fileN.rpm")); + puts(_(" [--oldpackage] [--root ] [--noscripts]")); + puts(_(" [--excludedocs] [--includedocs] [--rcfile ]")); + puts(_(" [--ignorearch] [--dbpath ] [--prefix ] ")); + puts(_(" [--ftpproxy ] [--ftpport ]")); + puts(_(" [--ignoreos] [--nodeps] file1.rpm ... fileN.rpm")); puts(_(" rpm {--query -q} [-afFpP] [-i] [-l] [-s] [-d] [-c] [-v] [-R]")); puts(_(" [--scripts] [--root ] [--rcfile ]")); puts(_(" [--whatprovides] [--whatrequires] [--requires]")); + puts(_(" [--ftpuseport] [--ftpproxy ] [--ftpport ]")); puts(_(" [--provides] [--dump] [--dbpath ] [targets]")); puts(_(" rpm {--verify -V -y} [-afFpP] [--root ] [--rcfile ]")); puts(_(" [--dbpath ] [--nodeps] [--nofiles] [targets]")); puts(_(" rpm {--erase -e] [--root ] [--noscripts] [--rcfile ]")); - puts(_(" [--dbpath ] package1 ... packageN")); + puts(_(" [--dbpath ] [--nodeps] package1 ... packageN")); puts(_(" rpm {-b}[plciba] [-v] [--short-circuit] [--clean] [--rcfile ]")); puts(_(" [--sign] [--test] [--timecheck ] specfile")); puts(_(" rpm {--rebuild} [--rcfile ] [-v] source1.rpm ... sourceN.rpm")); @@ -109,7 +114,7 @@ void printHelp(void) { puts(_("usage:")); puts(_(" --help - print this message")); puts(_(" --version - print the version of rpm being used")); - puts(_(" all modes support the following arguments")); + puts(_(" all modes support the following arguments:")); puts(_(" --rcfile - use instead of /etc/rpmrc and $HOME/.rpmrc")); puts(_(" -v - be a little more verbose")); puts(_(" -vv - be incredibly verbose (for debugging)")); @@ -117,6 +122,10 @@ void printHelp(void) { puts(_(" --root - use as the top level directory")); puts(_(" --dbpath - use as the directory for the database")); puts(_(" --queryformat - use s as the header format (implies -i)")); + puts(_(" install, upgrade and query (with -p) allow ftp URL's to be used in place\n")); + puts(_(" file names as well as the following options:\n")); + puts(_(" --ftpproxy - hostname or IP of ftp proxy\n")); + puts(_(" --ftpport - port number of ftp server (or proxy)\n")); puts(_(" Package specification options:")); puts(_(" -a - query all packages")); puts(_(" -f + - query package owning ")); @@ -290,6 +299,7 @@ int main(int argc, char ** argv) { char *passPhrase = ""; char *buildRootOverride = NULL; char *arch = NULL; + char * ftpProxy = NULL, * ftpPort = NULL; char *os = NULL; char * smallArgv[2] = { NULL, NULL }; char ** currarg; @@ -311,6 +321,8 @@ int main(int argc, char ** argv) { { "excludedocs", 0, &excldocs, 0}, { "file", 0, 0, 'f' }, { "force", 0, &force, 0 }, + { "ftpport", 1, 0, GETOPT_FTPPORT }, + { "ftpproxy", 1, 0, GETOPT_FTPPROXY }, { "group", 0, 0, 'g' }, { "hash", 0, &showHash, 'h' }, { "help", 0, &help, 0 }, @@ -698,6 +710,14 @@ int main(int argc, char ** argv) { argerror(_("only one major mode may be specified")); bigMode = MODE_REBUILDDB; break; + + case GETOPT_FTPPORT: + ftpPort = optarg; + break; + + case GETOPT_FTPPROXY: + ftpProxy = optarg; + break; default: if (options[long_index].flag) { @@ -834,9 +854,18 @@ int main(int argc, char ** argv) { if (bigMode == MODE_QUERY && dump && !(queryFor & QUERY_FOR_LIST)) argerror(_("--dump of queries must be used with -l, -c, or -d")); + if ((ftpProxy || ftpPort) && !(bigMode == MODE_INSTALL || + (bigMode == MODE_QUERY && (querySource == QUERY_RPM || + querySource == QUERY_SRPM)))) + argerror(_("ftp options can only be used during package queries, " + "installs, and upgrades")); + if (oldPackage || (force && (installFlags & INSTALL_UPGRADE))) installFlags |= INSTALL_UPGRADETOOLD; + if (ftpProxy) setVar(RPMVAR_FTPPROXY, ftpProxy); + if (ftpPort) setVar(RPMVAR_FTPPORT, ftpPort); + if (signIt) { if (bigMode == MODE_REBUILD || bigMode == MODE_BUILD || bigMode == MODE_RESIGN) { -- 2.7.4