redox/scripts/find-recipe.sh

45 lines
968 B
Bash
Raw Normal View History

#!/usr/bin/env bash
2024-08-15 16:54:51 +02:00
# This script show all files installed by a recipe
# Ensure arch and config are set as desired, we use these to find the build dir
2023-06-06 16:20:02 +02:00
export ARCH=$(uname -m)
export CONFIG_NAME=desktop
# Make sure to unmount the image first
make unmount &>/dev/null || true
# Mount the image
make mount >/dev/null
# Find all files
find "build/${ARCH}/${CONFIG_NAME}/" -type f | cut -d / -f5- |\
sort |\
uniq |\
while read path
do
# Skip empty paths
if [ -z "${path}" ]
then
continue
fi
# Find all packages providing this file
pkgs="$(
find cookbook/recipes/*"/target/${ARCH}-unknown-redox/stage/${path}" 2>/dev/null |
cut -d/ -f3 |
tr '\n' ' ' |
sort |
uniq
)"
if [ -n "${pkgs}" ]
then
echo "$path: ${pkgs}"
else
echo "$path: no packages, see config/${ARCH}/${CONFIG_NAME}.toml"
fi
done
# Make sure to unmount the image
make unmount &>/dev/null || true