From owner-freebsd-ports@FreeBSD.ORG Thu Aug 30 21:29:19 2012 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A75D10657A8; Thu, 30 Aug 2012 21:29:19 +0000 (UTC) (envelope-from jlaffaye.freebsd@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id E52348FC15; Thu, 30 Aug 2012 21:29:18 +0000 (UTC) Received: by eaak11 with SMTP id k11so737374eaa.13 for ; Thu, 30 Aug 2012 14:29:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=qBJXDugzokHAVJR4mFJeyec/m1a4F9B30H6K1T+RNCA=; b=rK2Mu678tcoY0na4wjRhUP3iYLlFB8Ik2BjNZGgFy4KecWWd7spAxozYlA1bCqL5PN xO8f19EgrQy8s3qsQrfPLxfAsn8Mi3mNJ9Ucb4Zrt0nW2UGqTRKlZaoCTfaJknyb1aho 5z2qGyc/gNeDopfU1CGcPzFbu2e9v1icUGeXC/Gh+T7euw7HS9WzHUK3mT3Qr1vYVkQC 54cjCEXPJS2iOadn2bZgLDd0/HUSXHDGkt3yWk4Mb0R4bVjOZ9kbFbPoV6IY8Vi5gDCs ufdLaysWoK//Fw3B3gAU58TPzGxiYWoauRlkYLVWE25KxuLfo2Xw1xt4BKczP0sNqn1i 8Dpg== Received: by 10.14.178.1 with SMTP id e1mr8157114eem.37.1346362157568; Thu, 30 Aug 2012 14:29:17 -0700 (PDT) Received: from ?IPv6:2001:41d0:fc00:100:506:5772:66c4:e456? ([2001:41d0:fc00:100:506:5772:66c4:e456]) by mx.google.com with ESMTPS id h2sm8116400eeo.3.2012.08.30.14.29.16 (version=SSLv3 cipher=OTHER); Thu, 30 Aug 2012 14:29:16 -0700 (PDT) Sender: Julien Laffaye Message-ID: <503FDB2A.4000609@freebsd.org> Date: Thu, 30 Aug 2012 23:29:14 +0200 From: Julien Laffaye User-Agent: Thunderbird/7.0.1 MIME-Version: 1.0 To: John Nielsen References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "ports@freebsd.org" , "current@freebsd.org" Subject: Re: Script to set/unset "automatic" status in PKGNG database X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 21:29:19 -0000 On 8/30/2012 11:19 PM, John Nielsen wrote: > I today noticed the "pkg autoremove" command for the first time, which does much the same thing as pkg_cutleaves but relies on the "automatic" flag in the pkgng database rather than user input to determine which "leaf" ports can be removed. Unfortunately, the pkg2ng utility has no way of knowing which old-style packages it converts were installed automatically as dependencies, so they are all marked as non-automatic (i.e. user-requested). In my case, this was not true for the majority of installed ports. Since I really like this functionality, I decided to update my local package database to match my preferences. > > Having succeeded, I decided a tool to make doing so easy could well benefit others (as well as my future self). (Plus I wanted an excuse to play with dialog(1) and "pkg query" a bit.) So here's the result. I'm not too attached to the name. It shouldn't eat your package database or steal your lunch money, but I'm not responsible if it does. Other than that, feedback is welcome. > > > JN > You want to use `pkg set -A` :) We make zero promises concerning the SQL schema in pkgng so it can change at every time and break your script.