From owner-freebsd-ports@FreeBSD.ORG Thu Feb 6 18:53:18 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 009DEC51 for ; Thu, 6 Feb 2014 18:53:17 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A1AF61886 for ; Thu, 6 Feb 2014 18:53:17 +0000 (UTC) Received: from [192.168.0.100] ([87.139.233.65]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0MA9FV-1W4dWW3cdt-00BMUv for ; Thu, 06 Feb 2014 19:53:10 +0100 Message-ID: <52F3DA15.1050301@gmx.de> Date: Thu, 06 Feb 2014 19:53:09 +0100 From: olli hauer User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: freebsd-ports@freebsd.org Subject: Re: [FreeBSD-Ports-Announce] Time to bid farewell to the old pkg_ tools References: <201402061228.s16CRo02023097@fire.js.berklix.net> <01A7684D-EBAF-4CC2-95DD-0FED284DE878@lpthe.jussieu.fr> In-Reply-To: <01A7684D-EBAF-4CC2-95DD-0FED284DE878@lpthe.jussieu.fr> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:aOAIkf3CI6Fe8Jsr+g9HSHsO3/TcCL5NUl0jI0b//2bvrQNbZ7s jS1c/wqfqG59ASD0AOArG37QKL3USG9fmFSJ+ebLDnPPjTwSnG2/wiBjP2zWE59xdAh1EVk wrSLTkl30ZxXFiFBqFztX9Jygw/FDSs9y3kVZh5+b2NHrn6eZEOUA9ZpPbBIQ9cPb0IjMb/ fQNwATvghBzdeDCrys2mQ== Cc: Michel Talon X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 18:53:18 -0000 On 2014-02-06 19:17, Michel Talon wrote: > > Le 6 févr. 2014 à 13:27, Julian H. Stacey a écrit : > >>> >>> you = >>> have to spend a couple of minutes >>> learning the basic SQL queries, which is no more difficult that learning = >>> obtuse find and grep options. >> >> Package addicts were so myopic they ignored some people won't even >> use packages, just /usr/ports & make. local.sqlite was immaturely >> shoved in without documenting it, no "man 5 local.sqlite" no hook >> there for the "couple of minutes learning" you assert, (no hook to believe >> the "couple" you assert). > > First please excuse me, this message is posted via an Apple mail system. So > how to interact with local.sqlite? > > niobe% sqlite3 local.sqlite > SQLite version 3.8.2 2013-12-06 14:53:30 > Enter ".help" for instructions > Enter SQL statements terminated with a ";" > sqlite> .tables > annotation options pkg_script > categories packages pkg_shlibs > deps pkg_annotation pkg_shlibs_provided > directories pkg_categories pkg_shlibs_required > files pkg_directories pkg_users > groups pkg_groups script > licenses pkg_licenses scripts > mtree pkg_option shlibs > option pkg_option_default users > option_desc pkg_option_desc > > sqlite> .schema packages > CREATE TABLE packages (id INTEGER PRIMARY KEY,origin TEXT UNIQUE NOT NULL,name TEXT NOT NULL,version TEXT NOT NULL,comment TEXT NOT NULL,desc TEXT NOT NULL,mtree_id INTEGER REFERENCES mtree(id) ON DELETE RESTRICT ON UPDATE CASCADE,message TEXT,arch TEXT NOT NULL,maintainer TEXT NOT NULL, www TEXT,prefix TEXT NOT NULL,flatsize INTEGER NOT NULL,automatic INTEGER NOT NULL,locked INTEGER NOT NULL DEFAULT 0,licenselogic INTEGER NOT NULL,time INTEGER, manifestdigest TEXT NULL, pkg_format_version INTEGER); > CREATE INDEX pkg_digest_id ON packages(origin, manifestdigest); > > > sqlite> select name,version from packages limit 10; > pkg|1.2.5 > xproto|7.0.25 > xextproto|7.2.1 > xbitmaps|1.1.1 > renderproto|0.11.1 > libXdmcp|1.1.1 > libXau|1.0.8 > libxml2|2.8.0_3 > libpthread-stubs|0.3_4 > kbproto|1.0.6 > > and to replace grepping > > sqlite> select name,version from packages where name like '%kde%' limit 10; > kdehier4|1.1.1_1 > kde4-wallpapers-freebsd|1.0 > pam_kde|1.0 > kde4-xdg-env|1.0.1 > kde4-icons-oxygen|4.10.5 > kde4-shared-mime-info|1.2 > kdelibs|4.10.5_2 > kde-wallpapers|4.10.5 > kde-base-artwork|4.10.5 > polkit-kde|0.99.1 > > > sqlite> .quit > niobe% > > From this it is easy to experiment, and the full sqlite documentation is at: > > http://www.sqlite.org/lang.html > > > > -- > > Michel Talon > talon@lpthe.jussieu.fr Before someone complains Michel's examples requires sqlite on the system, it even works without this way. $ pkg shell > select name,version from packages limit 10; or $ echo 'select name,version from packages limit 10;' | pkg shell -- olli