#include "../libbb/libbb.h"
enum {
- ARGS_OPT_FORCE_MAINTAINER = 129,
+ ARGS_OPT_FORCE_MAINTAINER = 129,
ARGS_OPT_FORCE_DEPENDS,
ARGS_OPT_FORCE_OVERWRITE,
ARGS_OPT_FORCE_DOWNGRADE,
ARGS_OPT_FORCE_REMOVAL_OF_DEPENDENT_PACKAGES,
ARGS_OPT_FORCE_REMOVAL_OF_ESSENTIAL_PACKAGES,
ARGS_OPT_FORCE_SPACE,
+ ARGS_OPT_FORCE_POSTINSTALL,
ARGS_OPT_NOACTION,
+ ARGS_OPT_DOWNLOAD_ONLY,
ARGS_OPT_NODEPS,
ARGS_OPT_AUTOREMOVE,
ARGS_OPT_CACHE,
ARGS_OPT_FORCE_REMOVAL_OF_ESSENTIAL_PACKAGES},
{"force_removal_of_essential_packages", 0, 0,
ARGS_OPT_FORCE_REMOVAL_OF_ESSENTIAL_PACKAGES},
+ {"force-postinstall", 0, 0, ARGS_OPT_FORCE_POSTINSTALL},
+ {"force_postinstall", 0, 0, ARGS_OPT_FORCE_POSTINSTALL},
{"noaction", 0, 0, ARGS_OPT_NOACTION},
+ {"download-only", 0, 0, ARGS_OPT_DOWNLOAD_ONLY},
{"nodeps", 0, 0, ARGS_OPT_NODEPS},
{"offline", 1, 0, 'o'},
{"offline-root", 1, 0, 'o'},
int parse_err = 0;
while (1) {
- c = getopt_long_only(argc, argv, "Ad:f:no:p:t:vV:",
+ c = getopt_long_only(argc, argv, "Ad:f:no:p:t:vV::",
long_options, &option_index);
if (c == -1)
break;
printf("opkg version %s\n", VERSION);
exit(0);
case 'V':
- conf->verbosity = atoi(optarg);
+ conf->verbosity = INFO;
+ if (optarg != NULL)
+ conf->verbosity = atoi(optarg);
break;
case ARGS_OPT_AUTOREMOVE:
conf->autoremove = 1;
case ARGS_OPT_FORCE_SPACE:
conf->force_space = 1;
break;
+ case ARGS_OPT_FORCE_POSTINSTALL:
+ conf->force_postinstall = 1;
+ break;
case ARGS_OPT_NODEPS:
conf->nodeps = 1;
break;
case ARGS_OPT_NOACTION:
conf->noaction = 1;
break;
+ case ARGS_OPT_DOWNLOAD_ONLY:
+ conf->download_only = 1;
+ break;
case ':':
parse_err = -1;
break;
printf("Confusion: getopt_long returned %d\n", c);
}
}
-
+
if (parse_err)
return parse_err;
else
printf("\twhatreplaces [-A] [pkgname|pat]+\n");
printf("\nOptions:\n");
- printf("\t-A Query all packages not just those installed\n");
- printf("\t-V <level> Set verbosity level to <level>.\n");
- printf("\t--verbosity <level> Verbosity levels:\n");
+ printf("\t-A Query all packages not just those installed\n");
+ printf("\t-V[<level>] Set verbosity level to <level>.\n");
+ printf("\t--verbosity[=<level>] Verbosity levels:\n");
printf("\t 0 errors only\n");
printf("\t 1 normal messages (default)\n");
printf("\t 2 informative messages\n");
printf("\t--offline-root <dir> offline installation of packages.\n");
printf("\nForce Options:\n");
- printf("\t--force-depends Install/remove despite failed dependences\n");
+ printf("\t--force-depends Install/remove despite failed dependencies\n");
printf("\t--force-maintainer Overwrite preexisting config files\n");
printf("\t--force-reinstall Reinstall package(s)\n");
printf("\t--force-overwrite Overwrite files from other package(s)\n");
printf("\t--force-downgrade Allow opkg to downgrade packages\n");
printf("\t--force-space Disable free space checks\n");
+ printf("\t--force-postinstall Run postinstall scripts even in offline mode\n");
printf("\t--noaction No action -- test only\n");
- printf("\t--nodeps Do not follow dependences\n");
+ printf("\t--download-only No action -- download only\n");
+ printf("\t--nodeps Do not follow dependencies\n");
printf("\t--force-removal-of-dependent-packages\n");
printf("\t Remove package and all dependencies\n");
printf("\t--autoremove Remove packages that were installed\n");
printf(" regexp could be something like 'pkgname*' '*file*' or similar\n");
printf(" e.g. opkg info 'libstd*' or opkg search '*libop*' or opkg remove 'libncur*'\n");
- /* --force-removal-of-essential-packages Let opkg remove essential packages.
+ /* --force-removal-of-essential-packages Let opkg remove essential packages.
Using this option is almost guaranteed to break your system, hence this option
is not even advertised in the usage statement. */
opts = args_parse(argc, argv);
if (opts == argc || opts < 0) {
- fprintf (stderr, "%s: unknown sub-command %s\n", argv[0],
- cmd_name);
fprintf(stderr, "opkg must have one sub-command argument\n");
usage();
}
if (pkg_hash_load_feeds())
goto err1;
}
-
+
if (pkg_hash_load_status_files())
goto err1;
}