# HG changeset patch # User Pascal Bellard # Date 1474193549 -7200 # Node ID 1c249bcc2ca0373d82fca407494a8ecb3678737d # Parent ee45db3853041c5d9431d52eb0d56ca620bcb542 get: fix virtual_pkg diff -r ee45db385304 -r 1c249bcc2ca0 modules/get --- a/modules/get Tue Sep 06 17:09:49 2016 +0100 +++ b/modules/get Sun Sep 18 12:12:29 2016 +0200 @@ -288,24 +288,9 @@ # return possible name for a virtual package name -virtual_pkg() { +virtual_name() { # input: $1 virtual package name # $2 repository db directory - # output: display possible package name - - debug "\nvirtual_pkg('$1', '$2')" - - if [ "$tazpkg_command" != 'get-install' ]; then - # 'get' command: download any package - if [ -z "$(awk -F$'\t' -vp="$1" '{if ($1 == p) print p}' "$2/packages.info")" ]; then - # This package not exists in the list, it may be virtual package - grep -hs "^$1=" "$2/packages.equiv" | sed "s/^$1=//" - else - echo $1 - fi - return - fi - local i unset IFS for i in $(grep -hs "^$1=" "$2/packages.equiv" | sed "s/^$1=//"); do @@ -327,6 +312,27 @@ echo $1 } +virtual_pkg() { + # input: $1 virtual package name + # $2 repository db directory + # output: display possible package name + + debug "\nvirtual_pkg('$1', '$2')" + + if [ "$tazpkg_command" != 'get-install' ]; then + # 'get' command: download any package + if [ -z "$(awk -F$'\t' -vp="$1" '{if ($1 == p) print p}' "$2/packages.info")" ]; then + # This package not exists in the list, it may be virtual package + virtual_name "$1" "$2" + else + echo $1 + fi + return + fi + + virtual_name "$1" "$2" +} + # Download package file to the cache