WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to find which extension provides a file  (Read 3055 times)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11657
Re: How to find which extension provides a file
« Reply #60 on: December 02, 2024, 02:59:07 PM »
Hi GNUser
provides.tcz is now available in the TC15 repos for all architectures.
Code: [Select]
Title: provides.tcz
Description: Enhanced version of Tinycore provides.sh.
Version: 0.3
Author: Robert Shingledecker
Original-site: https://github.com/tinycorelinux/Core-scripts/blob/master/usr/bin/provides.sh
Copying-policy: GPLv2
Size: 4.0K
Extension_by: Rich
Tags: find filename extension
Comments: Run  provides.sh  for this help screen:

Version 0.3 Nov 25, 2024

Find extension(s) that provide a filename.
Filenames in list being searched include full paths, for example:
        usr/local/bin/grep

Usage:
   provides.sh [ -nz ] FileName

   -nz    Skip updating (zsync) the provides.db file. This speeds up
          the search, but might miss items if provides.db is outdated.

Examples:
   provides.sh cal           Finds cal anywhere in FileName
   provides.sh bin/cal       Finds bin/cal anywhere in FileName
   provides.sh bin/cal$      Finds FileName that ends in bin/cal
   provides.sh Black Gnome   Finds FileName with embedded spaces

Searches are case sensitive.
The $ sign can only be used at the end of your search term.


-------------------------------------------------------------
Note: The default age of provides.db for checking if an update
is available is 15 minutes.

Environmental variable PROVIDESUPDATE can override this default.
Add  export PROVIDESUPDATE=+N  to .profile file.
log out, log in.

N must be an integer.
Set to -0 to block updates.
Set to +0 for frequent updates.
Set to +N where N is the update interval in minutes.
Ex.  PROVIDESUPDATE=+1440    for 24 hours.

Change-log: 2024/11/25 Original release v0.30
Current: 2024/11/25 Original release v0.30

This is also used by the  Apps  GUI program.

For those running a prior version of Tinycore, download one of
the TC15 versions, they're all the same:
http://tinycorelinux.net/15.x/x86/tcz/provides.tcz

I've tested under TC10 x86 and TC14 x86_64.
It failed under TC9:
    The parameter substitution couldn't handle the / character.
    Busybox ping does not support -A.

I think polikuo did some testing on TC15 aarch64 (piCore).

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1522
Re: How to find which extension provides a file
« Reply #61 on: December 02, 2024, 09:14:01 PM »
Hi Rich. That's great, but your version of provides.sh deserves to be in base system. I hope that's the plan for TCL16.

Online polikuo

  • Hero Member
  • *****
  • Posts: 744
Re: How to find which extension provides a file
« Reply #62 on: December 02, 2024, 09:42:23 PM »
I hope that's the plan for TCL16.
Hi, GNUser.
A bit off topic, but...
Speaking of TCL16, I wish that /usr merge could be implemented as well.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11657
Re: How to find which extension provides a file
« Reply #63 on: December 03, 2024, 01:14:31 AM »
Hi GNUser
I'm hoping it gets incorporated into the base system too.

The extension just seemed like an easy way for users to
upgrade their provides.sh should they wish to.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1522
Re: How to find which extension provides a file
« Reply #64 on: December 03, 2024, 08:17:47 AM »
Hi Rich. provides.sh is on github. May I submit a pull request on your behalf? If it gets accepted, it will make it into TCL16.

Hi polikuo. Yes, I'd love /usr merge in TCL16 (i.e., for /lib to simply be a symlink to /usr/lib. Same for /bin and /sbin). The change would affect only how the base system is organized. Extensions would continue to use /usr/local/lib, /usr/local/bin, and /usr/local/sbin and would be unaffected by the merge.

Curaga is okay with /usr merge but it seems final decision is Juanito's and he hasn't weighed in one way or the other:
https://forum.tinycorelinux.net/index.php/topic,27276.msg175480.html#msg175480

/usr merge would certainly make beautiful TCL even more beautiful. I can live without it but would sure like to have this.
« Last Edit: December 03, 2024, 08:46:17 AM by GNUser »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11657
Re: How to find which extension provides a file
« Reply #65 on: December 03, 2024, 10:08:08 AM »
Hi GNUser
... May I submit a pull request on your behalf? ...
Yes, by all means, please.

Quote
... it seems final decision is Juanito's and he hasn't weighed in one way or the other ...
I thought he did:
I’d prefer to continue using /usr for everything in the base and /usr/local for extensions.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1522
Re: How to find which extension provides a file
« Reply #66 on: December 03, 2024, 10:34:57 AM »
Hi Rich. Pull request has been made: https://github.com/tinycorelinux/Core-scripts/pull/70
Hopefully it will be accepted before TCL16 comes out :)

Quote
... it seems final decision is Juanito's and he hasn't weighed in one way or the other ...
I thought he did:
I’d prefer to continue using /usr for everything in the base and /usr/local for extensions.
Depending on how you read that, Juanito's preference would be best honored by implementing /usr merge.

Current situation: Base uses not only /usr/bin, /usr/lib, and /usr/sbin but also /bin, /lib, and /sbin. /usr/local used for extensions.

/usr merge situation: Base uses /usr for everything. /bin is just a link to /usr/bin, /lib is just a link to /usr/lib, /sbin is just a link to /usr/sbin. /usr/local for extensions.

P.S. Implementing /usr merge is not as radical as it sounds. I did it as a test and it was simple. It involves moving the few things in base that live in /bin into /usr/bin and creating a single symlink (ln -s /usr/bin /bin). Repeat for /lib and /sbin. Done.
« Last Edit: December 03, 2024, 10:50:59 AM by GNUser »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11657
Re: How to find which extension provides a file
« Reply #67 on: December 03, 2024, 11:09:55 AM »
Hi GNUser
Pull request has been made: https://github.com/tinycorelinux/Core-scripts/pull/70 ...
Thank you.

Quote
... Current situation: Base uses not only /usr/bin, /usr/lib, and /usr/sbin but also /bin, /lib, and /sbin. /usr/local used for extensions.

/usr merge situation: Base uses /usr for everything. /bin is just a link to /usr/bin, /lib is just a link to /usr/lib, /sbin is just a link to /usr/sbin. /usr/local for extensions. ...
That reminded me of this:
sbin still has a purpose, root-requiring stuff, so not sure on that one.
Yes, at least sbin has a purpose. Debian/Devuan did not do sbin merge (i.e., kept /usr/sbin as a real directory).

    [Edit]: /usr merge comments continue here https://forum.tinycorelinux.net/index.php/topic,27276.msg176505.html#msg176505
« Last Edit: December 03, 2024, 11:43:31 AM by Rich »