summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/opkg
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2013-08-13 20:31:23 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-22 18:30:01 +0100
commitfeae7a0107ced2d5e88972247d5ef53aa43a5af1 (patch)
treef1513a15c2a24fa4890a479b449928fec3fddc5b /meta/recipes-devtools/opkg
parente58d0fdb66e5fb0472710af677efdd247ec55af1 (diff)
downloadpoky-feae7a0107ced2d5e88972247d5ef53aa43a5af1.tar.gz
opkg: Add support for excluding packages from the install
This adds a new argument to opkg-cl, --add-exclude, which is used to add package names to the list of packages to exclude from the install. If an excluded package is needed for the install to resolve, an error will be generated. Recommended packages will not generate an error. (From OE-Core rev: 63c61b7c0c8aeb89661e3bb85e281dd1ef5b618c) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/opkg')
-rw-r--r--meta/recipes-devtools/opkg/opkg/add-exclude.patch99
-rw-r--r--meta/recipes-devtools/opkg/opkg_svn.bb1
2 files changed, 100 insertions, 0 deletions
diff --git a/meta/recipes-devtools/opkg/opkg/add-exclude.patch b/meta/recipes-devtools/opkg/opkg/add-exclude.patch
new file mode 100644
index 0000000000..34e2bb49fd
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/add-exclude.patch
@@ -0,0 +1,99 @@
1Add a way to exclude specific packages from the install
2
3When an excluded package is required by another package an error
4will be generated. If the excluded package is only recommended,
5no error will be generated.
6
7The lifespan of the exclude_list covers the execution of the process,
8so there is no need to free the data.
9
10Upstream-Status: Pending
11
12Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
13
14Index: trunk/libopkg/opkg_conf.h
15===================================================================
16--- trunk.orig/libopkg/opkg_conf.h
17+++ trunk/libopkg/opkg_conf.h
18@@ -49,6 +49,8 @@ struct opkg_conf
19 pkg_dest_list_t pkg_dest_list;
20 pkg_dest_list_t tmp_dest_list;
21 nv_pair_list_t arch_list;
22+ size_t exclude_count;
23+ char ** exclude_list;
24
25 int restrict_to_default_dest;
26 pkg_dest_t *default_dest;
27Index: trunk/libopkg/pkg_depends.c
28===================================================================
29--- trunk.orig/libopkg/pkg_depends.c
30+++ trunk/libopkg/pkg_depends.c
31@@ -212,6 +212,22 @@ pkg_hash_fetch_unsatisfied_dependencies(
32 continue;
33 }
34
35+ /* Check for excluded packages */
36+ if (satisfying_pkg != NULL && conf->exclude_list) {
37+ int i, exclude = 0;
38+ for (i = 0; i < conf->exclude_count; i++) {
39+ if (!strcmp(satisfying_pkg->name, conf->exclude_list[i])) {
40+ opkg_msg(NOTICE, "%s: exclude required package %s"
41+ "at users request\n",
42+ pkg->name, satisfying_pkg->name);
43+ exclude = 1;
44+ break;
45+ }
46+ }
47+ if (exclude)
48+ continue;
49+ }
50+
51 opkg_msg(DEBUG, "satisfying_pkg=%p\n", satisfying_pkg);
52 if (satisfying_pkg != NULL) {
53 satisfier_entry_pkg = satisfying_pkg;
54Index: trunk/src/opkg-cl.c
55===================================================================
56--- trunk.orig/src/opkg-cl.c
57+++ trunk/src/opkg-cl.c
58@@ -45,6 +45,7 @@ enum {
59 ARGS_OPT_PREFER_ARCH_TO_VERSION,
60 ARGS_OPT_ADD_ARCH,
61 ARGS_OPT_ADD_DEST,
62+ ARGS_OPT_ADD_EXCLUDE,
63 ARGS_OPT_NOACTION,
64 ARGS_OPT_DOWNLOAD_ONLY,
65 ARGS_OPT_NODEPS,
66@@ -95,6 +96,7 @@ static struct option long_options[] = {
67 {"offline-root", 1, 0, 'o'},
68 {"add-arch", 1, 0, ARGS_OPT_ADD_ARCH},
69 {"add-dest", 1, 0, ARGS_OPT_ADD_DEST},
70+ {"add-exclude", 1, 0, ARGS_OPT_ADD_EXCLUDE},
71 {"test", 0, 0, ARGS_OPT_NOACTION},
72 {"tmp-dir", 1, 0, 't'},
73 {"tmp_dir", 1, 0, 't'},
74@@ -198,6 +200,17 @@ args_parse(int argc, char *argv[])
75 }
76 free(tuple);
77 break;
78+ case ARGS_OPT_ADD_EXCLUDE:
79+ tuple = xstrdup(optarg);
80+ if (!conf->exclude_list) {
81+ conf->exclude_count = 1;
82+ conf->exclude_list = malloc(sizeof(char *) * conf->exclude_count);
83+ conf->exclude_list[conf->exclude_count - 1] = tuple;
84+ } else {
85+ conf->exclude_count++;
86+ conf->exclude_list = realloc(conf->exclude_list, sizeof(char *) * conf->exclude_count);
87+ conf->exclude_list[conf->exclude_count - 1] = tuple;
88+ }
89 case ARGS_OPT_NOACTION:
90 conf->noaction = 1;
91 break;
92@@ -282,6 +295,7 @@ usage()
93 printf("\t--offline-root <dir> offline installation of packages.\n");
94 printf("\t--add-arch <arch>:<prio> Register architecture with given priority\n");
95 printf("\t--add-dest <name>:<path> Register destination with given path\n");
96+ printf("\t--add-exclude <name> Register package to be excluded from install\n");
97 printf("\t--prefer-arch-to-version\t Use the architecture priority package rather\n");
98 printf("\t than the higher version one if more\n");
99 printf("\t than one candidate is found.\n");
diff --git a/meta/recipes-devtools/opkg/opkg_svn.bb b/meta/recipes-devtools/opkg/opkg_svn.bb
index dbfca0fcc8..bc10491030 100644
--- a/meta/recipes-devtools/opkg/opkg_svn.bb
+++ b/meta/recipes-devtools/opkg/opkg_svn.bb
@@ -2,6 +2,7 @@ require opkg.inc
2 2
3SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \ 3SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \
4 file://no-install-recommends.patch \ 4 file://no-install-recommends.patch \
5 file://add-exclude.patch \
5" 6"
6 7
7S = "${WORKDIR}/trunk" 8S = "${WORKDIR}/trunk"