No squid packages will start (user 'squid' not found) on 2.1-DEVELOPMENT
-
You can anchor the grep.
"^foo-"
Would match only if the line started with foo
So it may work better with:
grep '^{$pkg}-'
-
I just added a pull request to add the "^" plus a few other extra checks adding/removing symlinks that tidies up the sequence: install squid, install squidGuard, remove squidGuard, remove squid. It resolves all the package install/remove interactions that I can see, particularly those caused by "squid" being a substring of "squidGuard" and "squidGuard" being a mixed-case package name. Hopefully the changes to /etc/inc/pkg-utils.inc will also fixup generic issues for these cases for other packages.
I have tested with the new 22 March 2012 2G nanobsd FreeBSD 8.3-RC2 snapshot.