New devel script extract_pkg_ids

Based on recipe from @goxberry in #2526
Merge pull request #2536 from rolandwalker/dev_get_pkg_ids

New devel script extract_pkg_ids