Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 26082

Summary: app-admin/gentoolkit-0.1.30: shorten "sort|uniq" to "sort -u"
Product: Portage Development Reporter: Nicolas Kaiser <nikai>
Component: UnclassifiedAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: trivial CC: mholzer
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: shorten sort|uniq to sort -u
same for /usr/bin/dep-clean
same for /usr/bin/gentool-package-count
same for /usr/bin/revdep-rebuild
again /usr/bin/revdep-rebuild

Description Nicolas Kaiser 2003-08-06 15:05:59 UTC
"sort|uniq" can be shortened to "sort -u"
Patch attached.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Nicolas Kaiser 2003-08-06 15:07:26 UTC
Created attachment 15632 [details, diff]
shorten sort|uniq to sort -u
Comment 2 Nicolas Kaiser 2003-08-06 15:23:03 UTC
Created attachment 15633 [details, diff]
same for /usr/bin/dep-clean

The above was for /usr/bin/qpkg, now I found some more of these.
This is /usr/bin/dep-clean.
Comment 3 Nicolas Kaiser 2003-08-06 15:26:41 UTC
Created attachment 15634 [details, diff]
same for /usr/bin/gentool-package-count
Comment 4 Nicolas Kaiser 2003-08-06 15:30:03 UTC
Created attachment 15635 [details, diff]
same for /usr/bin/revdep-rebuild
Comment 5 Masatomo Nakano (RETIRED) gentoo-dev 2003-08-10 15:48:53 UTC
Is there a reason you want to use -u option?
Comment 6 Nicolas Kaiser 2003-08-10 16:32:09 UTC
"sort -u" is a lot faster. Here's a nice article about it:
http://www.itworld.com/nl/unix_sys_adm/04112001/

Quote:"Large problems or easy optimization makes optimizing a solution sensible. In the case of sort -u, the latter is true (..). If you don't need extra system calls (i.e., to uniq), then avoid it."
Comment 7 Nicolas Kaiser 2003-08-10 17:09:24 UTC
Created attachment 15871 [details, diff]
again /usr/bin/revdep-rebuild

I just see uniq is called twice in a row in rev-dep-rebuild.
One time is enough ;)
Comment 8 Martin Holzer (RETIRED) gentoo-dev 2003-09-30 12:35:13 UTC
qpkg is now patched
Comment 9 Martin Holzer (RETIRED) gentoo-dev 2003-09-30 12:39:20 UTC
revdep-rebuild is patched too
Comment 10 Martin Holzer (RETIRED) gentoo-dev 2003-09-30 12:42:17 UTC
in cvs