From owner-freebsd-pkg@FreeBSD.ORG Fri Nov 7 16:18:10 2014 Return-Path: Delivered-To: freebsd-pkg@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87C21523 for ; Fri, 7 Nov 2014 16:18:10 +0000 (UTC) Received: from smtp.infracaninophile.co.uk (smtp6.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3cd3:cd67:fafa:3d78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "ca.infracaninophile.co.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 27537B05 for ; Fri, 7 Nov 2014 16:18:09 +0000 (UTC) Received: from ox-dell39.ox.adestra.com (no-reverse-dns.metronet-uk.com [85.199.232.226] (may be forged)) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.9/8.14.9) with ESMTP id sA7GHvTo067385 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Fri, 7 Nov 2014 16:18:03 GMT (envelope-from matthew@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.9.2 smtp.infracaninophile.co.uk sA7GHvTo067385 Authentication-Results: smtp.infracaninophile.co.uk/sA7GHvTo067385; dkim=none reason="no signature"; dkim-adsp=none; dkim-atps=neutral X-Authentication-Warning: lucid-nonsense.infracaninophile.co.uk: Host no-reverse-dns.metronet-uk.com [85.199.232.226] (may be forged) claimed to be ox-dell39.ox.adestra.com Message-ID: <545CF0AD.9050509@freebsd.org> Date: Fri, 07 Nov 2014 16:17:49 +0000 From: Matthew Seaman User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: freebsd-pkg@freebsd.org Subject: Re: merging pkg databases References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9SENMIOt6uSQP1s6jjLAuSTpisbiN9C4X" X-Virus-Scanned: clamav-milter 0.98.4 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,RDNS_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lucid-nonsense.infracaninophile.co.uk X-BeenThere: freebsd-pkg@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Binary package management and package tools discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 16:18:10 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9SENMIOt6uSQP1s6jjLAuSTpisbiN9C4X Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/07/14 15:14, Sebastian J=C3=A4schke wrote: > For some reason we need to merge pkg(ng) databases together, so that > only the newer packages is in the resulting database, if both merged > databases have packages of the same type. And if two packages in the > databases have even the same version, always the same database is > overwritten. The reason is that we have a ro tree which is handled > differently than the rw pathes including /usr/local. >=20 > It seems to be not possible with the common tools for pkg, so our > company is willing to pay for a solution on this. >=20 > How should be ask whom for this? Is one of the followers of this fine > list a freelancer, willing and able to do this job? Should we ask the > foundation itself? We are quite new on a question like this, so > please advise! When you say 'ro tree' and 'rw tree' are these just chunks of the usual filesystem layout with custom permissions? New filesystem hierarchies you've invented (which implies custom package builds with variant $PREFIX / $LOCALBASE) or else some more complex system using overlays? If it's the first option, and maybe for the other two options, then a fairly quick solution is to dump out the lists of packages you want installed (i.e. the ones not set to autoremove) # pkg query -e '%a =3D 0' '%n-%v' > pkg-list1 Do that for both of your pkg databases, and then merge the two lists, removing any duplicates: # cat pkg-list1 pkg-list2 | sort -u > pkg-list You'll need to check pkg-list manually for any duplicated packages with different versions, and choose which one (usually the most recent) you want installed. Delete any unwanted duplicates from the list. Then on a test box -- just a normally setup FreeBSD machine, with no special permissions settings -- install the edited list of packages: # xargs pkg install < pkg-list Now compare the set of files installed on the test machine with what is on the original machine with the ro and rw filesystems. Delete any packages on the original system not present on the new one, and install any that are missing -- you'll probably want to do some testing at this point to make sure you've got the right functionality still working. The idea is to end up with an identical package load on both systems. Now you should be able to simply copy /var/db/local.sqlite from the test box to your original server. Does that make sense to you? Cheers, Matthew --9SENMIOt6uSQP1s6jjLAuSTpisbiN9C4X Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJUXPC1XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxOUYxNTRFQ0JGMTEyRTUwNTQ0RTNGMzAw MDUxM0YxMEUwQTlFNEU3AAoJEABRPxDgqeTnETgP/j7Bs1M1owqmDNpXTjtjIVG7 yKGeibt8xgZTLbZtGfj5PsERyZPPqPKI3wIgp7RDJacyLVC8otX8hxoXhfJ5Z7Us Y042faW+vqMIIWkT/+9Qneo29wPkcRfVWk5V17eOtp3jlhmZfnPJ/CaFG3QQ5zTi 0SJEYmBSvIk63KNxgAUDCVTz2lEYm9i+QI2wKuQNjA/lTBAQ1XjrbnRYK0fJew/B keZQvsbgDmJbEnrTJbxIi9pglgFJHv0/+MJG4kAbLRNr3/Ktxi2zI5Tj1SGnszio i5QSBismC5Hv07PXs0hiuTJlwm7vqfggDbGU5wuAWt5UHtv3cvvMcAVB2r/5raam dNn+07kBbE+SWOWIUcyGKBLcUGkTFc1hmGW0ve/3IJeIr8/5zWZf+I6y8T093JOQ XNudAs714gcTdHrA8Na8axJ32zO500ZJbPAU9HnPVmAbJ2nY87u3Hr0PY0UQBrSk vAAa7eEjnU/JtSAmzCVIScz/ZDVJVk4B0H1rjchXrsZ630cDZnmL046XPTBV7iBo DkMRjmqAJMlfOH6T79rXy0KuhUSY3sUx3aG7BrhG5J7wew9lK64ycw1zdSgA1SFG S5VHd4HcRAd5v/240QmEG25BWYkPNIsmHaNA318yEbFawoVK0y8sO4Ox+yf2ytnH wQhlf/hCFJYWfsG7lWBv =FPb/ -----END PGP SIGNATURE----- --9SENMIOt6uSQP1s6jjLAuSTpisbiN9C4X--