From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <mbkennedy@austin.rr.com> X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on finch.gentoo.org X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DMARC_NONE, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,WEIRD_PORT autolearn=unavailable autolearn_force=no version=4.0.0 Received: from txsmtp01.texas.rr.com (smtp1.texas.rr.com [24.93.36.229]) by chiba.3jane.net (Postfix) with ESMTP id 3E95BABAFB for <gentoo-dev@gentoo.org>; Fri, 13 Sep 2002 08:44:04 -0500 (CDT) Received: from gentoo.shacknet.nu (cs6625132-244.austin.rr.com [66.25.132.244]) by txsmtp01.texas.rr.com (8.12.5/8.12.2) with ESMTP id g8DDhiZH006420 for <gentoo-dev@gentoo.org>; Fri, 13 Sep 2002 09:43:44 -0400 (EDT) To: gentoo-dev@gentoo.org Subject: Re: [gentoo-dev] [gentoo-user] new package notification References: <2155.12.247.253.40.1027701888.squirrel@sc.am> <87admp24ep.fsf@gentoo.shacknet.nu> <20020913124319.417dab8d.acid.punk@gmx.net> From: Matthew Kennedy <mkennedy@gentoo.org> Date: 13 Sep 2002 08:49:13 -0500 In-Reply-To: <20020913124319.417dab8d.acid.punk@gmx.net> Message-ID: <877khqyp7q.fsf@gentoo.shacknet.nu> User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Informed Management) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: gentoo-dev-admin@gentoo.org Errors-To: gentoo-dev-admin@gentoo.org X-BeenThere: gentoo-dev@gentoo.org X-Mailman-Version: 2.0.6 Precedence: bulk List-Help: <mailto:gentoo-dev-request@gentoo.org?subject=help> List-Post: <mailto:gentoo-dev@gentoo.org> List-Subscribe: <http://lists.gentoo.org/mailman/listinfo/gentoo-dev>, <mailto:gentoo-dev-request@gentoo.org?subject=subscribe> List-Id: Gentoo Linux developer list <gentoo-dev.gentoo.org> List-Unsubscribe: <http://lists.gentoo.org/mailman/listinfo/gentoo-dev>, <mailto:gentoo-dev-request@gentoo.org?subject=unsubscribe> List-Archive: <http://lists.gentoo.org/pipermail/gentoo-dev/> X-Archives-Salt: 776a5659-9a68-41e5-be02-4b3ed6496656 X-Archives-Hash: 9b3bf91fb3f94ae91c1ae4617d256e12 Alexander Futasz <acid.punk@gmx.net> writes: > On 10 Sep 2002 11:30:38 -0500 > Matthew Kennedy <mkennedy@gentoo.org> wrote: > > > #!/bin/bash > > > > history=/tmp/package.history > > > > available_packages() { > > ( qpkg -I -nc && qpkg -U -nc ) |uniq |sort > > } > > > > if [ -f ${history} ] > > then > > available_packages >${history}.new > > diff ${history} ${history}.new > > mv -f ${history}.new ${history} > > else > > echo "First time run. Building history..." > > available_packages >${history} > > fi > > - ( qpkg -I -nc && qpkg -U -nc ) |uniq |sort > + ( qpkg -I -nc && qpkg -U -nc ) |sort |uniq > > $ whatis uniq > uniq (1) - remove duplicate lines from a sorted file > Doh. And here's another improvement: available_packages() { qpkg -U -nc | sort | uniq } (Since you already know about the packages you have installed and thus wouldn't be interested in them) Matt -- Matthew Kennedy Gentoo Linux Developer Bugs go to http://bugs.gentoo.org! Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x6C25B0A2 Finger Print: 0C61 0CBC C669 5F26 8DBF 006D FBAB 30EA 6C25 B0A2