puppylinux-woof-CE / woof-CE

woof - the Puppy builder
GNU General Public License v2.0
397 stars 285 forks source link

debdb2pupdb and find_cat depends on system-wide /usr/local/petget/categories.dat #4290

Closed jamesbond3142 closed 6 months ago

jamesbond3142 commented 6 months ago

debdb2pupdb and find_cat are the two core programs used in 0setup to convert foreign package database format to puppy database format.

It turns out that both debdb2pupdb and find_cat have an unlisted dependency on system-wide /usr/local/petget/categories.dat (as the file itself says):

#130124 format modified to be bash-include compatible.
#130124 loaded at runtime by 'debdb2pupdb.bac' and 'find_cat.bac' in Woof.

But system-wide /usr/local/petget/categories.dat only exists in Puppy Linux. It doesn't exist in other distros. Hence, running debdb2pupdb and find_cat will fail. In other words, running 0setup will fail, without any clear error message. Instead, it will only say:

FATAL: failed find to find $pkgname

which is very misleading. The cause of this "FATAL" message is because the converted pup package database is empty, thanks to debdb2pupdb and find_cat failing silently.

This dependency on /usr/local/petget/categories.dat is not necessary, because woof-CE itself carries this file in ./woof-code/rootfs-skeleton/usr/local/petget/categories.dat.

My suggestion is to modify merge2out to copy ./woof-code/rootfs-skeleton/usr/local/petget/categories.dat and put it to 'woof-out' directory, and to modify find_cat, debdb2pupdb (and possible other package database converter that depends on categories.dat, so far I've only tested debdb2pupdb) to use the ./categories.dat inside woof-out instead of reaching out to system-wide /usr/local/petget/categories.dat.

If this is done, then 0setup will run on any reasonable Linux distro. This will be the first step to enable building Puppies on mainstream distros. I'd be happy to submit a PR but I can't see the source for find_cat and debdb2pupdb.

dimkr commented 6 months ago

I'd be happy to submit a PR but I can't see the source for find_cat and debdb2pupdb.

https://github.com/puppylinux-woof-CE/initrd_progs/blob/21e34016d252e40524a23639ba44c6b72cbde09a/pkg/w_apps_static/w_apps/debdb2pupdb.c https://github.com/puppylinux-woof-CE/initrd_progs/blob/21e34016d252e40524a23639ba44c6b72cbde09a/pkg/w_apps_static/w_apps/find_cat.c

jamesbond3142 commented 6 months ago

Thanks. Ah, so you want me to apply the patches there, or build the binaries and apply it here?

dimkr commented 6 months ago

I don't want you to do anything, I no longer use those 😸

I guess it's up to @peabee

jamesbond3142 commented 6 months ago

LOL all right. I'll open a PR for both source and binary. I can't do the ARM binary though, so I'll let it pass. I don't know anyone who still builds the ARM platform anyway.