diff options
Diffstat (limited to 'meta/recipes-devtools/opkg/opkg/add-exclude.patch')
-rw-r--r-- | meta/recipes-devtools/opkg/opkg/add-exclude.patch | 131 |
1 files changed, 0 insertions, 131 deletions
diff --git a/meta/recipes-devtools/opkg/opkg/add-exclude.patch b/meta/recipes-devtools/opkg/opkg/add-exclude.patch deleted file mode 100644 index 48de923590..0000000000 --- a/meta/recipes-devtools/opkg/opkg/add-exclude.patch +++ /dev/null | |||
@@ -1,131 +0,0 @@ | |||
1 | From 60c3f93e95a3ca54ef0a7eebc5ef29a5d92d3110 Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Barker <paul@paulbarker.me.uk> | ||
3 | Date: Fri, 28 Mar 2014 15:20:22 +0000 | ||
4 | Subject: [PATCH 2/2] opkg-0.2.x: add-exclude | ||
5 | |||
6 | Add a way to exclude specific packages from the install | ||
7 | |||
8 | When an excluded package is required by another package an error | ||
9 | will be generated. If the excluded package is only recommended, | ||
10 | no error will be generated. | ||
11 | |||
12 | The lifespan of the exclude_list covers the execution of the process, | ||
13 | so there is no need to free the data. | ||
14 | |||
15 | v2: Use xmalloc instead of malloc and xrealloc instead of realloc. In opkg, | ||
16 | these functions are guaranteed not to return NULL. | ||
17 | |||
18 | Upstream-Status: Accepted for v0.3.0 release with modifications | ||
19 | |||
20 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
21 | Signed-off-by: Jonathan Liu <net147@gmail.com> | ||
22 | Signed-off-by: Paul Barker <paul@paulbarker.me.uk> | ||
23 | --- | ||
24 | libopkg/opkg_conf.c | 1 + | ||
25 | libopkg/opkg_conf.h | 2 ++ | ||
26 | libopkg/pkg_depends.c | 16 ++++++++++++++++ | ||
27 | src/opkg-cl.c | 15 +++++++++++++++ | ||
28 | 4 files changed, 34 insertions(+) | ||
29 | |||
30 | diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c | ||
31 | index 4eee37b..1ab63fb 100644 | ||
32 | --- a/libopkg/opkg_conf.c | ||
33 | +++ b/libopkg/opkg_conf.c | ||
34 | @@ -447,6 +447,7 @@ opkg_conf_init(void) | ||
35 | pkg_dest_list_init(&conf->pkg_dest_list); | ||
36 | pkg_dest_list_init(&conf->tmp_dest_list); | ||
37 | nv_pair_list_init(&conf->arch_list); | ||
38 | + conf->exclude_list = NULL; | ||
39 | |||
40 | return 0; | ||
41 | } | ||
42 | diff --git a/libopkg/opkg_conf.h b/libopkg/opkg_conf.h | ||
43 | index 2f189e0..6d6e613 100644 | ||
44 | --- a/libopkg/opkg_conf.h | ||
45 | +++ b/libopkg/opkg_conf.h | ||
46 | @@ -51,6 +51,8 @@ struct opkg_conf | ||
47 | pkg_dest_list_t pkg_dest_list; | ||
48 | pkg_dest_list_t tmp_dest_list; | ||
49 | nv_pair_list_t arch_list; | ||
50 | + size_t exclude_count; | ||
51 | + char ** exclude_list; | ||
52 | |||
53 | int restrict_to_default_dest; | ||
54 | pkg_dest_t *default_dest; | ||
55 | diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c | ||
56 | index 41bf206..eb630d1 100644 | ||
57 | --- a/libopkg/pkg_depends.c | ||
58 | +++ b/libopkg/pkg_depends.c | ||
59 | @@ -204,6 +204,22 @@ pkg_hash_fetch_unsatisfied_dependencies(pkg_t * pkg, pkg_vec_t *unsatisfied, | ||
60 | continue; | ||
61 | } | ||
62 | |||
63 | + /* Check for excluded packages */ | ||
64 | + if (satisfying_pkg != NULL && conf->exclude_list) { | ||
65 | + int i, exclude = 0; | ||
66 | + for (i = 0; i < conf->exclude_count; i++) { | ||
67 | + if (!strcmp(satisfying_pkg->name, conf->exclude_list[i])) { | ||
68 | + opkg_msg(NOTICE, "%s: exclude required package %s" | ||
69 | + "at users request\n", | ||
70 | + pkg->name, satisfying_pkg->name); | ||
71 | + exclude = 1; | ||
72 | + break; | ||
73 | + } | ||
74 | + } | ||
75 | + if (exclude) | ||
76 | + continue; | ||
77 | + } | ||
78 | + | ||
79 | opkg_msg(DEBUG, "satisfying_pkg=%p\n", satisfying_pkg); | ||
80 | if (satisfying_pkg != NULL) { | ||
81 | satisfier_entry_pkg = satisfying_pkg; | ||
82 | diff --git a/src/opkg-cl.c b/src/opkg-cl.c | ||
83 | index 6378380..f10d10b 100644 | ||
84 | --- a/src/opkg-cl.c | ||
85 | +++ b/src/opkg-cl.c | ||
86 | @@ -45,6 +45,7 @@ enum { | ||
87 | ARGS_OPT_PREFER_ARCH_TO_VERSION, | ||
88 | ARGS_OPT_ADD_ARCH, | ||
89 | ARGS_OPT_ADD_DEST, | ||
90 | + ARGS_OPT_ADD_EXCLUDE, | ||
91 | ARGS_OPT_NOACTION, | ||
92 | ARGS_OPT_DOWNLOAD_ONLY, | ||
93 | ARGS_OPT_NODEPS, | ||
94 | @@ -97,6 +98,7 @@ static struct option long_options[] = { | ||
95 | {"offline-root", 1, 0, 'o'}, | ||
96 | {"add-arch", 1, 0, ARGS_OPT_ADD_ARCH}, | ||
97 | {"add-dest", 1, 0, ARGS_OPT_ADD_DEST}, | ||
98 | + {"add-exclude", 1, 0, ARGS_OPT_ADD_EXCLUDE}, | ||
99 | {"test", 0, 0, ARGS_OPT_NOACTION}, | ||
100 | {"tmp-dir", 1, 0, 't'}, | ||
101 | {"tmp_dir", 1, 0, 't'}, | ||
102 | @@ -200,6 +202,18 @@ args_parse(int argc, char *argv[]) | ||
103 | } | ||
104 | free(tuple); | ||
105 | break; | ||
106 | + case ARGS_OPT_ADD_EXCLUDE: | ||
107 | + tuple = xstrdup(optarg); | ||
108 | + if (!conf->exclude_list) { | ||
109 | + conf->exclude_count = 1; | ||
110 | + conf->exclude_list = xmalloc(sizeof(char *) * conf->exclude_count); | ||
111 | + conf->exclude_list[conf->exclude_count - 1] = tuple; | ||
112 | + } else { | ||
113 | + conf->exclude_count++; | ||
114 | + conf->exclude_list = xrealloc(conf->exclude_list, sizeof(char *) * conf->exclude_count); | ||
115 | + conf->exclude_list[conf->exclude_count - 1] = tuple; | ||
116 | + } | ||
117 | + break; | ||
118 | case ARGS_OPT_NOACTION: | ||
119 | conf->noaction = 1; | ||
120 | break; | ||
121 | @@ -287,6 +301,7 @@ usage() | ||
122 | printf("\t--offline-root <dir> offline installation of packages.\n"); | ||
123 | printf("\t--add-arch <arch>:<prio> Register architecture with given priority\n"); | ||
124 | printf("\t--add-dest <name>:<path> Register destination with given path\n"); | ||
125 | + printf("\t--add-exclude <name> Register package to be excluded from install\n"); | ||
126 | printf("\t--prefer-arch-to-version Use the architecture priority package rather\n"); | ||
127 | printf("\t than the higher version one if more\n"); | ||
128 | printf("\t than one candidate is found.\n"); | ||
129 | -- | ||
130 | 2.1.3 | ||
131 | |||