tazpkg rev 963

modules/install: prefex "exact" packages over than "provided" packages.
In other words when requested "linux-agp": prefer "linux-agp" (if it exists) over the "linux-libre-agp".
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon Feb 26 00:54:19 2018 +0200 (12 months ago)
parents 7ac4ede6e096
children 440f0df6d457
files modules/install
line diff
     1.1 --- a/modules/install	Tue Feb 20 09:56:31 2018 +0100
     1.2 +++ b/modules/install	Mon Feb 26 00:54:19 2018 +0200
     1.3 @@ -186,10 +186,18 @@
     1.4  				# Find local package
     1.5  				if [ -f "$pi" ]; then
     1.6  					# Packages database exists (should be everfresh!)
     1.7 +
     1.8 +					# Find local package
     1.9  					namever=$(awk -F$'\t' -vpkg="$pkg" '{
    1.10 -						# if package name or provided package name matched
    1.11 -						if (index(" " $1 " " $10 " ", " " pkg " ")) { printf("%s-%s", $1, $2); exit; }
    1.12 +						if ($1 == pkg) { printf("%s-%s", $1, $2); exit; }
    1.13  					}' "$pi")		# <namever> = <package_name>-<package_version>
    1.14 +
    1.15 +					# Find local provided package
    1.16 +					[ -n "$namever" ] ||
    1.17 +					namever=$(awk -F$'\t' -vpkg="$pkg" '{
    1.18 +						if (index(" " $10 " ", " " pkg " ")) { printf("%s-%s", $1, $2); exit; }
    1.19 +					}' "$pi")		# <namever> = <package_name>-<package_version>
    1.20 +
    1.21  					# Package file may be in form <namever>.tazpkg or <namever>-<arch>.tazpkg, so find one
    1.22  					[ -n "$namever" ] && pkgfile=$(find "$dir" -name "$namever*.tazpkg")
    1.23  					[ -n "$pkgfile" ] && found='1'