opkg: Convert select-higher-version option to prefer-arch-to-version
This converts the option to maintain the existing behaviour unless the option is specified. We do specify the option during the builds themselves to ensure what the users expects is built. (From OE-Core rev: 0cc479699fe885049625d54c712b500c1b719e75) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
cbddb898c2
commit
34bd4e1743
|
@ -139,7 +139,7 @@ package_install_internal_ipk() {
|
||||||
|
|
||||||
mkdir -p ${target_rootfs}${localstatedir}/lib/opkg/
|
mkdir -p ${target_rootfs}${localstatedir}/lib/opkg/
|
||||||
|
|
||||||
local ipkg_args="-f ${conffile} -o ${target_rootfs} --force-overwrite --force_postinstall"
|
local ipkg_args="-f ${conffile} -o ${target_rootfs} --force-overwrite --force_postinstall --prefer-arch-to-version"
|
||||||
|
|
||||||
opkg-cl ${ipkg_args} update
|
opkg-cl ${ipkg_args} update
|
||||||
|
|
||||||
|
|
|
@ -14,9 +14,9 @@ do_rootfs[recrdeptask] += "do_package_write_ipk"
|
||||||
|
|
||||||
do_rootfs[lockfiles] += "${WORKDIR}/ipk.lock"
|
do_rootfs[lockfiles] += "${WORKDIR}/ipk.lock"
|
||||||
|
|
||||||
IPKG_ARGS = "-f ${IPKGCONF_TARGET} -o ${IMAGE_ROOTFS} --force-overwrite"
|
IPKG_ARGS = "-f ${IPKGCONF_TARGET} -o ${IMAGE_ROOTFS} --force-overwrite --prefer-arch-to-version"
|
||||||
# The _POST version also works when constructing the matching SDK
|
# The _POST version also works when constructing the matching SDK
|
||||||
IPKG_ARGS_POST = "-f ${IPKGCONF_TARGET} -o $INSTALL_ROOTFS_IPK --force-overwrite"
|
IPKG_ARGS_POST = "-f ${IPKGCONF_TARGET} -o $INSTALL_ROOTFS_IPK --force-overwrite --prefer-arch-to-version"
|
||||||
|
|
||||||
OPKG_PREPROCESS_COMMANDS = "package_update_index_ipk; package_generate_ipkg_conf"
|
OPKG_PREPROCESS_COMMANDS = "package_update_index_ipk; package_generate_ipkg_conf"
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
Add the --select-higher-version option
|
Add the --prefer-arch-to-version option
|
||||||
|
|
||||||
If there were more than one candidate which had the same pkg name in the
|
If there were more than one candidate which had the same pkg name in the
|
||||||
candidate list, for example, the same pkg with different versions, then
|
candidate list, for example, the same pkg with different versions, then
|
||||||
it would use the last one which was the highest version one in the past,
|
it would use the last one which was the highest version one in the past,
|
||||||
but it will use the higher arch priority one now.
|
but it will use the higher arch priority when this option is specified.
|
||||||
|
|
||||||
Add the "--select-higher-version" option to let it use the higher
|
|
||||||
version package when enabled. the default is no.
|
|
||||||
|
|
||||||
Upstream-Status: Pending
|
Upstream-Status: Pending
|
||||||
|
|
||||||
|
@ -24,7 +21,7 @@ diff --git a/libopkg/opkg_conf.h b/libopkg/opkg_conf.h
|
||||||
int force_removal_of_essential_packages;
|
int force_removal_of_essential_packages;
|
||||||
int force_postinstall;
|
int force_postinstall;
|
||||||
int force_remove;
|
int force_remove;
|
||||||
+ int select_higher_version;
|
+ int prefer_arch_to_version;
|
||||||
int check_signature;
|
int check_signature;
|
||||||
int nodeps; /* do not follow dependencies */
|
int nodeps; /* do not follow dependencies */
|
||||||
char *offline_root;
|
char *offline_root;
|
||||||
|
@ -44,7 +41,7 @@ diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c
|
||||||
+ break;
|
+ break;
|
||||||
+ }
|
+ }
|
||||||
+ /* Respect to the arch priorities when given alternatives */
|
+ /* Respect to the arch priorities when given alternatives */
|
||||||
+ if (good_pkg_by_name && !conf->select_higher_version) {
|
+ if (good_pkg_by_name && conf->prefer_arch_to_version) {
|
||||||
+ if (matching->arch_priority >= good_pkg_by_name->arch_priority) {
|
+ if (matching->arch_priority >= good_pkg_by_name->arch_priority) {
|
||||||
+ good_pkg_by_name = matching;
|
+ good_pkg_by_name = matching;
|
||||||
+ opkg_msg(DEBUG, "%s %s wins by priority.\n",
|
+ opkg_msg(DEBUG, "%s %s wins by priority.\n",
|
||||||
|
@ -64,7 +61,7 @@ diff --git a/src/opkg-cl.c b/src/opkg-cl.c
|
||||||
ARGS_OPT_FORCE_SPACE,
|
ARGS_OPT_FORCE_SPACE,
|
||||||
ARGS_OPT_FORCE_POSTINSTALL,
|
ARGS_OPT_FORCE_POSTINSTALL,
|
||||||
ARGS_OPT_FORCE_REMOVE,
|
ARGS_OPT_FORCE_REMOVE,
|
||||||
+ ARGS_OPT_SELECT_HIGHER_VERSION,
|
+ ARGS_OPT_PREFER_ARCH_TO_VERSION,
|
||||||
ARGS_OPT_ADD_ARCH,
|
ARGS_OPT_ADD_ARCH,
|
||||||
ARGS_OPT_ADD_DEST,
|
ARGS_OPT_ADD_DEST,
|
||||||
ARGS_OPT_NOACTION,
|
ARGS_OPT_NOACTION,
|
||||||
|
@ -72,8 +69,8 @@ diff --git a/src/opkg-cl.c b/src/opkg-cl.c
|
||||||
{"force_postinstall", 0, 0, ARGS_OPT_FORCE_POSTINSTALL},
|
{"force_postinstall", 0, 0, ARGS_OPT_FORCE_POSTINSTALL},
|
||||||
{"force-remove", 0, 0, ARGS_OPT_FORCE_REMOVE},
|
{"force-remove", 0, 0, ARGS_OPT_FORCE_REMOVE},
|
||||||
{"force_remove", 0, 0, ARGS_OPT_FORCE_REMOVE},
|
{"force_remove", 0, 0, ARGS_OPT_FORCE_REMOVE},
|
||||||
+ {"select-higher-version", 0, 0, ARGS_OPT_SELECT_HIGHER_VERSION},
|
+ {"prefer-arch-to-version", 0, 0, ARGS_OPT_PREFER_ARCH_TO_VERSION},
|
||||||
+ {"select_higher_version", 0, 0, ARGS_OPT_SELECT_HIGHER_VERSION},
|
+ {"prefer-arch-to-version", 0, 0, ARGS_OPT_PREFER_ARCH_TO_VERSION},
|
||||||
{"noaction", 0, 0, ARGS_OPT_NOACTION},
|
{"noaction", 0, 0, ARGS_OPT_NOACTION},
|
||||||
{"download-only", 0, 0, ARGS_OPT_DOWNLOAD_ONLY},
|
{"download-only", 0, 0, ARGS_OPT_DOWNLOAD_ONLY},
|
||||||
{"nodeps", 0, 0, ARGS_OPT_NODEPS},
|
{"nodeps", 0, 0, ARGS_OPT_NODEPS},
|
||||||
|
@ -81,8 +78,8 @@ diff --git a/src/opkg-cl.c b/src/opkg-cl.c
|
||||||
case ARGS_OPT_FORCE_REMOVE:
|
case ARGS_OPT_FORCE_REMOVE:
|
||||||
conf->force_remove = 1;
|
conf->force_remove = 1;
|
||||||
break;
|
break;
|
||||||
+ case ARGS_OPT_SELECT_HIGHER_VERSION:
|
+ case ARGS_OPT_PREFER_ARCH_TO_VERSION:
|
||||||
+ conf->select_higher_version = 1;
|
+ conf->prefer_arch_to_version = 1;
|
||||||
+ break;
|
+ break;
|
||||||
case ARGS_OPT_NODEPS:
|
case ARGS_OPT_NODEPS:
|
||||||
conf->nodeps = 1;
|
conf->nodeps = 1;
|
||||||
|
@ -91,8 +88,8 @@ diff --git a/src/opkg-cl.c b/src/opkg-cl.c
|
||||||
printf("\t--offline-root <dir> offline installation of packages.\n");
|
printf("\t--offline-root <dir> offline installation of packages.\n");
|
||||||
printf("\t--add-arch <arch>:<prio> Register architecture with given priority\n");
|
printf("\t--add-arch <arch>:<prio> Register architecture with given priority\n");
|
||||||
printf("\t--add-dest <name>:<path> Register destination with given path\n");
|
printf("\t--add-dest <name>:<path> Register destination with given path\n");
|
||||||
+ printf("\t--select-higher-version\t Use the higher version package rather\n");
|
+ printf("\t--prefer-arch-to-version\t Use the architecture priority package rather\n");
|
||||||
+ printf("\t than the higher arch priority one if more\n");
|
+ printf("\t than the higher version one if more\n");
|
||||||
+ printf("\t than one candidate is found.\n");
|
+ printf("\t than one candidate is found.\n");
|
||||||
|
|
||||||
printf("\nForce Options:\n");
|
printf("\nForce Options:\n");
|
||||||
|
|
|
@ -19,4 +19,4 @@ S = "${WORKDIR}/trunk"
|
||||||
SRCREV = "633"
|
SRCREV = "633"
|
||||||
PV = "0.1.8+svnr${SRCPV}"
|
PV = "0.1.8+svnr${SRCPV}"
|
||||||
|
|
||||||
PR = "${INC_PR}.6"
|
PR = "${INC_PR}.7"
|
||||||
|
|
Loading…
Reference in New Issue