Root/package/opkg/patches/014-force-postinstall.patch

1--- a/libopkg/opkg_conf.c
2+++ b/libopkg/opkg_conf.c
3@@ -54,6 +54,7 @@ opkg_option_t options[] = {
4       { "force_reinstall", OPKG_OPT_TYPE_BOOL, &_conf.force_reinstall },
5       { "force_space", OPKG_OPT_TYPE_BOOL, &_conf.force_space },
6           { "check_signature", OPKG_OPT_TYPE_BOOL, &_conf.check_signature },
7+ { "force_postinstall", OPKG_OPT_TYPE_BOOL, &_conf.force_postinstall },
8       { "ftp_proxy", OPKG_OPT_TYPE_STRING, &_conf.ftp_proxy },
9       { "http_proxy", OPKG_OPT_TYPE_STRING, &_conf.http_proxy },
10       { "no_proxy", OPKG_OPT_TYPE_STRING, &_conf.no_proxy },
11--- a/libopkg/opkg_conf.h
12+++ b/libopkg/opkg_conf.h
13@@ -73,6 +73,7 @@ struct opkg_conf
14      int force_space;
15      int force_removal_of_dependent_packages;
16      int force_removal_of_essential_packages;
17+ int force_postinstall;
18      int check_signature;
19      int nodeps; /* do not follow dependencies */
20      char *offline_root;
21--- a/libopkg/pkg.c
22+++ b/libopkg/pkg.c
23@@ -1249,7 +1249,7 @@ pkg_run_script(pkg_t *pkg, const char *s
24 
25      /* XXX: FEATURE: When conf->offline_root is set, we should run the
26     maintainer script within a chroot environment. */
27- if (conf->offline_root) {
28+ if (conf->offline_root && !conf->force_postinstall) {
29           opkg_msg(INFO, "Offline root mode: not running %s.%s.\n",
30               pkg->name, script);
31       return 0;
32--- a/src/opkg-cl.c
33+++ b/src/opkg-cl.c
34@@ -39,6 +39,7 @@ enum {
35     ARGS_OPT_FORCE_REMOVAL_OF_DEPENDENT_PACKAGES,
36     ARGS_OPT_FORCE_REMOVAL_OF_ESSENTIAL_PACKAGES,
37     ARGS_OPT_FORCE_SPACE,
38+ ARGS_OPT_FORCE_POSTINSTALL,
39     ARGS_OPT_NOACTION,
40     ARGS_OPT_DOWNLOAD_ONLY,
41     ARGS_OPT_NODEPS,
42@@ -74,6 +75,8 @@ static struct option long_options[] = {
43         ARGS_OPT_FORCE_REMOVAL_OF_ESSENTIAL_PACKAGES},
44     {"force_removal_of_essential_packages", 0, 0,
45         ARGS_OPT_FORCE_REMOVAL_OF_ESSENTIAL_PACKAGES},
46+ {"force-postinstall", 0, 0, ARGS_OPT_FORCE_POSTINSTALL},
47+ {"force_postinstall", 0, 0, ARGS_OPT_FORCE_POSTINSTALL},
48     {"noaction", 0, 0, ARGS_OPT_NOACTION},
49     {"download-only", 0, 0, ARGS_OPT_DOWNLOAD_ONLY},
50     {"nodeps", 0, 0, ARGS_OPT_NODEPS},
51@@ -153,6 +156,9 @@ args_parse(int argc, char *argv[])
52         case ARGS_OPT_FORCE_SPACE:
53             conf->force_space = 1;
54             break;
55+ case ARGS_OPT_FORCE_POSTINSTALL:
56+ conf->force_postinstall = 1;
57+ break;
58         case ARGS_OPT_NODEPS:
59             conf->nodeps = 1;
60             break;
61@@ -242,6 +248,7 @@ usage()
62     printf("\t--force-overwrite Overwrite files from other package(s)\n");
63     printf("\t--force-downgrade Allow opkg to downgrade packages\n");
64     printf("\t--force-space Disable free space checks\n");
65+ printf("\t--force-postinstall Run postinstall scripts even in offline mode\n");
66     printf("\t--noaction No action -- test only\n");
67     printf("\t--download-only No action -- download only\n");
68     printf("\t--nodeps Do not follow dependencies\n");
69

Archive Download this file



interactive