/*@unchecked@*/
struct rpmBuildArguments_s rpmBTArgs;
-#define POPT_USECATALOG 1000
-#define POPT_NOLANG 1001
-#define POPT_RMSOURCE 1002
-#define POPT_RMBUILD 1003
-#define POPT_BUILDROOT 1004
-#define POPT_TARGETPLATFORM 1007
-#define POPT_NOBUILD 1008
-#define POPT_SHORTCIRCUIT 1009
-#define POPT_RMSPEC 1010
-#define POPT_NODEPS 1011
-#define POPT_SIGN 1012
-#define POPT_FORCE 1013
+#define POPT_USECATALOG -1000
+#define POPT_NOLANG -1001
+#define POPT_RMSOURCE -1002
+#define POPT_RMBUILD -1003
+#define POPT_BUILDROOT -1004
+#define POPT_TARGETPLATFORM -1007
+#define POPT_NOBUILD -1008
+#define POPT_SHORTCIRCUIT -1009
+#define POPT_RMSPEC -1010
+#define POPT_NODEPS -1011
+#define POPT_SIGN -1012
+#define POPT_FORCE -1013
#define POPT_REBUILD 0x4220
#define POPT_RECOMPILE 0x4320
/*@unchecked@*/
struct rpmInstallArguments_s rpmIArgs;
-#define POPT_RELOCATE 1016
-#define POPT_EXCLUDEPATH 1019
-#define POPT_ROLLBACK 1024
+#define POPT_RELOCATE -1016
+#define POPT_EXCLUDEPATH -1019
+#define POPT_ROLLBACK -1024
/*@exits@*/ static void argerror(const char * desc)
/*@*/
{
struct rpmInstallArguments_s * ia = &rpmIArgs;
+#if 0
+fprintf(stderr, "*** opt %s %c info 0x%x arg %p val 0x%x arg %p %s\n", opt->longName, opt->shortName, opt->argInfo, opt->arg, opt->val, arg, arg);
+#endif
+
+ /* XXX avoid accidental collisions with POPT_BIT_SET for flags */
/*@-branchstate@*/
+ if (opt->arg == NULL)
switch (opt->val) {
case POPT_EXCLUDEPATH:
if (arg == NULL || *arg != '/')
} break;
case POPT_ROLLBACK:
{ time_t tid;
+ if (arg == NULL)
+ argerror(_("rollback takes a time/date stamp argument"));
+
/*@-moduncon@*/
tid = get_date(arg, NULL);
/*@=moduncon@*/
- if (tid == (time_t)-1)
- argerror(_("malformed rollback time"));
+
+ if (tid == (time_t)-1 || tid == (time_t)0)
+ argerror(_("malformed rollback time/date stamp argument"));
ia->rbtid = tid;
} break;
}
&rpmIArgs.probFilter, RPMPROB_FILTER_REPLACEPKG,
N_("reinstall if the package is already present"), NULL},
{ "rollback", '\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, 0, POPT_ROLLBACK,
- N_("deinstall new package(s), reinstall old package(s), back to date"),
+ N_("deinstall new, reinstall old, package(s), back to <date>"),
N_("<date>") },
{ "test", '\0', POPT_BIT_SET, &rpmIArgs.transFlags, RPMTRANS_FLAG_TEST,
N_("don't install, but tell if it would work or not"), NULL},
/*@unchecked@*/
int specedit = 0;
-#define POPT_QUERYFORMAT 1000
-#define POPT_WHATREQUIRES 1001
-#define POPT_WHATPROVIDES 1002
-#define POPT_QUERYBYNUMBER 1003
-#define POPT_TRIGGEREDBY 1004
-#define POPT_DUMP 1005
-#define POPT_SPECFILE 1006
+#define POPT_QUERYFORMAT -1000
+#define POPT_WHATREQUIRES -1001
+#define POPT_WHATPROVIDES -1002
+#define POPT_QUERYBYNUMBER -1003
+#define POPT_TRIGGEREDBY -1004
+#define POPT_DUMP -1005
+#define POPT_SPECFILE -1006
/* ========== Query/Verify/Signature source args */
static void rpmQVSourceArgCallback( /*@unused@*/ poptContext con,
#include <rpmcli.h>
#include <rpmbuild.h>
-#define POPT_NODEPS 1025
-#define POPT_FORCE 1026
-#define POPT_NOMD5 1027
-#define POPT_NOSCRIPTS 1028
+#define POPT_NODEPS -1025
+#define POPT_FORCE -1026
+#define POPT_NOMD5 -1027
+#define POPT_NOSCRIPTS -1028
#ifdef IAM_RPMBT
#include "build.h"
-#define GETOPT_REBUILD 1003
-#define GETOPT_RECOMPILE 1004
+#define GETOPT_REBUILD -1003
+#define GETOPT_RECOMPILE -1004
#endif
#if defined(IAM_RPMBT) || defined(IAM_RPMK)
#include "debug.h"
-#define GETOPT_DBPATH 1010
-#define GETOPT_SHOWRC 1018
-#define GETOPT_DEFINEMACRO 1020
-#define GETOPT_EVALMACRO 1021
+#define GETOPT_DBPATH -1010
+#define GETOPT_SHOWRC -1018
+#define GETOPT_DEFINEMACRO -1020
+#define GETOPT_EVALMACRO -1021
#ifdef NOTYET
-#define GETOPT_RCFILE 1022
+#define GETOPT_RCFILE -1022
#endif
enum modes {
#ifdef IAM_RPMEIU
case MODE_ERASE:
if (!poptPeekArg(optCon))
- argerror(_("no packages given for uninstall"));
+ argerror(_("no packages given for erase"));
if (ia->noDeps) ia->eraseInterfaceFlags |= UNINSTALL_NODEPS;