[LEDE-DEV] [PATCH] Opkg: add --no-configure option patch.

Daniel Danzberger daniel at dd-wrt.com
Wed Feb 15 17:14:42 PST 2017


Calling opkg <cmd> with --no-configure prevents opkg
from running the configuration of the package (postinstall scripts ..etc)

This way opkg will only install the package, without restarting the service for example.

Signed-off-by: Daniel Danzberger <daniel at dd-wrt.com>
---
 .../opkg/patches/300-add-no-configure-option.patch | 64 ++++++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100644 package/system/opkg/patches/300-add-no-configure-option.patch

diff --git a/package/system/opkg/patches/300-add-no-configure-option.patch b/package/system/opkg/patches/300-add-no-configure-option.patch
new file mode 100644
index 0000000000..2d69063c65
--- /dev/null
+++ b/package/system/opkg/patches/300-add-no-configure-option.patch
@@ -0,0 +1,64 @@
+diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
+index d2adc31..23f49a7 100644
+--- a/libopkg/opkg_cmd.c
++++ b/libopkg/opkg_cmd.c
+@@ -361,6 +361,9 @@ opkg_configure_packages(char *pkg_name)
+      opkg_intercept_t ic;
+      int r, err = 0;
+ 
++     if (conf->no_configure)
++	     return 0;
++
+      opkg_msg(INFO, "Configuring unpacked packages.\n");
+ 
+      all = pkg_vec_alloc();
+diff --git a/libopkg/opkg_conf.h b/libopkg/opkg_conf.h
+index ab629ea..cbbdc82 100644
+--- a/libopkg/opkg_conf.h
++++ b/libopkg/opkg_conf.h
+@@ -88,6 +88,7 @@ struct opkg_conf
+      int query_all;
+      int verbosity;
+      int noaction;
++     int no_configure;
+      int size;
+      int download_only;
+      char *cache;
+diff --git a/src/opkg-cl.c b/src/opkg-cl.c
+index 8a39578..8b86098 100644
+--- a/src/opkg-cl.c
++++ b/src/opkg-cl.c
+@@ -46,6 +46,7 @@ enum {
+ 	ARGS_OPT_ADD_ARCH,
+ 	ARGS_OPT_ADD_DEST,
+ 	ARGS_OPT_NOACTION,
++	ARGS_OPT_NO_CONFIGURE,
+ 	ARGS_OPT_DOWNLOAD_ONLY,
+ 	ARGS_OPT_NODEPS,
+ 	ARGS_OPT_NOCASE,
+@@ -92,6 +93,7 @@ static struct option long_options[] = {
+ 	{"force-signature", 0, 0, ARGS_OPT_FORCE_SIGNATURE},
+ 	{"force_signature", 0, 0, ARGS_OPT_FORCE_SIGNATURE},
+ 	{"noaction", 0, 0, ARGS_OPT_NOACTION},
++	{"no-configure", 0, 0, ARGS_OPT_NO_CONFIGURE},
+ 	{"download-only", 0, 0, ARGS_OPT_DOWNLOAD_ONLY},
+ 	{"nodeps", 0, 0, ARGS_OPT_NODEPS},
+ 	{"nocase", 0, 0, ARGS_OPT_NOCASE},
+@@ -220,6 +222,9 @@ args_parse(int argc, char *argv[])
+ 		case ARGS_OPT_NOACTION:
+ 			conf->noaction = 1;
+ 			break;
++		case ARGS_OPT_NO_CONFIGURE:
++			conf->no_configure = 1;
++			break;
+         case ARGS_OPT_DOWNLOAD_ONLY:
+ 			conf->download_only = 1;
+ 			break;
+@@ -317,6 +322,7 @@ usage()
+ 	printf("\t--force-remove	Remove package even if prerm script fails\n");
+ 	printf("\t--force-checksum	Don't fail on checksum mismatches\n");
+ 	printf("\t--noaction		No action -- test only\n");
++	printf("\t--no-configure	No configure -- install only\n");
+ 	printf("\t--download-only	No action -- download only\n");
+ 	printf("\t--nodeps		Do not follow dependencies\n");
+ 	printf("\t--nocase		Perform case insensitive pattern matching\n");
-- 
2.11.0




More information about the Lede-dev mailing list