WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Wrong list file format causes incorrect behavior with provides.sh  (Read 1895 times)

Offline polikuo

  • Hero Member
  • *****
  • Posts: 725
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

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Re: Wrong list file format causes incorrect behavior with provides.sh
« Reply #1 on: March 27, 2017, 01:31:57 PM »
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.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Re: Wrong list file format causes incorrect behavior with provides.sh
« Reply #2 on: April 06, 2017, 01:20:26 AM »
the list files should be fixed now

Offline polikuo

  • Hero Member
  • *****
  • Posts: 725
Re: Wrong list file format causes incorrect behavior with provides.sh
« Reply #3 on: April 06, 2017, 02:44:52 AM »
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

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Re: Wrong list file format causes incorrect behavior with provides.sh
« Reply #4 on: April 06, 2017, 04:38:00 AM »
done