From a0f1da436bf39a965d550318916578b7aef85d34 Mon Sep 17 00:00:00 2001 From: ewt Date: Tue, 19 Jan 1999 16:25:10 +0000 Subject: [PATCH] added --excludepath CVS patchset: 2720 CVS date: 1999/01/19 16:25:10 --- CHANGES | 1 + rpm.c | 22 +++++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 1189105..adb7b82 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,5 @@ 2.5.x -> 2.90 + - added --excludepath - identify missing keys by type (Toshio Kuratomi). - package install/removal much smarter about symlinks - redid install/remove API to allow transaction semantics diff --git a/rpm.c b/rpm.c index 5d38cd4..3e64c83 100755 --- a/rpm.c +++ b/rpm.c @@ -19,6 +19,7 @@ #define GETOPT_INSTALL 1014 #define GETOPT_RELOCATE 1016 #define GETOPT_SHOWRC 1018 +#define GETOPT_EXCLUDEPATH 1019 char * version = VERSION; @@ -82,6 +83,7 @@ static struct poptOption optionsTable[] = { { "dbpath", '\0', POPT_ARG_STRING, 0, GETOPT_DBPATH, NULL, NULL}, { "erase", 'e', 0, 0, 'e', NULL, NULL}, { "excludedocs", '\0', 0, &excldocs, 0, NULL, NULL}, + { "excludepath", '\0', POPT_ARG_STRING, 0, GETOPT_EXCLUDEPATH, NULL, NULL}, { "force", '\0', 0, &force, 0, NULL, NULL}, { "ftpport", '\0', POPT_ARG_STRING, &ftpPort, 0, NULL, NULL}, { "ftpproxy", '\0', POPT_ARG_STRING, &ftpProxy, 0, NULL, NULL}, @@ -178,7 +180,8 @@ static void printUsage(void) { puts(_(" [--prefix ] [--ignoreos] [--nodeps] [--allfiles]")); puts(_(" [--ftpproxy ] [--ftpport ] [--justdb]")); puts(_(" [--noorder] [--relocate oldpath=newpath]")); - puts(_(" [--badreloc] [--notriggers] file1.rpm ... fileN.rpm")); + puts(_(" [--badreloc] [--notriggers] [--excludepath ]")); + puts(_(" file1.rpm ... fileN.rpm")); puts(_(" rpm {--upgrade -U} [-v] [--hash -h] [--percent] [--force] [--test]")); puts(_(" [--oldpackage] [--root ] [--noscripts]")); puts(_(" [--excludedocs] [--includedocs] [--rcfile ]")); @@ -186,7 +189,8 @@ static void printUsage(void) { puts(_(" [--ftpproxy ] [--ftpport ]")); puts(_(" [--ignoreos] [--nodeps] [--allfiles] [--justdb]")); puts(_(" [--noorder] [--relocate oldpath=newpath]")); - puts(_(" [--badreloc] file1.rpm ... fileN.rpm")); + puts(_(" [--badreloc] [--excludepath ] file1.rpm ...")); + puts(_(" fileN.rpm")); puts(_(" rpm {--query -q} [-afpg] [-i] [-l] [-s] [-d] [-c] [-v] [-R]")); puts(_(" [--scripts] [--root ] [--rcfile ]")); puts(_(" [--whatprovides] [--whatrequires] [--requires]")); @@ -339,6 +343,8 @@ static void printHelp(void) { puts( _(" --install ")); printHelpLine(_(" -i "), _("install package")); + printHelpLine(_(" --excludepath "), + _("skip files in path ")); printHelpLine(_(" --relocate ="), _("relocate files from to ")); printHelpLine( " --badreloc", @@ -832,6 +838,16 @@ int main(int argc, char ** argv) { relocations[numRelocations++].newPath = errString; break; + case GETOPT_EXCLUDEPATH: + if (*optArg != '/') + argerror(_("exclude paths must begin with a /")); + + relocations = realloc(relocations, + sizeof(*relocations) * (numRelocations + 1)); + relocations[numRelocations].oldPath = optArg; + relocations[numRelocations++].newPath = NULL; + break; + default: fprintf(stderr, _("Internal error in argument processing (%d) :-(\n"), arg); exit(EXIT_FAILURE); @@ -912,7 +928,7 @@ int main(int argc, char ** argv) { argerror(_("only one of --prefix or --relocate may be used")); if (bigMode != MODE_INSTALL && relocations) - argerror(_("--relocate may only be used when installing new packages")); + argerror(_("--relocate and --excludepath may only be used when installing new packages")); if (bigMode != MODE_INSTALL && prefix) argerror(_("--prefix may only be used when installing new packages")); -- 2.7.4