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 1JgGwN-0001US-Ff for garchives@archives.gentoo.org; Mon, 31 Mar 2008 10:08:35 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 45761E04C7; Mon, 31 Mar 2008 10:08:33 +0000 (UTC) Received: from dcnode-01.unlimitedmail.net (unknown [212.85.44.112]) by pigeon.gentoo.org (Postfix) with ESMTP id DEB4BE04C7 for ; Mon, 31 Mar 2008 10:08:32 +0000 (UTC) Received: from ppp.zz ([137.204.208.98]) (authenticated bits=0) by dcnode-01.unlimitedmail.net (8.14.2/8.14.0) with ESMTP id m2VA8IL7017537 for ; Mon, 31 Mar 2008 12:08:19 +0200 From: Etaoin Shrdlu To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] fast CLI package-Changelog viewer Date: Mon, 31 Mar 2008 11:22:56 +0100 User-Agent: KMail/1.9.7 References: <200803302126.12634@goldspace.net> <20080331101712.314b623c@loonquawl.digimed.co.uk> <200803311331.14308@goldspace.net> In-Reply-To: <200803311331.14308@goldspace.net> 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: <200803311222.56161.shrdlu@unlimitedmail.org> X-UnlimitedMail-MailScanner-From: shrdlu@unlimitedmail.org X-Spam-Status: No X-Archives-Salt: 580b0cc9-30ba-4f11-b442-ed81208d8d68 X-Archives-Hash: be08245badfd7c80f114fbb25ab51eef 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. -- gentoo-user@lists.gentoo.org mailing list