WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [SOLVED] Can I search Apps panel with provides to give me exact hits?  (Read 18747 times)

aus9

  • Guest
Hi

I know I can use Apps panel and pulldown provides and do search.

Lets pretend you knew the exact string to search for, eg launch.h
it appears to offer the hits of rox.launch.html + launch.py from rox-lib2.tcz
---- ----------------------------------launch.html .............................from kde-baseapps.tcz
---------------------------------------dbus-launch............................from dbus.tcz

Now I know we can assume most hits are unlikely as they don't say  name-dev

but as the local village idiot, I will ask

can it be searched for exact hits, if none found then no hit list?

Maybe this is a string search function.

In which case, in the fullness of time, can I use this thread for a feature request for exact string match searching?

cheers

thanks for reading
« Last Edit: March 19, 2013, 04:43:38 PM by aus9 »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11261
Re: Can I search Apps panel with provides to give me exact hits?
« Reply #1 on: March 18, 2013, 10:14:17 PM »
Hi aus9
I think I may have what you are looking for. I've been working on a program that searches through the provides.db
for filenames or extension names. It still needs a lot of work, but it's functional enough for what you want to do.
I've attached three screen shots
appsearch_main.png    Main menu with search boxes filled in, log file menu items are not yet functional
appsearch_edit.png       Edit menu for search boxes
appsearch_view.png     View results, uses  less  to display the results file

While the example is somewhat contrived, it searches for all files containing  vga  and ending with an extension that
begins with  h, such as header files (.h and .hpp). It excludes any files whose extension begins with htm (.htm, .html).
This search was case sensitive, it also does case insensitive searches. If you leave out the trailing * in the Include box,
it only returns .h files. If you wish to try it, PM me an email address and I'll send you a copy, file size is 15K.

aus9

  • Guest
Re: Can I search Apps panel with provides to give me exact hits?
« Reply #2 on: March 18, 2013, 10:59:29 PM »
images look beautiful,  pm sent

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Can I search Apps panel with provides to give me exact hits?
« Reply #3 on: March 19, 2013, 12:00:32 AM »
Looks very interesting, would be nice if it could eventually find its way into the repo :)
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11261
Re: Can I search Apps panel with provides to give me exact hits?
« Reply #4 on: March 19, 2013, 01:14:02 AM »
Hi aus9
Program emailed, let me know how it goes.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11261
Re: Can I search Apps panel with provides to give me exact hits?
« Reply #5 on: March 19, 2013, 01:19:46 AM »
Hi tinypoodle
Quote
would be nice if it could eventually find its way into the repo
That is the eventual plan. Right now it is still a work in progress and I need to reorganize some of the code.

aus9

  • Guest
Re: Can I search Apps panel with provides to give me exact hits?
« Reply #6 on: March 19, 2013, 05:08:40 AM »
Rich

it looks good but my eyesight is struggling with some of the instructions.

1) If I search for "cups" I get only name.tcz results but I had cups-dev loaded....ok lets confirm your images?

2) load kernel and check
Code: [Select]
$ tce-load -i linux-headers-3.0.21-tinycore
/etc/sysconfig/tcedir/optional/linux-headers-3.0.21-tinycore.tcz: OK
tc@box:~$ sudo find /usr -name vga.h
/usr/local/src/linux-headers-3.0.21-tinycore/include/video/vga.h
/usr/local/src/linux-headers-3.0.21-tinycore/include/asm-generic/vga.h
/usr/local/src/linux-headers-3.0.21-tinycore/arch/x86/include/asm/vga.h

ok I should see?



You may notice I was previously  searched for cups-dev file called cups.h

3) And maybe I need a md5 sum for the executable as I read your edit input instructions as meaning
---if I want a exact match....I would choose case sensitive as well....my search term for vga becomes

\vga.h

but pressing enter does not allow me to escape the include field

any clues?

cheers

Gordon

