From owner-freebsd-questions@FreeBSD.ORG Wed Jun 11 12:04:43 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5C391065688 for ; Wed, 11 Jun 2008 12:04:43 +0000 (UTC) (envelope-from fbsd06+WZ=e8b8e417@mlists.homeunix.com) Received: from mxout-03.mxes.net (mxout-03.mxes.net [216.86.168.178]) by mx1.freebsd.org (Postfix) with ESMTP id 98B6C8FC15 for ; Wed, 11 Jun 2008 12:04:43 +0000 (UTC) (envelope-from fbsd06+WZ=e8b8e417@mlists.homeunix.com) Received: from gumby.homeunix.com. (unknown [87.81.140.128]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTP id 34A9E23E4AE for ; Wed, 11 Jun 2008 08:04:41 -0400 (EDT) Date: Wed, 11 Jun 2008 13:04:39 +0100 From: RW To: freebsd-questions@freebsd.org Message-ID: <20080611130439.506cae8f@gumby.homeunix.com.> In-Reply-To: <20080611073108.GA1184@straylight.m.ringlet.net> References: <3b47caa90806102209w5161d96cjdd41d55f0315429c@mail.gmail.com> <20080611054125.GA15965@eos.sc1.parodius.com> <20080611073108.GA1184@straylight.m.ringlet.net> X-Mailer: Claws Mail 3.4.0 (GTK+ 2.12.10; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: how to determine the date a port is installed X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2008 12:04:43 -0000 On Wed, 11 Jun 2008 10:31:08 +0300 Peter Pentchev wrote: > On Tue, Jun 10, 2008 at 10:41:25PM -0700, Jeremy Chadwick wrote: > > On Wed, Jun 11, 2008 at 12:09:33AM -0500, Novembre wrote: > > > Two questions: > > > 1) Is it possible to determine the date a port/package is > > > installed? > > > > ls -ld /var/db/pkg/, use the mtime of the directory. > > > > > 2) How can I delete all the ports/packages installed after a > > > certain date? > > > > Use a combination of find with the -mtime flag, and pkg_delete. > > Not really. This is a bit dangerous. > > The dangerous part is "the mtime of the directory". It would be much > better to use the mtime of the file, since it never changes > *after* the package has been installed. +CONTENTS can change if you use a tool like portmaster or portupgrade If you have portupgrade installed, pkg_glob can list packages installed before a specific date, so presumably pkg_deinstall can delete them directly since it support package globs.