tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg_add(8). Bug in handling the flag "automatic"?

Aleksey Cheusov <> writes:

> According to the documentation pkg_add(8) should remove flag "automatic"
> if the package already has it and -A option was not passed to pkg_add.
>      -A      Mark package as installed automatically, as dependency of another
>              package.  You can use
>                    pkg_admin set automatic=YES
>              to mark packages this way after installation, and
>                    pkg_admin unset automatic
>              to remove the mark.  If you pkg_add a package without specifying
>              -A after it had already been automatically installed, the mark is
>              removed.
> Reality is the following
>    asrock# pkg_info -Q automatic autoconf213
>    yes
>    asrock# pkg_add -UD /srv/pkgsrc_bin/NetBSD/x86_64/cache/All/autoconf213-2.13nb4.tgz
>    pkg_add: Warning: package `autoconf213-2.13nb4' was built for a platform:
>    pkg_add: NetBSD/x86_64 6.0 (pkg) vs. NetBSD/x86_64 6.1_STABLE (this host)
>    autoconf213-2.13nb4: unregistering info file /usr/pkg/info/
>    autoconf213-2.13nb4: registering info file /usr/pkg/info/
>    asrock# pkg_info -Q automatic autoconf213
>    yes
>    asrock#
> As you can see "automatic" is still here.
> Am I doing something wrong?

The docs are off.   "pkg_add -U" is special, for updating a package in
place.   The fact that you want to update a package to a newer version
is not a clue that you want to make it not automatic.  But running
pkg_add without -U on a package that is  installed is such a clue.

pkg_add -U is used by make replace (and thus pkg_rolling-replace), and
it's important that make replace not lose the automatic flag.
Presumably nih does pkg_add -U, and this also isn't mean to the change
the automatic flag.  Similarly to bare pkg_add -U, "update all my
packages" does not contain a hint that packages should be marked

I am pretty sure if you use pkg_add without -U it will do as you expect.

Other than testing the man page (fair enough), what was your intent when
running "pkg_add -UD"?  Did you do that because some tool said it was
out of date?

Attachment: pgptjsmN84Jbe.pgp
Description: PGP signature

Home | Main Index | Thread Index | Old Index