2024-06-21 15:57:48 +02:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
if [[ $1 == "version" ]]
|
|
|
|
then
|
|
|
|
#apt-cache show $2 | grep Version: | cut -d":" -f2 | head -n1
|
2024-06-24 02:23:06 +02:00
|
|
|
dnf info $2 2> /dev/null | grep Version | cut -d":" -f2 | head -n1
|
2024-06-21 15:57:48 +02:00
|
|
|
elif [[ $1 == "description" ]]
|
|
|
|
then
|
|
|
|
#apt-cache show $2 | grep 'Description*' | cut -d":" -f2 | head -n1
|
2024-06-24 02:23:06 +02:00
|
|
|
dnf info $2 2> /dev/null | sed -n '/Description/,/^$/p' | awk 'NR==1,/^$/ {if (/^$/ && printed) exit; if (NF) printed=1; if (NR==1) sub(/Description *: */, ""); else sub(/^ *: */, ""); print}'
|
2024-06-21 15:57:48 +02:00
|
|
|
fi
|