From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1JgIIH-0001RU-7z for garchives@archives.gentoo.org; Mon, 31 Mar 2008 11:35:17 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9F6AAE0528; Mon, 31 Mar 2008 11:35:15 +0000 (UTC) Received: from anli.goldspace.net (anli.goldspace.net [80.246.67.229]) by pigeon.gentoo.org (Postfix) with ESMTP id 62406E0528 for ; Mon, 31 Mar 2008 11:35:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by anli.goldspace.net (Postfix) with ESMTP id 313C15A6E5 for ; Mon, 31 Mar 2008 15:35:27 +0400 (MSD) From: Andrew Gaydenko To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] fast CLI package-Changelog viewer Date: Mon, 31 Mar 2008 15:35:26 +0400 User-Agent: KMail/1.9.9 References: <200803302126.12634@goldspace.net> <200803311331.14308@goldspace.net> <200803311222.56161.shrdlu@unlimitedmail.org> In-Reply-To: <200803311222.56161.shrdlu@unlimitedmail.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200803311535.27046@goldspace.net> X-Archives-Salt: 6d1c8d12-8c78-452c-a63a-90970987e081 X-Archives-Hash: a5037d0355d0be4dfa01bba6a5a9f72c ======= 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 :-) -- gentoo-user@lists.gentoo.org mailing list