OSDN Git Service

[fix] : Supported remote packages in show command
authorhayao <hayao@fascode.net>
Mon, 29 Mar 2021 14:00:56 +0000 (23:00 +0900)
committerhayao <hayao@fascode.net>
Mon, 29 Mar 2021 14:00:56 +0000 (23:00 +0900)
aptpac

diff --git a/aptpac b/aptpac
index 27e46b7..9c78833 100755 (executable)
--- a/aptpac
+++ b/aptpac
@@ -304,7 +304,15 @@ if [[ "${direct_option}" = false ]]; then
             fi
             ;;
         show)
-            ADD_OPTION "-Qi"
+            if (( "${#PACKAGE[@]}" != 1 )); then
+                _msg_error "Please specify only one package."
+                exit 1
+            fi
+            if pacman -Qq "${PACKAGE[0]}" 2> /dev/null 1>&2; then
+                ADD_OPTION "-Qi"
+            else
+                ADD_OPTION "-Si"
+            fi
             ;;
         *)
             _msg_error "Invalid command '${COMMAND}'"