Tiny feature request for slapt-mod

New features which should be implemented in Porteus; suggestions are welcome. All questions or problems with testing releases (alpha, beta, or rc) should go in their relevant thread here, rather than the Bug Reports section.
pterid
White ninja
White ninja
Posts: 19
Joined: 01 Feb 2025, 20:13
Distribution: Porteus 5.01 Xfce

Tiny feature request for slapt-mod

Post#1 by pterid » 27 May 2025, 21:32

My puzzle for today...

If you want to search a package with a short name, e.g. the line editor named after a great contributor to this forum, you get a lot of results.

Code: Select all

root@porteus:/home/guest# slapt-mod -s ed | wc -l
1111
root@porteus:/home/guest# 
But if you change line 110 of slapt-mod from:

Code: Select all

        slapt-get --available | grep -i $PKG | awk '{print $1,"",substr($0,index($0,$4))}' 
to:

Code: Select all

        slapt-get --available | grep -i -E "^$PKG" | awk '{print $1,"",substr($0,index($0,$4))}' 
the results list is reduced from 1111 to 10, and the more exacting

Code: Select all

        slapt-get --available | grep -i -E "^$PKG-" | awk '{print $1,"",substr($0,index($0,$4))}' 
gives only the two correct results.

Could this behaviour be introduced as another mode, e.g. -s for contains, -S for exact match?

pterid
White ninja
White ninja
Posts: 19
Joined: 01 Feb 2025, 20:13
Distribution: Porteus 5.01 Xfce

Tiny feature request for slapt-mod

Post#2 by pterid » 28 May 2025, 09:10

My modified slapt-mod with -s|-S feature (including modified help text) is at

https://pastebin.com/LkBa1wt1

(pastebin expiry time: 6 months)

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 4289
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

Tiny feature request for slapt-mod

Post#3 by ncmprhnsbl » 28 May 2025, 22:57

looks good, thanks :) will be included
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

pterid
White ninja
White ninja
Posts: 19
Joined: 01 Feb 2025, 20:13
Distribution: Porteus 5.01 Xfce

Tiny feature request for slapt-mod

Post#4 by pterid » 01 Jun 2025, 23:21

ncmprhnsbl, thank you so much! This is my first technical "contribution" to an open source project, I hope not my last! :D

Post Reply