From 113be81304b612e23b4ac923986a60d4fcf3bd10 Mon Sep 17 00:00:00 2001 From: marc Date: Tue, 23 Jul 1996 02:51:48 +0000 Subject: [PATCH] implement --timecheck (used to be --time-check) CVS patchset: 916 CVS date: 1996/07/23 02:51:48 --- rpm.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/rpm.c b/rpm.c index b80cc64..0562dac 100755 --- a/rpm.c +++ b/rpm.c @@ -30,6 +30,7 @@ #define GETOPT_QUERYBYNUMBER 1009 #define GETOPT_DBPATH 1010 #define GETOPT_PREFIX 1011 +#define GETOPT_TIMECHECK 1012 char * version = VERSION; @@ -89,7 +90,7 @@ void printUsage(void) { puts(_(" rpm {--erase -e] [--root ] [--noscripts] [--rcfile ]")); puts(_(" [--dbpath ] package1 ... packageN")); puts(_(" rpm {-b}[plciba] [-v] [--short-circuit] [--clean] [--rcfile ]")); - puts(_(" [--sign] [--test] [--time-check ] specfile")); + puts(_(" [--sign] [--test] [--timecheck ] specfile")); puts(_(" rpm {--rebuild} [--rcfile ] [-v] source1.rpm ... sourceN.rpm")); puts(_(" rpm {--recompile} [--rcfile ] [-v] source1.rpm ... sourceN.rpm")); puts(_(" rpm {--resign} [--rcfile ] package1 package2 ... packageN")); @@ -187,7 +188,7 @@ void printHelp(void) { puts(_(" --sign - generate PGP signature")); puts(_(" --buildroot - use s as the build root")); puts(_(" --test - do not execute any stages")); - puts(_(" --time-check - set the time check to S seconds (0 disables it)")); + puts(_(" --timecheck - set the time check to S seconds (0 disables it)")); puts(_("")); puts(_(" --rebuild ")); puts(_(" - install source package, build binary package,")); @@ -267,6 +268,8 @@ int main(int argc, char ** argv) { int incldocs = 0, queryScripts = 0, noScripts = 0, noDeps = 0; int noPgp = 0, dump = 0, initdb = 0, ignoreArch = 0, showrc = 0; int gotDbpath = 0, building = 0, ignoreOs = 0, noFiles = 0, verifyFlags; + char *tce; + int timeCheck; int addSign = NEW_SIGNATURE; char * rcfile = NULL, * queryFormat = NULL, * prefix = NULL; char buildChar = ' '; @@ -338,6 +341,7 @@ int main(int argc, char ** argv) { { "stdin-packages", 0, 0, 'P' }, { "stdin-query", 0, 0, 'Q' }, { "test", 0, &test, 0 }, + { "timecheck", 1, 0, GETOPT_TIMECHECK }, { "upgrade", 0, 0, 'U' }, { "uninstall", 0, 0, 'u' }, { "verbose", 0, 0, 'v' }, @@ -667,6 +671,15 @@ int main(int argc, char ** argv) { verifySource = VERIFY_RPM; break; + case GETOPT_TIMECHECK: + tce = NULL; + timeCheck = strtoul(optarg, &tce, 10); + if ((*tce) || (tce == optarg) || (timeCheck == ULONG_MAX)) { + argerror("Argument to --timecheck must be integer"); + } + setVar(RPMVAR_TIMECHECK, optarg); + break; + default: if (options[long_index].flag) { *options[long_index].flag = 1; -- 2.7.4