summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/opkg/opkg/add-exclude.patch
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2014-10-16 03:05:19 +0200
committerTudor Florea <tudor.florea@enea.com>2014-10-16 03:05:19 +0200
commitc527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch)
treebb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/recipes-devtools/opkg/opkg/add-exclude.patch
downloadpoky-daisy-140929.tar.gz
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-devtools/opkg/opkg/add-exclude.patch')
-rw-r--r--meta/recipes-devtools/opkg/opkg/add-exclude.patch113
1 files changed, 113 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..8d328d5b86
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/add-exclude.patch
@@ -0,0 +1,113 @@
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>
13Signed-off-by: Jonathan Liu <net147@gmail.com>
14
15Index: trunk/libopkg/opkg_conf.c
16===================================================================
17--- trunk.orig/libopkg/opkg_conf.c
18+++ trunk/libopkg/opkg_conf.c
19@@ -442,6 +442,7 @@ opkg_conf_init(void)
20 pkg_dest_list_init(&conf->pkg_dest_list);
21 pkg_dest_list_init(&conf->tmp_dest_list);
22 nv_pair_list_init(&conf->arch_list);
23+ conf->exclude_list = NULL;
24
25 return 0;
26 }
27Index: trunk/libopkg/opkg_conf.h
28===================================================================
29--- trunk.orig/libopkg/opkg_conf.h
30+++ trunk/libopkg/opkg_conf.h
31@@ -49,6 +49,8 @@ struct opkg_conf
32 pkg_dest_list_t pkg_dest_list;
33 pkg_dest_list_t tmp_dest_list;
34 nv_pair_list_t arch_list;
35+ size_t exclude_count;
36+ char ** exclude_list;
37
38 int restrict_to_default_dest;
39 pkg_dest_t *default_dest;
40Index: trunk/libopkg/pkg_depends.c
41===================================================================
42--- trunk.orig/libopkg/pkg_depends.c
43+++ trunk/libopkg/pkg_depends.c
44@@ -212,6 +212,22 @@ pkg_hash_fetch_unsatisfied_dependencies(
45 continue;
46 }
47
48+ /* Check for excluded packages */
49+ if (satisfying_pkg != NULL && conf->exclude_list) {
50+ int i, exclude = 0;
51+ for (i = 0; i < conf->exclude_count; i++) {
52+ if (!strcmp(satisfying_pkg->name, conf->exclude_list[i])) {
53+ opkg_msg(NOTICE, "%s: exclude required package %s"
54+ "at users request\n",
55+ pkg->name, satisfying_pkg->name);
56+ exclude = 1;
57+ break;
58+ }
59+ }
60+ if (exclude)
61+ continue;
62+ }
63+
64 opkg_msg(DEBUG, "satisfying_pkg=%p\n", satisfying_pkg);
65 if (satisfying_pkg != NULL) {
66 satisfier_entry_pkg = satisfying_pkg;
67Index: trunk/src/opkg-cl.c
68===================================================================
69--- trunk.orig/src/opkg-cl.c
70+++ trunk/src/opkg-cl.c
71@@ -45,6 +45,7 @@ enum {
72 ARGS_OPT_PREFER_ARCH_TO_VERSION,
73 ARGS_OPT_ADD_ARCH,
74 ARGS_OPT_ADD_DEST,
75+ ARGS_OPT_ADD_EXCLUDE,
76 ARGS_OPT_NOACTION,
77 ARGS_OPT_DOWNLOAD_ONLY,
78 ARGS_OPT_NODEPS,
79@@ -95,6 +96,7 @@ static struct option long_options[] = {
80 {"offline-root", 1, 0, 'o'},
81 {"add-arch", 1, 0, ARGS_OPT_ADD_ARCH},
82 {"add-dest", 1, 0, ARGS_OPT_ADD_DEST},
83+ {"add-exclude", 1, 0, ARGS_OPT_ADD_EXCLUDE},
84 {"test", 0, 0, ARGS_OPT_NOACTION},
85 {"tmp-dir", 1, 0, 't'},
86 {"tmp_dir", 1, 0, 't'},
87@@ -198,6 +200,18 @@ args_parse(int argc, char *argv[])
88 }
89 free(tuple);
90 break;
91+ case ARGS_OPT_ADD_EXCLUDE:
92+ tuple = xstrdup(optarg);
93+ if (!conf->exclude_list) {
94+ conf->exclude_count = 1;
95+ conf->exclude_list = malloc(sizeof(char *) * conf->exclude_count);
96+ conf->exclude_list[conf->exclude_count - 1] = tuple;
97+ } else {
98+ conf->exclude_count++;
99+ conf->exclude_list = realloc(conf->exclude_list, sizeof(char *) * conf->exclude_count);
100+ conf->exclude_list[conf->exclude_count - 1] = tuple;
101+ }
102+ break;
103 case ARGS_OPT_NOACTION:
104 conf->noaction = 1;
105 break;
106@@ -282,6 +296,7 @@ usage()
107 printf("\t--offline-root <dir> offline installation of packages.\n");
108 printf("\t--add-arch <arch>:<prio> Register architecture with given priority\n");
109 printf("\t--add-dest <name>:<path> Register destination with given path\n");
110+ printf("\t--add-exclude <name> Register package to be excluded from install\n");
111 printf("\t--prefer-arch-to-version\t Use the architecture priority package rather\n");
112 printf("\t than the higher version one if more\n");
113 printf("\t than one candidate is found.\n");