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