(I must admit its been a bad hair day for me today......I will have to start drinking real beer

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11261
Re: Can I search Apps panel with provides to give me exact hits?
« Reply #7 on: March 19, 2013, 06:50:32 AM »
Hi aus9
Records are the application names, fields are the filenames they contain, press f to search for filenames.
Quote
---if I want a exact match....I would choose case sensitive as well....my search term for vga becomes

\vga.h
The screenshot shows the search mode is currently case sensitive. Press c and the message will change to
 Case insensitive search.
Quote
but pressing enter does not allow me to escape the include field
That's because  \v  is not a legal sequence. The program also put the cursor on the v to show you where the
error is. When you went to edit, the  Menu  box changed to  Edit Help  which reads:
Code: [Select]
Wildcards         ?=Single character  *=Zero or more characters
                  #=Single digit
To search for an actual ?, *, #, or \, precede it with a \
So * means look for zero or more characters where as \* means to look for an actual asterisk.
The example  *vga*.h*  says to match anything that has zero or more characters, followed by  vga, followed by
zero or more characters, followed by a  .h , followed by zero or more characters.
If changed to  *vga#*.h*  it adds the requirement that  vga is immediately followed by a digit.
If changed to  *vga\#*.h*  it changes that requirement that  vga is immediately followed by a pound sign.
Hope this clears things up a bit.

aus9

  • Guest
Re: Can I search Apps panel with provides to give me exact hits?
« Reply #8 on: March 19, 2013, 04:42:19 PM »
DOH....use the f

ok good now I won't show a screenie, your last result over-writes (unless logged) a file called /home/tc/.local/share/appsearch.result

so for people doing compiling, I prefer the below search as I know what its looking for (well I am over-confident of my IQ,  so think I know)

 Fields including "vga.h", excluding "", 1 results
vga.h
   linux-headers-3.0.21-tinycore.tcz
   linux-headers-3.0.3-tinycore.tcz

This is exactly what I want.

Do you wish to modify the resultant tmp.db to allow more fields?
Sometimes I have asked a mod to check tczs have a dependency of XYZ.

AFAIK your app strips the db to tcz-name and file contents

No worries if that is too much

Thanks Rich

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11261
Re: [SOLVED] Can I search Apps panel with provides to give me exact hits?
« Reply #9 on: March 19, 2013, 05:19:36 PM »
Hi aus9
Quote
AFAIK your app strips the db to tcz-name and file contents
Not at all. If you look at the provides.db file, it contains only extension name followed by its file list, then a blank
line, then extension name followed by its file list, then a blank line ....
There is no path information included with the filenames. The only thing I do is after sorting the filenames for each
extension is to strip out the duplicates, which shrinks the file by almost 20%.
Quote
Do you wish to modify the resultant tmp.db to allow more fields?
Sometimes I have asked a mod to check tczs have a dependency of XYZ.
A depends.db file could be constructed by catting all the tree files into one file, leaving at least one blank line
between each file catted into it. This would allow one to search which extensions depend on another extension.

As I said, this is still a work in progress, so the input and output files are currently hard coded while I work on the
rest of the program.

aus9

  • Guest
Re: [SOLVED] Can I search Apps panel with provides to give me exact hits?
« Reply #10 on: March 21, 2013, 05:18:49 PM »
fair enough

Just thought I would drop by and mention I no longer use so many *.h* stuff

eg search term is now enscript*.....search type is f for fields

gives hits and view hits shows the files (fields)
Code: [Select]
Fields including "enscript*", excluding "", 2 results
enscript.desktop
kdelibs-3.5.10.tcz
enscript.xml
kdelibs-3.5.10.tcz

I prefer this option has it sometimes harder for me to see if have typed periods etc,
it produces a larger list if hits will occur but I don't mind that

Naturally I can tune the exclusions if first results is a large list

cheers

LVI (Local Village Idiot)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11261
Re: [SOLVED] Can I search Apps panel with provides to give me exact hits?
« Reply #11 on: April 02, 2013, 11:24:32 PM »
Hi aus9
I have the next cut of appsearch available. Logging is functional, import and loading different databases works.
Config file for setting default directories and default file names. Remembers and loads most recently used
database. Remembers last setting for case sensitivity. Rewrote the search algorithm. Created a dependency
database so you can run a reverse dependency search. If you are interested, I can email you a gzipped tarball
(about 94K) with the program and dependency database.

aus9

  • Guest
Re: [SOLVED] Can I search Apps panel with provides to give me exact hits?
« Reply #12 on: April 03, 2013, 01:58:26 AM »
Rich

Wonderful! loved the last package I am sure I will love the next. It is already better than using the apps panel as my eyesight can get larger fonts in lxterminal.

You have permission to pm me any time to save you asking each build.

Let me know if you would like certain types of feedback on testing it. I only tend to use it for searching for tczs that might contain headers.
But I could also use to search for executables or certain file names.

Happy to test what ever you wish.


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11261
Re: [SOLVED] Can I search Apps panel with provides to give me exact hits?
« Reply #13 on: April 03, 2013, 06:50:49 AM »
Hi aus9
Package sent with brief instructions. Use it the way that suits your needs. The only feedback I need are any problems
you come across, like if a search comes up empty, and you know the item exists, post the name of the database
searched, the search term, and what it should have found. The dependency database included will allow you to
search for an extension, and return a list of all extensions that depend on it.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11261
Re: [SOLVED] Can I search Apps panel with provides to give me exact hits?
« Reply #14 on: April 03, 2013, 05:39:27 PM »
Hi aus9
Resent package. Original got bounced due to email address error on my part.
« Last Edit: April 03, 2013, 05:47:43 PM by Rich »