From 9db0a417a4d8e1fc0cc3bf1835c6a0139d121a15 Mon Sep 17 00:00:00 2001 From: Matteo Rossini Date: Sun, 17 Jan 2016 00:04:58 +0100 Subject: [PATCH] Fixed a regression that drop the PKGS_PRIORITY funcionality --- src/slackpkgplus.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/slackpkgplus.sh b/src/slackpkgplus.sh index 40f7007..c83fa57 100755 --- a/src/slackpkgplus.sh +++ b/src/slackpkgplus.sh @@ -1363,6 +1363,18 @@ if [ "$SLACKPKGPLUS" = "on" ];then NEWINPUTLIST="" PRIORITYLIST="" + # The priorities in PRIORITYLIST_SX : + # * are *all* of kind ".*:" + # * are defined to handle cases where a pattern, with version and/or a build number + # but without any repository, is passed to install|upgrade (ex: install basename-1.0.1) + # + # Since there's no way to distinguish patterns with version/build number to other, priorities + # of kind ".*:" are also generated for patterns without version/build number. As a + # consequence, these priorities could interfer with other defined priorities (1). To prevent + # this, these priorities are handled after all other priorities. + # + PRIORITYLIST_SX="" + for pref in $INPUTLIST ; do PRIORITY_FILTER_RULE="" @@ -1506,7 +1518,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then AUTOPRIORITY=" $AUTOPRIORITY -e $package " if [ "$CMD" == "install" ] || [ "$CMD" == "upgrade" ] ; then - PRIORITYLIST=( ${PRIORITYLIST[*]} ".*:${package}" ) + PRIORITYLIST_SX=( ${PRIORITYLIST_SX[*]} ".*:${package}" ) fi fi @@ -1523,8 +1535,11 @@ if [ "$SLACKPKGPLUS" = "on" ];then INPUTLIST=$NEWINPUTLIST - if [ ! -z "$PRIORITYLIST" ] ; then - NEWPRIORITY=( ${PRIORITYLIST[*]} ${PRIORITY[*]} ) + if [ ! -z "$PRIORITYLIST" ] || [ ! -z "$PRIORITYLIST_SX" ] ; then + # PRIORITYLIST_SX includes priority of kind .*:pattern. This kind of priority must be handled + # after all others, and are, by consequence, added at the end. + # + NEWPRIORITY=( ${PRIORITYLIST[*]} ${PRIORITY[*]} ${PRIORITYLIST_SX[*]} ) unset PRIORITY # -- This is to avoid duplicated priority rules in the variable