summaryrefslogtreecommitdiff
path: root/.scripts/find_nonexistent_installed_packages.sh
blob: a7f857ed4aa47298eda7cc037f6c0a266d2b6bfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

source "/etc/make.conf"
installed=$(find /var/db/pkg -maxdepth 2 -mindepth 2 -printf "%P\n" | xargs qatom | awk '{print $1 "/" $2}')

for package in ${installed}
do
	for overlay in "/usr/portage/" ${PORTDIR_OVERLAY}
	do
		# as soon as we find a package => got to next package in outer loop
		[[ -d "${overlay}/${package}" ]] && continue 2;
	done
	# this is reached ONLY if the package was NOT found in the tree
	echo "${package}"
done