From owner-freebsd-ports@freebsd.org Wed May 22 13:07:18 2019 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8271315ABBD3 for ; Wed, 22 May 2019 13:07:18 +0000 (UTC) (envelope-from list1@gjunka.com) Received: from msa1.earth.yoonka.com (yoonka.com [88.98.225.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "msa1.earth.yoonka.com", Issuer "msa1.earth.yoonka.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A22C984CA6 for ; Wed, 22 May 2019 13:07:17 +0000 (UTC) (envelope-from list1@gjunka.com) Received: from [10.70.7.24] ([10.70.7.24]) (authenticated bits=0) by msa1.earth.yoonka.com (8.15.2/8.15.2) with ESMTPSA id x4MD7G5a093368 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 22 May 2019 13:07:16 GMT (envelope-from list1@gjunka.com) To: freebsd-ports@freebsd.org From: Grzegorz Junka Subject: pkg query hackaton Message-ID: <460996e2-03ad-f044-9783-758a9b0b36d3@gjunka.com> Date: Wed, 22 May 2019 14:07:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB X-Rspamd-Queue-Id: A22C984CA6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of list1@gjunka.com designates 88.98.225.149 as permitted sender) smtp.mailfrom=list1@gjunka.com X-Spamd-Result: default: False [-6.80 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:88.98.225.149]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ports@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; DMARC_NA(0.00)[gjunka.com]; MX_GOOD(-0.01)[cached: gjunka.com]; NEURAL_HAM_SHORT(-0.85)[-0.849,0]; IP_SCORE(-3.64)[ip: (-9.53), ipnet: 88.98.192.0/18(-4.77), asn: 56478(-3.81), country: GB(-0.09)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:56478, ipnet:88.98.192.0/18, country:GB]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 13:07:18 -0000 Hi, I am interested in two pkg query solutions and I thought I will ask here first, maybe someone already spend time or knows a better approach. 1. List of packages sorted by the amount of packages that depend on them 2. List of all recursive dependencies of a particular package Ad1. Basically, it would be a list of all packages installed in the system where for each package the query would retrieve the amount of dependent packages. Then sort that list. Bonus. Can 1. be also recursively, e.g. sum amounts of all dependent packages, then for each dependent package add that package's dependent packages, etc. This will likely cause loops so probably a state with packages already added would need to be maintained. Ad2. Given package A list all its direct dependencies, then for each dependency list its dependencies, and so on. Add them to a big list then sort and unique. Can that be done in pkg query alone? Out of interest, is "pkg install -R" truly recursive, i.e. would it reinstall any packages that require the given package indirectly (through another package, not through a direct dependency)? GrzegorzJ