Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Why no ugrep in portage?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
Punchcutter
Guru
Guru


Joined: 11 Feb 2007
Posts: 358

PostPosted: Mon Oct 07, 2024 9:23 pm    Post subject: Why no ugrep in portage? Reply with quote

I've just discovered this very old and powerful utility, seemingly a drop-in replacement for standard grep with a lot more power:

https://ugrep.com/

Normally I would expect something like this to definitely be in the main portage tree. Any idea why it's not?
Is there some reason why this has been explicitly rejected for inclusion in Gentoo? Or is it just an accident
or coincidence that no one has stepped up to put it in and maintain it?
Back to top
View user's profile Send private message
arran4
n00b
n00b


Joined: 19 Sep 2003
Posts: 13
Location: Melbourne, Australia

PostPosted: Mon Oct 07, 2024 10:49 pm    Post subject: Reply with quote

Looks like an older version is in guru:

https://gpo.zugaina.org/sys-apps/ugrep
Back to top
View user's profile Send private message
Chiitoo
Administrator
Administrator


Joined: 28 Feb 2010
Posts: 2730
Location: Here and Away Again

PostPosted: Tue Oct 08, 2024 3:01 am    Post subject: Reply with quote

I can't tell from a quick-ish look if it's the same thing, but there was a bug offering it to be included, but it seems to have somewhat disappeared back when:

https://bugs.gentoo.org/107086
_________________
Kindest of regardses.
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2179

PostPosted: Tue Oct 08, 2024 9:57 am    Post subject: Reply with quote

Depending on the advantages you are after, there's also ripgrep and ripgrep-all packages in Gentoo.
_________________
Greybeard
Back to top
View user's profile Send private message
Punchcutter
Guru
Guru


Joined: 11 Feb 2007
Posts: 358

PostPosted: Thu Oct 10, 2024 10:49 pm    Post subject: Reply with quote

Thanks all... after posting this I discovered ripgrep(-all), and I think that's a better choice for my needs :D
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3442

PostPosted: Thu Oct 10, 2024 10:55 pm    Post subject: Reply with quote

Out of curiosity, how is it better than plain old grep, or what is it better for?
_________________
Make Computing Fun Again
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2179

PostPosted: Fri Oct 11, 2024 8:14 am    Post subject: Reply with quote

I think it's faster, but the main advantage for me is replacement strings and references therein:
Code:
rg 'foo(pattern)bah' -r 'bah-$1-foo' wherever

if I got that right, will output "bah-pattern-foo' for every occurrence of 'foopatternbah' in files below wherever.
_________________
Greybeard
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3442

PostPosted: Fri Oct 11, 2024 9:15 am    Post subject: Reply with quote

I see. Well, I've just been using sed for this kind of more complex operations. Doesn't look much different: sed -n 's/foo\(pattern\)bah/bah-\1-foo/gp'
The whole appeal of grep is that it's a simple shortcut to a very frequently used command... Like: [G]lobally / [R]egular [E]xpression / [P]rint
_________________
Make Computing Fun Again
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2179

PostPosted: Fri Oct 11, 2024 12:43 pm    Post subject: Reply with quote

Ah, but ripgrep does all that grep does, and saves two characters typing, as the command is rg instead of grep.

One difference between rg and grep - rg always searches a directory, so it's the same as "grep -r"
_________________
Greybeard
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software 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