slack2pup and ppa2pup can't get good package categories
Problem
Pkg cannot get a packages category from the package names, at all!
That is why slack2pup and ppa2pup can't get them!
Solution
Use repo files and /usr/local/petget/categories.dat
to find an appropriate category.
(search through them for matching package names, and if found, grab the category of the package found)
Implementation
Write a get_pkg_cateory()
function, which takes $PKGNAME or $PKGNAME_ONLY as $1
It should search /usr/share/pkg/categories.dat
(stolen from /usr/local/petget/categories.dat) to find the package category.
As a fall back, it should search the repos for exact matches of |$PKGNAME_ONLY|
As a second fall back, it should search the repos for exact matches of ^$PKGNAME|
As a final fallback, it should search the repos for |$PKGFILE|
.
... Also do a get_pkg_descr()
function, that works the same way