summaryrefslogtreecommitdiff
path: root/rpm.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>1999-03-28 00:47:40 +0000
committerjbj <devnull@localhost>1999-03-28 00:47:40 +0000
commit9b94f186e688a2e604948bb4d6d460b78d67c3c0 (patch)
tree2580feaa9175b2809cccc3a242526be2786502d2 /rpm.c
parent6147ae79959477cec35cb6ed6211c0c1b53ac710 (diff)
downloadrpm-9b94f186e688a2e604948bb4d6d460b78d67c3c0.tar.gz
rpm-9b94f186e688a2e604948bb4d6d460b78d67c3c0.tar.bz2
rpm-9b94f186e688a2e604948bb4d6d460b78d67c3c0.zip
fix: avoid segfault using --prefix until ewt fixes.
add --define "%foo %bar" option. dump macros to same fd as --showrc uses. add %GNUconfigure for full-blown package regeneration. fix: RPM_ARCH/RPM_OS had wrong values. fix: create ppc directories correctly. CVS patchset: 2922 CVS date: 1999/03/28 00:47:40
Diffstat (limited to 'rpm.c')
-rwxr-xr-xrpm.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/rpm.c b/rpm.c
index 32dc72762..a1d378ae2 100755
--- a/rpm.c
+++ b/rpm.c
@@ -20,6 +20,8 @@
#define GETOPT_RELOCATE 1016
#define GETOPT_SHOWRC 1018
#define GETOPT_EXCLUDEPATH 1019
+#define GETOPT_DEFINEMACRO 1020
+#define GETOPT_PREFIX 1021 /* XXX hack to avoid prefix dump */
char * version = VERSION;
@@ -85,6 +87,7 @@ static struct poptOption optionsTable[] = {
{ "build", 'b', POPT_ARG_STRING, 0, 'b', NULL, NULL},
{ "checksig", 'K', 0, 0, 'K', NULL, NULL},
{ "dbpath", '\0', POPT_ARG_STRING, 0, GETOPT_DBPATH, NULL, NULL},
+ { "define", '\0', POPT_ARG_STRING, 0, GETOPT_DEFINEMACRO, 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},
@@ -115,7 +118,7 @@ static struct poptOption optionsTable[] = {
{ "oldpackage", '\0', 0, &oldPackage, 0, NULL, NULL},
{ "percent", '\0', 0, &showPercents, 0, NULL, NULL},
{ "pipe", '\0', POPT_ARG_STRING, &pipeOutput, 0, NULL, NULL},
- { "prefix", '\0', POPT_ARG_STRING, &prefix, 0, NULL, NULL},
+ { "prefix", '\0', POPT_ARG_STRING, &prefix, GETOPT_PREFIX, NULL, NULL},
{ "query", 'q', 0, NULL, 'q', NULL, NULL},
{ "querytags", '\0', 0, &queryTags, 0, NULL, NULL},
{ "quiet", '\0', 0, &quiet, 0, NULL, NULL},
@@ -819,10 +822,18 @@ int main(int argc, char ** argv) {
case GETOPT_DBPATH:
if (optArg[0] != '/')
argerror(_("arguments to --dbpath must begin with a /"));
- addMacro(&globalMacroContext, "_dbpath", NULL, optArg, RMIL_CMDLINE);
+ addMacro(&globalMacroContext,"_dbpath", NULL, optArg, RMIL_CMDLINE);
gotDbpath = 1;
break;
+ case GETOPT_DEFINEMACRO:
+ rpmDefineMacro(&globalMacroContext, optArg, RMIL_CMDLINE);
+ break;
+
+ case GETOPT_PREFIX: /* XXX FIXME */
+ argerror(_("--prefix is broke, use --relocate /oldpath=/newpath instead"));
+ break;
+
case GETOPT_TIMECHECK:
tce = NULL;
timeCheck = strtoul(optArg, &tce, 10);
@@ -988,7 +999,7 @@ int main(int argc, char ** argv) {
"installation"));
if (bigMode != MODE_INSTALL && ignoreSize)
- argerror(_("--ignoreos may only be specified during package "
+ argerror(_("--ignoresize may only be specified during package "
"installation"));
if (allMatches && bigMode != MODE_UNINSTALL)