From: Justin <justin@j-schmitz.net>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] fast CLI package-Changelog viewer
Date: Mon, 31 Mar 2008 13:40:30 +0200 [thread overview]
Message-ID: <47F0CDAE.9000407@j-schmitz.net> (raw)
In-Reply-To: <200803311535.27046@goldspace.net>
[-- Attachment #1: Type: text/plain, Size: 1805 bytes --]
Andrew Gaydenko schrieb:
> ======= On Monday 31 March 2008, Etaoin Shrdlu wrote: =======
>
>> On Monday 31 March 2008, 11:31, Andrew Gaydenko wrote:
>>
>>> I agree, my English is ugly. I'll try to explain. Saying "viewer" I
>>> mean something like this:
>>>
>>> logviewer kdelibs
>>>
>>> will "produce" the same output as, say,
>>>
>>> less /usr/portage/kde-base/kdelibs/ChangeLog
>>>
>>> You see, it is impossible to remember all packages' dirs. Of
>>> course, I can use 'q' or 'eix' to find a dir and then type in a
>>> long 'less ...' command. But, well, why do all these 'eix' and 'q'
>>> exist? I think to save some users' time. Is my intention more clear
>>> now? :-)
>>>
>> Neil will surely provide an adequate answer, however, if your needs
>> aren't too sophisticated, you could put together something like
>>
>> $ cat logviewer.sh
>> #!/bin/bash
>>
>> if [ -z "$1" ]; then
>> echo "Must specify package name!" >&2
>> exit 1
>> fi
>>
>> p=`eix --only-names -e "$1"`
>>
>> if [ -z "$p" ]; then
>> echo "$1: No matches found" >&2
>> exit 1
>> else
>> howmany=`echo "$p" | wc -l`
>> if [ "$howmany" -gt 1 ]; then
>> echo "Many packages with the same name, refine search string:"
>>
>>> &2 echo "$p" >&2
>>>
>> exit 1
>> fi
>> fi
>>
>> c="/usr/portage/${p}/ChangeLog"
>>
>> if [ -z "$EDITOR" ]; then
>> EDITOR=`which vi`
>> fi
>>
>> "$EDITOR" "$c"
>> ---------
>>
>> You can also remove the "-e" from the eix line if you want
>> approximate matching (that will require you to specify the category
>> almost always though).
>> Hope this helps.
>>
>
> Thanks! I definitely must read a bash documentaton :-)
>
I think this will be your friend:
http://tldp.org/LDP/abs/html/
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
prev parent reply other threads:[~2008-03-31 11:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-30 17:26 [gentoo-user] fast CLI package-Changelog viewer Andrew Gaydenko
2008-03-30 20:10 ` Neil Bothwick
2008-03-31 3:16 ` Andrew Gaydenko
2008-03-31 8:07 ` Neil Bothwick
2008-03-31 8:17 ` Andrew Gaydenko
2008-03-31 9:17 ` Neil Bothwick
2008-03-31 9:31 ` Andrew Gaydenko
2008-03-31 9:45 ` Neil Bothwick
2008-03-31 10:02 ` Andrew Gaydenko
2008-03-31 10:25 ` Neil Bothwick
2008-03-31 10:22 ` Etaoin Shrdlu
2008-03-31 11:35 ` Andrew Gaydenko
2008-03-31 11:40 ` Justin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47F0CDAE.9000407@j-schmitz.net \
--to=justin@j-schmitz.net \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox