Clean up pkg filter text before use. Fixes #12725
Also remove unnecessary echos of the value.
(cherry picked from commit 5d82cce0d615a76b738798577a28a15803e59aeb)
Clean up pkg filter text before use. Fixes #12725
Also remove unnecessary echos of the value.
(cherry picked from commit 5d82cce0d615a76b738798577a28a15803e59aeb)