summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/opkg/opkg/0008-select_higher_version.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/opkg/opkg/0008-select_higher_version.patch')
-rw-r--r--meta/recipes-devtools/opkg/opkg/0008-select_higher_version.patch99
1 files changed, 0 insertions, 99 deletions
diff --git a/meta/recipes-devtools/opkg/opkg/0008-select_higher_version.patch b/meta/recipes-devtools/opkg/opkg/0008-select_higher_version.patch
deleted file mode 100644
index a9b039c5a0..0000000000
--- a/meta/recipes-devtools/opkg/opkg/0008-select_higher_version.patch
+++ /dev/null
@@ -1,99 +0,0 @@
1Add the --prefer-arch-to-version option
2
3If there were more than one candidate which had the same pkg name in the
4candidate list, for example, the same pkg with different versions, then
5it would use the last one which was the highest version one in the past,
6but it will use the higher arch priority when this option is specified.
7
8Upstream-Status: Pending
9
10Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
11---
12 libopkg/opkg_conf.h | 1 +
13 libopkg/pkg_hash.c | 18 +++++++++++++++---
14 src/opkg-cl.c | 9 +++++++++
15 3 files changed, 25 insertions(+), 3 deletions(-)
16
17diff --git a/libopkg/opkg_conf.h b/libopkg/opkg_conf.h
18--- a/libopkg/opkg_conf.h
19+++ b/libopkg/opkg_conf.h
20@@ -77,6 +77,7 @@ struct opkg_conf
21 int force_removal_of_essential_packages;
22 int force_postinstall;
23 int force_remove;
24+ int prefer_arch_to_version;
25 int check_signature;
26 int nodeps; /* do not follow dependencies */
27 char *offline_root;
28diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c
29--- a/libopkg/pkg_hash.c
30+++ b/libopkg/pkg_hash.c
31@@ -376,10 +376,22 @@ pkg_hash_fetch_best_installation_candidate(abstract_pkg_t *apkg,
32 if (constraint_fcn(matching, cdata)) {
33 opkg_msg(DEBUG, "Candidate: %s %s.\n",
34 matching->name, matching->version) ;
35- good_pkg_by_name = matching;
36 /* It has been provided by hand, so it is what user want */
37- if (matching->provided_by_hand == 1)
38- break;
39+ if (matching->provided_by_hand == 1) {
40+ good_pkg_by_name = matching;
41+ break;
42+ }
43+ /* Respect to the arch priorities when given alternatives */
44+ if (good_pkg_by_name && conf->prefer_arch_to_version) {
45+ if (matching->arch_priority >= good_pkg_by_name->arch_priority) {
46+ good_pkg_by_name = matching;
47+ opkg_msg(DEBUG, "%s %s wins by priority.\n",
48+ matching->name, matching->version) ;
49+ } else
50+ opkg_msg(DEBUG, "%s %s wins by priority.\n",
51+ good_pkg_by_name->name, good_pkg_by_name->version) ;
52+ } else
53+ good_pkg_by_name = matching;
54 }
55 }
56
57diff --git a/src/opkg-cl.c b/src/opkg-cl.c
58--- a/src/opkg-cl.c
59+++ b/src/opkg-cl.c
60@@ -42,6 +42,7 @@ enum {
61 ARGS_OPT_FORCE_SPACE,
62 ARGS_OPT_FORCE_POSTINSTALL,
63 ARGS_OPT_FORCE_REMOVE,
64+ ARGS_OPT_PREFER_ARCH_TO_VERSION,
65 ARGS_OPT_ADD_ARCH,
66 ARGS_OPT_ADD_DEST,
67 ARGS_OPT_NOACTION,
68@@ -83,6 +84,8 @@ static struct option long_options[] = {
69 {"force_postinstall", 0, 0, ARGS_OPT_FORCE_POSTINSTALL},
70 {"force-remove", 0, 0, ARGS_OPT_FORCE_REMOVE},
71 {"force_remove", 0, 0, ARGS_OPT_FORCE_REMOVE},
72+ {"prefer-arch-to-version", 0, 0, ARGS_OPT_PREFER_ARCH_TO_VERSION},
73+ {"prefer-arch-to-version", 0, 0, ARGS_OPT_PREFER_ARCH_TO_VERSION},
74 {"noaction", 0, 0, ARGS_OPT_NOACTION},
75 {"download-only", 0, 0, ARGS_OPT_DOWNLOAD_ONLY},
76 {"nodeps", 0, 0, ARGS_OPT_NODEPS},
77@@ -173,6 +176,9 @@ args_parse(int argc, char *argv[])
78 case ARGS_OPT_FORCE_REMOVE:
79 conf->force_remove = 1;
80 break;
81+ case ARGS_OPT_PREFER_ARCH_TO_VERSION:
82+ conf->prefer_arch_to_version = 1;
83+ break;
84 case ARGS_OPT_NODEPS:
85 conf->nodeps = 1;
86 break;
87@@ -271,6 +277,9 @@ usage()
88 printf("\t--offline-root <dir> offline installation of packages.\n");
89 printf("\t--add-arch <arch>:<prio> Register architecture with given priority\n");
90 printf("\t--add-dest <name>:<path> Register destination with given path\n");
91+ printf("\t--prefer-arch-to-version\t Use the architecture priority package rather\n");
92+ printf("\t than the higher version one if more\n");
93+ printf("\t than one candidate is found.\n");
94
95 printf("\nForce Options:\n");
96 printf("\t--force-depends Install/remove despite failed dependencies\n");
97--
981.7.1
99