summaryrefslogtreecommitdiff
path: root/.scripts
diff options
context:
space:
mode:
authorben <benjaminfranzke@gmail.com>2010-01-10 15:55:37 +0100
committerben <benjaminfranzke@gmail.com>2010-01-10 15:55:37 +0100
commit37d505d7d74f54369ddec5bab40b5fa7fc9a0859 (patch)
treea29e9dfb18e547a58a4e3ba9eeda6dcc88a55d51 /.scripts
parent562140dd091796eed00d3e1a87037f34fb27906c (diff)
downloaddotfiles-37d505d7d74f54369ddec5bab40b5fa7fc9a0859.tar.gz
dotfiles-37d505d7d74f54369ddec5bab40b5fa7fc9a0859.tar.bz2
dotfiles-37d505d7d74f54369ddec5bab40b5fa7fc9a0859.zip
optimized finding of nonexistent installed pkgs
Diffstat (limited to '.scripts')
-rw-r--r--.scripts/find_nonexistent_installed_packages.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/.scripts/find_nonexistent_installed_packages.sh b/.scripts/find_nonexistent_installed_packages.sh
index 9baacbf..17fb0e2 100644
--- a/.scripts/find_nonexistent_installed_packages.sh
+++ b/.scripts/find_nonexistent_installed_packages.sh
@@ -5,10 +5,11 @@ installed=$(find /var/db/pkg -maxdepth 2 -mindepth 2 -printf "%P\n" | xargs qato
for package in ${installed}
do
- found=0
for overlay in "/usr/portage/" ${PORTDIR_OVERLAY}
do
- [[ -d "${overlay}/${package}" ]] && found=1
+ # as soon as we find a package => got to next package in outer loop
+ [[ -d "${overlay}/${package}" ]] && continue 2;
done
- [[ "${found}" -eq 0 ]] && echo "${package}"
+ # this is reached ONLY if the package was NOT found
+ echo "${package}"
done