Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Dec 2014 12:51:42 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        freebsd-pkg@freebsd.org
Subject:   Re: sqlite error while executing DROP INDEX
Message-ID:  <549813DE.60902@infracaninophile.co.uk>
In-Reply-To: <20141222042618.969CF81A@hub.freebsd.org>
References:  <mailman.88.1418990402.75002.freebsd-pkg@freebsd.org> <20141221194819.94F2FB59@hub.freebsd.org> <20141221233828.GA43454@ivaldir.etoilebsd.net> <20141222042618.969CF81A@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--4SjrHb2HenJEXmMXAx76XciEu5iQOsiSH
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 22/12/2014 04:26, Roger Marquis wrote:
> Matthew Seaman wrote:
>> Something like:
>>   SELECT name, version, package_id FROM deps GROUP BY name, version,
>>   package_id HAVING count(*) > 1 ;
>=20
> That returns:
>=20
>   pkgconf|0.8.7_2|7714
>=20
> Though the server's daily 'pkg info' gave no indication this was multip=
ly
> installed.  Question now is how to remove the package or at least the
> package's (index?) records using 'pkg shell'?

Unlike the old pkg_tools, in principle it is not possible to have
'multiply installed' packages with pkg(8)[*].  In exactly the same way
that it is impossible to have the sort of duplicated dependency you're
seeing here.

You could fix up the apparent problem by deleting all but one of the
duplicated rows in the deps table, but that doesn't explain how the
problem happened in the first place and it gives no guarantee that you
haven't got similar problems elsewhere.

First, check exactly what the duplicated lines contain.  There's an
'origin' field in the deps table, which could be enlightening, and there
could be more than two duplicated rows:

   SELECT * FROM DEPS WHERE name=3D'pkgconf' AND version=3D'0.8.7_2'
       AND package_id=3D'7714';

Given two rows that are exactly the same then:

(untested...)

Hmmm... LIMIT 1 on a DELETE statement requires sqlite be compiled with
the -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT define set, which appears not to
be the case as far as I can see by inspecting the pkg(8) sources.  So
you might have to install sqlite3 from ports with the appropriate flags
and then:

   # sqlite3 /var/db/pkg/local.sqlite

   BEGIN;
   DELETE FROM deps WHERE name=3D'pkgconf' AND version=3D'0.8.7_2'
       AND package_id=3D'7714' LIMIT 1;
   SELECT * FROM DEPS WHERE name=3D'pkgconf' AND version=3D'0.8.7_2'
       AND package_id=3D'7714';

Then if that achieved the desired effect:

   COMMIT;

or else

   ROLLBACK;

	Cheers,

	Matthew

[*] which was more about duplicated records of a package being installed
than the same package being installed twice.

--=20
Dr Matthew J Seaman MA, D.Phil.

PGP: http://www.infracaninophile.co.uk/pgpkey
JID: matthew@infracaninophile.co.uk


--4SjrHb2HenJEXmMXAx76XciEu5iQOsiSH
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.20 (Darwin)

iQJ8BAEBCgBmBQJUmBPfXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NTNBNjhCOTEzQTRFNkNGM0UxRTEzMjZC
QjIzQUY1MThFMUE0MDEzAAoJELsjr1GOGkATbRsQAK0NBz0QcIhTHy4thRf+ihfG
kgmXYMGY/J8rCSIrvLy3UxQwjhG2XLnxk764LbRMHBs1pC2Q/9UHa8Q6C/l9cBJL
GELNdOc8F6akX1YMtelO5SvGmSrnIb3mt1nfpvNG3IWaX3ux4RUGXUO2VOGkeYst
Nu+A0asDLNuVEs+I3d64ZD39P6GTk7/t+cBvOXDGSoXNppg7CADfFqLMCuUHGc1C
urvf3rG9Ixxzd3iAr7sP0pVF94URvbYFQI1IsyqFj0BRUWMmY8X4YAZWyputw45D
y+4ppCgMjQs9q8vTfA1OvB6LeQrlT7yo/Kc/hYJR/KU0dHtmeUmKO0rERL5K6aa2
i95gBFyfiHftmTunDmdrDnu4vTL60ozb3wMq8TQJUPlDQTW3Cef3UGMPbYctwwhj
wXS09mRLc/Xixz+NciKGutzOpfcgU/U+lWYy7y1EOz30DrlNRpYWt2w8akbrOaz4
fYC9YB/eiZs/xijPRYIkIN+Sy2b5eeKNYppedm2LZppx+9KZIejGp+Eu0IRtDgsn
mT0PR6dYNw6upfooccmZ0UxgzzkE2X5CUYbk0BO5uikjZlGy1IsWTC09RqjRD+bc
2TO05euYzQEb1zaU7DIAeW1X98+g3F4IOm6arzQKc/OMJ3UXG31q170fFORPfjV8
QVdC7iv8RBpJ70zi2bK8
=PVte
-----END PGP SIGNATURE-----

--4SjrHb2HenJEXmMXAx76XciEu5iQOsiSH--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?549813DE.60902>