pika-drivers/data/generate_package_info.sh

27 lines
742 B
Bash
Raw Normal View History

2023-06-30 12:36:00 +02:00
#! /bin/bash
if [[ $1 == "version" ]]
then
2023-06-30 13:50:04 +02:00
apt-cache show $2 | grep Version: | cut -d":" -f2 | head -n1
2023-06-30 12:36:00 +02:00
else
if [[ $1 == "description" ]]
then
2023-06-30 13:50:04 +02:00
apt-cache show $2 | grep 'Description*' | cut -d":" -f2 | head -n1
2023-06-30 12:36:00 +02:00
else
if [[ $1 == "device" ]]
then
if echo "$2" | grep -i -E 'pika-rocm-meta|vulkan-amdgpu-pro|amf-amdgpu-pro|amdvlk|opencl-legacy-amdgpu-pro-icd|amdgpu-pro-oglp' &> /dev/null
then
echo "Device: $(inxi -G | grep -i device | grep -i AMD)"
else
if echo "$2" | grep -i -E 'xone' &> /dev/null
then
echo "Device: $(lsusb | grep -i xbox | cut -d":" -f3)"
else
ubuntu-drivers devices | sed ':a;N;$!ba;s/\nmodel/ /g' | grep vendor | grep -i $2 | sed 's/vendor/Device:/'
fi
fi
fi
fi
fi