Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Feb 2016 23:50:32 +0100
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        Tomasz Sowa <tomek@ttmath.org>
Cc:        freebsd-pkg@freebsd.org
Subject:   Re: pkg force to add a package
Message-ID:  <20160210225031.GJ1141@ivaldir.etoilebsd.net>
In-Reply-To: <56BB7371.8070400@ttmath.org>
References:  <56BB7371.8070400@ttmath.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--ed/6oDxOLijJh8b0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Feb 10, 2016 at 06:29:21PM +0100, Tomasz Sowa wrote:
> Hi
>=20
> Some questions about pkg. On one computer I have recompiled my ports,
> next I wanted to copy them to another machine so I created packages
> (for simplicity I'm showing only one package):
> /home/tomek# pkg create -f tar nettle-3.2
> Creating package for nettle-3.2
> It created nettle-3.2.tar package.
>=20
> On the other machine I have nettle installed but it was in an old
> version:
> [second_machine]/home/tomek# pkg info | grep nettle
> nettle-2.7.1                   Low-level cryptographic library
>=20
> Let we see some files from the package:
> [second_machine]/home/tomek# pkg info -l nettle-2.7.1 | grep lib | head -=
n 4
>         /usr/local/lib/libhogweed.a
>         /usr/local/lib/libhogweed.so
>         /usr/local/lib/libhogweed.so.2
>         /usr/local/lib/libhogweed.so.2.5
>=20
> Make sure those files belong to the nettle package:
> [second_machine]/home/tomek# pkg which /usr/local/lib/libhogweed.so.2 /us=
r/local/lib/libhogweed.so.2.5
> /usr/local/lib/libhogweed.so.2 was installed by package nettle-2.7.1
> /usr/local/lib/libhogweed.so.2.5 was installed by package nettle-2.7.1
>=20
> Now I move the new nettle-3.2 to this machine and try to
> `pkg add` it:
> [second_machine]/home/tomek# pkg add nettle-3.2.tar=20
> [second_machine] Installing nettle-3.2...
> the most recent version of nettle-2.7.1 is already installed
>=20
> It reports me that I have the newest version installed, where the
> information (version) is taken from? is it normal behavior?
>=20
> So I have forced the installation:
> [second_machine]/home/tomek# pkg add -f nettle-3.2.tar
> [second_machine] Installing nettle-3.2...
> package nettle is already installed, forced install
> [second_machine] Extracting nettle-3.2: 100%
>=20
> Make sure it is really installed:
> [second_machine]/home/tomek# pkg info | grep nettle
> nettle-3.2                     Low-level cryptographic library
>=20
> But what about the old files from nettle 2.7.1?
> [second_machine]/home/tomek# ll /usr/local/lib/libhogweed.so.2 /usr/local=
/lib/libhogweed.so.2.5
> lrwxr-xr-x  1 root  wheel      17  2 lip  2015 /usr/local/lib/libhogweed.=
so.2@ -> libhogweed.so.2.5
> -rw-r--r--  1 root  wheel  419229  2 lip  2015 /usr/local/lib/libhogweed.=
so.2.5
>=20
> There are still there, may they belongs to some other package now?
> [second_machine]/home/tomek# pkg which /usr/local/lib/libhogweed.so.2 /us=
r/local/lib/libhogweed.so.2.5
> /usr/local/lib/libhogweed.so.2 was not found in the database
> /usr/local/lib/libhogweed.so.2.5 was not found in the database
>=20
> No, they are orphans. And next question is: is it correct behavior?
> I would expect that either `pkg info | grep nettle` reports both:
> nettle-2.7.1                   Low-level cryptographic library
> nettle-3.2                     Low-level cryptographic library
> or if only nettle-3.2 is installed those files from 2.7.1
> are uninstalled. Correct me if am wrong pls.
>=20

Beside the error message being wrong, the issue is the fact you do use pkg =
add
(which is not supposed to be used in that case)

pkg add is a basic tool supposed to mimic the old pkg_add for the ports tree
usage (I don't know how to properly warn users about it) or for special oth=
er
cases.

What you were looking for was pkg install ./nettle-3.2.tar which will repla=
ce
the old nettle already installed.

and of course the error message from pkg add is mis leading and should be f=
ixed.

Best regards,
Bapt

--ed/6oDxOLijJh8b0
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJWu763AAoJEGOJi9zxtz5aS+8QANLlDTAFQt35wBKojzzw0b0J
mOj7e0pLNro4kedG7mvFfERyBd4lqBvUpv3DCBeq+XRWEXGE+zBRhM6+Aj3RZfFQ
T2UnxSRWdbpgRx3zkpOLB97D21UyDv/I1Kc5gaGuTF7Z6/B6aEsMwuld7FVf7KIo
tLHUlJX3V11PV5Lxa6zUNPjNh/BP5SwOtIZBoUQKf+Hd1g/iy9V8nu7000Tc/kkz
fCqDwEyUGQqmT6njldW/9z7b3a6kp9ogcbv1MZkI5lY5MulZv01wcwlD1HUTO2uN
3muwKEN6SspZ3oGJKeyH0Ioa3F56G/QuEEu1WfzNIMMDDrhGh/eSZuXFWQUqb8Tw
wmkO05Vsr5hKownSM1lJ9N6yZz33BYkBG38axgCDuF5Wb8su6Z5x6f9aFACnCU4c
9JVGR1t1i03o631SK6lxOPwZy1TiUt78wrALpQsSMYNfaZ8ffkdiPtUivDYSMzX7
YjCR7bpM/kIrTVydFazFjLroCPrYqFa0RqHEK1Cjuje2lbwxyYb62Ppf0zTsI0R3
nnqtVAl6LUhaely7CePEedbabQKNaViSAv04ezgShs+REYnBl51nxfy3/MCvfiaZ
OCfUkGtIaMKH8iahlVXZqLxur7gWpMGbvLZtopO3jx61JMcxI2s6ArYOfCQ3GZen
hSV8rVbv0WqSy0AyHZCH
=du/G
-----END PGP SIGNATURE-----

--ed/6oDxOLijJh8b0--



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