Created
August 9, 2025 17:07
-
-
Save izaac/6c97602600a4d5fdd9b39f378136162b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Ensure we have the necessary tools | |
if ! command -v equery &>/dev/null; then | |
echo "Error: app-portage/gentoolkit is not installed." | |
echo "Please run: sudo emerge --ask app-portage/gentoolkit" | |
exit 1 | |
fi | |
declare -a source_pkgs | |
declare -a binary_pkgs | |
echo "Querying Portage database..." | |
for pkg in $(equery list '*'); do | |
size_file="/var/db/pkg/$pkg/SIZE" | |
if [[ -f "$size_file" ]]; then | |
if [[ $(<$size_file) -eq 0 ]]; then | |
binary_pkgs+=("$pkg") | |
else | |
source_pkgs+=("$pkg") | |
fi | |
fi | |
done | |
echo -e "\n--- 📦 Packages Installed from Binary ---" | |
printf '%s\n' "${binary_pkgs[@]}" | |
echo -e "\n--- 📜 Packages Installed from Source ---" | |
printf '%s\n' "${source_pkgs[@]}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment