Tiny Core Linux

Tiny Core Extensions => TCE Bugs => Topic started by: polikuo on March 27, 2017, 07:51:32 AM

Title: Wrong list file format causes incorrect behavior with provides.sh
Post by: polikuo on March 27, 2017, 07:51:32 AM
Some *.tcz.list files on the server do not follow the standard format.
Resulting unwanted behavior with provides.sh

For people who's unfamiliar with provides.sh:
provides.sh updates provides.db and then search the content with awk.
Let's take a look at what's inside the database.
Code: [Select]
tc@box:/mnt/sda1/tce$ head provides.db
8086tiny.tcz
usr/local/share/licences/8086tiny/license.txt
usr/local/share/8086tiny/8086tiny.tar.gz
usr/local/bin/8086tiny
usr/local/tce.installed/8086tiny

915resolution.tcz
usr/local/sbin/915resolution
usr/local/tce.installed/915resolution

As you can see, the correct format should be:
Quote
extension1.tcz
path/to/file

extension2.tcz
path/to/file

It seems sometimes people who make an extension would create the list by
Code: [Select]
unsquashfs -l extension.tcz
For example: 7.x/x86/tcz/sed.tcz.list
Quote
Parallel unsquashfs: Using 4 processors
1 inodes (11 blocks) to write

squashfs-root
squashfs-root/usr
squashfs-root/usr/local
squashfs-root/usr/local/bin
squashfs-root/usr/local/bin/sed

The thing is, if I want to see which extension contains "sed"
I would use the GUI app browser or do provides.sh usr\\/local\\/bin\\/sed
Guess what I have get ?
Quote
tc@box:~$ provides.sh usr\\/local\\/bin\\/sed
squashfs-root
That's not what I want, "squashfs-root" is not even an extension.

***Solutions***
To get a catalog of incorrectly-listed extensions.
Code: [Select]
awk 'BEGIN {FS="\n";RS=""} /Parallel unsquashfs: /{print $1}' provides.db > /tmp/catalog
Recreate *.tcz.list files.
Code: [Select]
mkdir -p pkg
sudo mount extension.tcz pkg
find pkg -not -type d | sort -u | sed 's~^pkg/~~g' > extension.tcz.list
sudo umount pkg
Title: Re: Wrong list file format causes incorrect behavior with provides.sh
Post by: Juanito on March 27, 2017, 10:31:57 AM
The squashfs things is not intentional - they must have been left in by mistake - I'm away for a week, but I'll try to remember to fix the list files when I get back.
Title: Re: Wrong list file format causes incorrect behavior with provides.sh
Post by: Juanito on April 05, 2017, 10:20:26 PM
the list files should be fixed now
Title: Re: Wrong list file format causes incorrect behavior with provides.sh
Post by: polikuo on April 05, 2017, 11:44:52 PM
Just check it.
Looks good !  :)
Care to fix the issue with PiCore as well ?
There are 2 packages need to be fixed.
Code: [Select]
$ awk 'BEGIN {FS="\n";RS=""} /Parallel unsquashfs: /{print $1}' provides.db
firmware-rpi3-bt.tcz
gtkfind.tcz
Many thanks.  :D
Title: Re: Wrong list file format causes incorrect behavior with provides.sh
Post by: Juanito on April 06, 2017, 01:38:00 AM
done