diff options
Diffstat (limited to 'src/toru/toru-info')
-rwxr-xr-x | src/toru/toru-info | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/src/toru/toru-info b/src/toru/toru-info index 31015e4..69799f1 100755 --- a/src/toru/toru-info +++ b/src/toru/toru-info @@ -22,23 +22,27 @@ . "$(librelib messages)" . "$(librelib conf)" -for _pkg in "$@"; do - _pkgbuild="$(toru-where "$_pkg")" +main() { + for _pkg in "$@"; do + _pkgbuild="$(toru-where "$_pkg")" - if [ -f "$_pkgbuild/PKGBUILD" ]; then - if ! load_PKGBUILD "$_pkgbuild/PKGBUILD" 2>/dev/null; then - warning "Errors on %s" "$_pkg" - continue - fi + if [ -f "$_pkgbuild/PKGBUILD" ]; then + if ! load_PKGBUILD "$_pkgbuild/PKGBUILD" 2>/dev/null; then + warning "Errors on %s" "$_pkg" + continue + fi + + deps=("${depends[@]}" "${makedepends[@]}" "${checkdepends[@]}") + repo="$(basename -- "$(dirname -- "$_pkgbuild")")" - deps=("${depends[@]}" "${makedepends[@]}" "${checkdepends[@]}") - repo="$(basename -- "$(dirname -- "$_pkgbuild")")" + msg "%s/%s %s-%s" "$repo" "$_pkg" "$pkgver" "$pkgrel" + msg2 '%s' "$pkgdesc" + msg2 '%s' "$url" + msg2 'Depends: %s' "${deps[*]}" + else + warning "%s doesn't exist" "$_pkg" + fi + done +} - msg "%s/%s %s-%s" "$repo" "$_pkg" "$pkgver" "$pkgrel" - msg2 '%s' "$pkgdesc" - msg2 '%s' "$url" - msg2 'Depends: %s' "${deps[*]}" - else - warning "%s doesn't exist" "$_pkg" - fi -done +main "$@" |