Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Rewrite yayfzf from arch for portage
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
spikyatlinux
n00b
n00b


Joined: 18 Sep 2010
Posts: 38

PostPosted: Mon May 20, 2024 7:24 pm    Post subject: Rewrite yayfzf from arch for portage Reply with quote

Hey,

I´ve one perhaps stupid question.
Is somebody interested in rewriting https://github.com/ConnerWill/yayfzf (yayfzf is an AUR package fzf finder to search, install, remove, and manage packages using yay ) for portage? I´ve tried, but it wasn´t usable.

Best regards
Back to top
View user's profile Send private message
Banana
Moderator
Moderator


Joined: 21 May 2004
Posts: 1711
Location: Germany

PostPosted: Tue May 21, 2024 9:08 am    Post subject: Reply with quote

Additional already existing tools for portage: https://wiki.gentoo.org/wiki/Useful_Portage_tools
_________________
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2380

PostPosted: Tue May 21, 2024 9:37 am    Post subject: Re: Rewrite yayfzf from arch for portage Reply with quote

spikyatlinux wrote:
Hey,

I´ve one perhaps stupid question.
Is somebody interested in rewriting https://github.com/ConnerWill/yayfzf (yayfzf is an AUR package fzf finder to search, install, remove, and manage packages using yay ) for portage? I´ve tried, but it wasn´t usable.

Best regards


What's the specific desired functionality you don't find in Gentoo?

Best Regards,
Georgi
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3683
Location: Rasi, Finland

PostPosted: Tue May 21, 2024 10:23 am    Post subject: --fuzzy-search Reply with quote

At least you can have fuzzy search:
man emerge:
      --fuzzy-search [ y | n ]
              Enable or disable fuzzy search  for  search
              actions.  When  fuzzy  search is enabled, a
              result is returned if  it  is  sufficiently
              similar  to  the search string, without re‐
              quiring an exact match. This option is  en‐
              abled  by  default.  Fuzzy  search does not
              support regular expressions,  therefore  it
              is  automatically  disabled for regular ex‐
              pression searches. Fuzzy search is slightly
              slower than non-fuzzy search.
... but personally I've always used qsearch and when needed the pipe its output to some parser like grep.
BTW ... Is there a fuzzy-grep?
... There was something like it: agrep
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!


Last edited by Zucca on Tue May 21, 2024 10:29 am; edited 1 time in total
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9605
Location: beyond the rim

PostPosted: Tue May 21, 2024 10:25 am    Post subject: Re: Rewrite yayfzf from arch for portage Reply with quote

Doesn't really make sense to rewrite a wrapper script that is specifically crafted for those two package management tools, as most of the actual functionality comes from those.
Back to top
View user's profile Send private message
spikyatlinux
n00b
n00b


Joined: 18 Sep 2010
Posts: 38

PostPosted: Tue May 21, 2024 11:56 am    Post subject: Re: Rewrite yayfzf from arch for portage Reply with quote

logrusx wrote:
spikyatlinux wrote:
Hey,

I´ve one perhaps stupid question.
Is somebody interested in rewriting https://github.com/ConnerWill/yayfzf (yayfzf is an AUR package fzf finder to search, install, remove, and manage packages using yay ) for portage? I´ve tried, but it wasn´t usable.

Best regards


What's the specific desired functionality you don't find in Gentoo?

Best Regards,
Georgi


Nothing special, it would be nice to have it in my i3wm environment .
I thought someone is able to rewrite the yay commands easily :lol:
Thanks for answering, i try it at home tonight. :idea:
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22598

PostPosted: Tue May 21, 2024 2:17 pm    Post subject: Reply with quote

Are you asking for a command you can run on Gentoo that searches the AUR repository or are you asking for a command that searches Gentoo's Portage tree, and provides an interface that a user of yayfzf would find familiar?
Back to top
View user's profile Send private message
spikyatlinux
n00b
n00b


Joined: 18 Sep 2010
Posts: 38

PostPosted: Tue May 21, 2024 3:30 pm    Post subject: Reply with quote

Hey Hu,

no I will use it on my gentoo machine, if I change Line 294

Code:
--preview 'cat <(yay -Si {1}) <(yay -Fl {1} | awk "{print \$2}")' \
to
Code:
--preview 'cat <(eix {1}) <(qlist {1} | awk "{print \$2}")' \

and line
Code:
         yay \
            -Ss "${SearchInput}" \
            --singlelineresults \
            --color "${COLOR_WHEN}" \
            --bottomup 2>/dev/null |
            grep \
to
Code:
         eix \
            --compact "${SearchInput}" \
            --only-names \
            --color "${COLOR_WHEN}" 2>/dev/null |
            grep \
I have usable portage browser with intergrated eix search (I think it´s faster than qsearch), but I want to translate the arch commands to gentoo machine for using it with eix,qsearch,qlist,emaint,emerge or whatever.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2380

PostPosted: Tue May 21, 2024 5:31 pm    Post subject: Reply with quote

spikyatlinux wrote:
but I want to translate the arch commands to gentoo machine for using it with eix,qsearch,qlist,emaint,emerge or whatever.


Sounds like a good fun exercise. One thing you can do is share it or share problematic snippets and ask people to help you with the particular issues you experience.

Best Regards,
Georgi
Back to top
View user's profile Send private message
spikyatlinux
n00b
n00b


Joined: 18 Sep 2010
Posts: 38

PostPosted: Wed May 22, 2024 12:35 pm    Post subject: Reply with quote

I´ve tried to rewrite something, it´s partially working, search via regex ctrl+i to select and ctrl+x to install.
Rewrite yayfzf to pwrfzf (portage wrapper) for naming confusion

Problems are:
- Selected multiple pkgs, ctrl+x only want to install one pkg
- Start at bottom and not first line
- Used sudo (Later will change to doas, or do a root check, I don´t know)

I´ve uploaded code to https://github.com/spikyatlinux/pwrfzf.git, feel free to help
Back to top
View user's profile Send private message
spikyatlinux
n00b
n00b


Joined: 18 Sep 2010
Posts: 38

PostPosted: Sun Aug 04, 2024 3:49 pm    Post subject: Reply with quote

spikyatlinux wrote:
I´ve tried to rewrite something, it´s partially working, search via regex ctrl+i to select and ctrl+x to install.
Rewrite yayfzf to pwrfzf (portage wrapper) for naming confusion

Problems are:
- Selected multiple pkgs, ctrl+x only want to install one pkg
- Start at bottom and not first line
- Used sudo (Later will change to doas, or do a root check, I don´t know)

I´ve uploaded code to https://github.com/spikyatlinux/pwrfzf.git, feel free to help


I´ve rewritten the script, now it works in my case.

- ctrl-i add package to install list
- ctrl-r remove selected package, only highlighted line
- ctrl-w update world (runs emaint sync -a && emerge -1auvDN @world)

It´s not perfect but works.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum