2022-12-14 07:06:55 +01:00
|
|
|
#!/usr/bin/env bash
|
2023-01-27 08:22:33 +01:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2022-01-28 08:24:31 +01:00
|
|
|
# created by Tobias Powalowski <tpowa@archlinux.org>
|
2023-04-23 21:50:36 +02:00
|
|
|
_APPNAME=${0##*/}
|
2023-01-09 18:28:06 +01:00
|
|
|
_usage () {
|
2022-01-28 08:24:31 +01:00
|
|
|
echo "Check on missing binaries in archboot environment"
|
|
|
|
echo "-------------------------------------------------"
|
|
|
|
echo "This will check binaries from package, if they exist"
|
|
|
|
echo "and report missing to binary.txt"
|
2023-04-24 07:02:39 +02:00
|
|
|
echo ""
|
|
|
|
echo "usage: ${_APPNAME} <package>"
|
2022-01-28 08:24:31 +01:00
|
|
|
exit 0
|
|
|
|
}
|
2023-01-09 18:28:06 +01:00
|
|
|
[[ -z "${1}" ]] && _usage
|
2022-01-28 08:24:31 +01:00
|
|
|
if [[ ! "$(cat /etc/hostname)" == "archboot" ]]; then
|
|
|
|
echo "This script should only be run in booted archboot environment. Aborting..."
|
|
|
|
exit 1
|
|
|
|
fi
|
2022-09-07 09:04:10 +02:00
|
|
|
# update pacman db first
|
|
|
|
pacman -Sy
|
|
|
|
if [[ "${1}" == "base" ]]; then
|
2023-01-09 18:28:06 +01:00
|
|
|
_PACKAGE="$(pacman -Qi base | grep Depends | cut -d ":" -f2)"
|
2022-09-07 09:04:10 +02:00
|
|
|
else
|
2023-01-09 18:28:06 +01:00
|
|
|
_PACKAGE="${1}"
|
2022-09-07 09:04:10 +02:00
|
|
|
fi
|
2023-01-09 18:28:06 +01:00
|
|
|
echo "${_PACKAGE}" >binary.txt
|
2022-02-20 10:15:57 +01:00
|
|
|
#shellcheck disable=SC2086
|
2023-01-09 18:28:06 +01:00
|
|
|
for i in $(pacman -Ql ${_PACKAGE} | grep "/usr/bin/..*"$ | cut -d' ' -f2); do
|
2023-01-19 08:12:54 +01:00
|
|
|
command -v "${i}" &>/dev/null || echo "${i}" >>binary.txt
|
2022-01-28 08:24:31 +01:00
|
|
|
done
|
2023-01-27 08:30:21 +01:00
|
|
|
# vim: set ft=sh ts=4 sw=4 et: archboot-bootloader.sh archboot-copy-mountpoint.sh archboot-hwsim.sh archboot-km.sh archboot-mkkeys.sh archboot-quickinst.sh archboot-restore-usbstick.sh archboot-rsync-backup.sh archboot-secureboot-keys.sh archboot-setup.sh archboot-tz.sh archboot-update-installer.sh
|