18 extern time_t
get_date(
const char * p,
void * now);
24 #if defined(RPM_VENDOR_MANDRIVA)
32 #define POPT_RELOCATE -1021
33 #define POPT_EXCLUDEPATH -1022
34 #define POPT_ROLLBACK -1023
35 #define POPT_ROLLBACK_EXCLUDE -1024
37 #define POPT_AUTOROLLBACK_GOAL -1036
39 #define alloca_strdup(_s) strcpy((char *)alloca(strlen(_s)+1), (_s))
46 static void argerror(
const char * desc) __attribute__((__noreturn__));
61 enum poptCallbackReason reason,
62 const struct poptOption * opt,
const char * arg,
80 if (arg == NULL || *arg !=
'/')
81 argerror(
_(
"exclude paths must begin with a /"));
85 {
char * oldPath = NULL;
86 char * newPath = NULL;
89 argerror(
_(
"Option --relocate needs /old/path=/new/path argument"));
91 argerror(
_(
"relocations must begin with a /"));
93 if (!(newPath = strchr(oldPath,
'=')))
94 argerror(
_(
"relocations must contain a ="));
97 argerror(
_(
"relocations must have a / following the ="));
100 oldPath =
_free(oldPath);
109 argerror(
_(
"Option --rbexclude needs transaction id argument(s)"));
112 while (*te !=
'\0' && strchr(
" \t\n,", *te) != NULL)
114 while ((t = te++) != NULL && *t !=
'\0') {
116 while (*te !=
'\0' && strchr(
" \t\n,", *te) == NULL)
118 while (*te !=
'\0' && strchr(
" \t\n,", *te) != NULL)
140 argerror(
_(
"Option --rollback needs a time/date stamp argument"));
147 if (tid == (time_t)-1 || tid == (time_t)0)
148 argerror(
_(
"malformed rollback time/date stamp argument"));
155 argerror(
_(
"arbgoal takes a time/date stamp argument"));
161 if (tid == (time_t)-1 || tid == (time_t)0)
162 argerror(
_(
"malformed arbgoal time/date stamp argument"));
206 { NULL,
'\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA | POPT_CBFLAG_CONTINUE,
210 {
"allfiles",
'\0', POPT_BIT_SET,
212 N_(
"install all files, even configurations which might otherwise be skipped"),
214 {
"apply",
'\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &rpmIArgs.
transFlags,
217 N_(
"do not execute package scriptlet(s)"), NULL },
218 {
"dirstash",
'\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
220 N_(
"save erased package files by renaming into sub-directory"), NULL},
221 {
"excludeconfigs",
'\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
223 N_(
"do not install configuration files"), NULL},
224 {
"excludedocs",
'\0', POPT_BIT_SET,
226 N_(
"do not install documentation"), NULL},
228 N_(
"update the database, but do not modify the filesystem"), NULL},
231 N_(
"do not install configuration files"), NULL},
234 N_(
"do not install documentation"), NULL},
238 N_(
"don't install file security contexts"), NULL},
239 {
"nofdigests",
'\0', POPT_BIT_SET,
241 N_(
"don't verify file digests"), NULL },
244 N_(
"don't verify file security contexts"), NULL },
246 N_(
"don't verify file digests"), NULL },
250 N_(
"don't register headers in rpmdb"), NULL},
253 {
"noscripts",
'\0', POPT_BIT_SET,
255 N_(
"do not execute package scriptlet(s)"), NULL },
258 N_(
"do not execute package scriptlet(s)"), NULL },
262 N_(
"do not execute %%pretrans scriptlet (if any)"), NULL },
265 N_(
"do not execute %%pre scriptlet (if any)"), NULL },
268 N_(
"do not execute %%post scriptlet (if any)"), NULL },
271 N_(
"do not execute %%preun scriptlet (if any)"), NULL },
274 N_(
"do not execute %%postun scriptlet (if any)"), NULL },
277 N_(
"do not execute %%postrans scriptlet (if any)"), NULL },
280 N_(
"do not execute any scriptlet(s) triggered by this package"), NULL},
283 N_(
"do not execute any %%triggerprein scriptlet(s)"), NULL},
286 N_(
"do not execute any %%triggerin scriptlet(s)"), NULL},
289 N_(
"do not execute any %%triggerun scriptlet(s)"), NULL},
292 N_(
"do not execute any %%triggerpostun scriptlet(s)"), NULL},
296 N_(
"save erased package files by repackaging"), NULL},
298 N_(
"don't install, but tell if it would work or not"), NULL},
300 {
"allmatches",
'\0', POPT_BIT_SET,
302 N_(
"remove all packages which match <package> (normally an error is generated if <package> specified multiple packages)"),
305 {
"badreloc",
'\0', POPT_BIT_SET,
307 N_(
"relocate files in non-relocatable package"), NULL},
309 {
"erase",
'e', POPT_BIT_SET,
311 N_(
"erase (uninstall) package"),
N_(
"<package>+") },
313 N_(
"skip files with leading component <path> "),
316 {
"fileconflicts",
'\0', POPT_BIT_CLR, &rpmIArgs.
probFilter,
318 N_(
"detect file conflicts between packages"), NULL},
322 N_(
"upgrade package(s) if already installed"),
323 N_(
"<packagefile>+") },
325 N_(
"print hash marks as package installs (good with -v)"), NULL},
327 {
"ignorearch",
'\0', POPT_BIT_SET,
329 N_(
"don't verify package architecture"), NULL},
330 {
"ignoreos",
'\0', POPT_BIT_SET,
332 N_(
"don't verify package operating system"), NULL},
334 {
"ignoresize",
'\0', POPT_BIT_SET, &rpmIArgs.
probFilter,
336 N_(
"don't check disk space before installing"), NULL},
337 {
"includedocs",
'\0', POPT_ARGFLAG_DOC_HIDDEN, &rpmIArgs.
incldocs, 0,
338 N_(
"install documentation"), NULL},
340 {
"install",
'i', 0, NULL,
'i',
341 N_(
"install package(s)"),
N_(
"<packagefile>+") },
344 N_(
"do not verify package dependencies"), NULL },
346 {
"noorder",
'\0', POPT_BIT_SET,
348 N_(
"do not reorder package installation to satisfy dependencies"),
352 N_(
"don't verify package digest(s)"), NULL },
354 N_(
"don't verify database header(s) when retrieved"), NULL },
356 N_(
"don't verify package signature(s)"), NULL },
358 {
"oldpackage",
'\0', POPT_BIT_SET,
360 N_(
"upgrade to an old version of the package (--force on upgrades does this automatically)"),
362 {
"percent",
'\0', POPT_BIT_SET,
364 N_(
"print percentages as package installs"), NULL},
365 {
"prefix",
'\0', POPT_ARG_STRING, &rpmIArgs.
qva_prefix, 0,
366 N_(
"relocate the package to <dir>, if relocatable"),
369 N_(
"relocate files from path <old> to <new>"),
371 {
"replacefiles",
'\0', POPT_BIT_SET, &rpmIArgs.
probFilter,
373 N_(
"ignore file conflicts between packages"), NULL},
374 {
"replacepkgs",
'\0', POPT_BIT_SET,
376 N_(
"reinstall if the package is already present"), NULL},
377 {
"rollback",
'\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, NULL,
POPT_ROLLBACK,
378 N_(
"deinstall new, reinstall old, package(s), back to <date>"),
381 N_(
"If transaction fails rollback to <date>"),
384 N_(
"Exclude Transaction I.D. from rollback"),
386 {
"upgrade",
'U', POPT_BIT_SET,
388 N_(
"upgrade package(s)"),
389 N_(
"<packagefile>+") },