Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Oct 2013 12:26:44 +0300
From:      Kimmo Paasiala <kpaasial@gmail.com>
To:        "bw.mail.lists" <bw.mail.lists@gmail.com>
Cc:        freebsd-pkg@freebsd.org
Subject:   Re: pkgng install/upgrade and puppet or similar
Message-ID:  <CA%2B7WWSdrVor-0yAd=4heP%2BZ54=M8=n8g=Z55pQbUhpzM%2BHn6rA@mail.gmail.com>
In-Reply-To: <524D3525.4000201@gmail.com>
References:  <524D3525.4000201@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Oct 3, 2013 at 12:13 PM, bw.mail.lists <bw.mail.lists@gmail.com> wrote:
> The fact that pkg first upgrades itself then exits successfully when trying
> to install a package is unexpected behavior and can trip quite a few things.
>
> Case in point.
>
> I have a manifest that installs postfix, stops sendmail, then installs
> mailer.conf and main.cf in /usr/local/etc/postfix. Quite standard stuff.
> However, if there is an upgrade to pkg what will happen is puppet will run
> 'pkg install -y postfix' which will in fact upgrade pkg and exit
> successfully, while postfix is not actually installed. Next the manifest
> will stop sendmail and change mailer.conf to point to postfix, because it
> thinks it was installed successfully, then try to install main.cf in a
> nonexistent directory, which fails. This leaves the system with no MTA
> running, since sendmail was stopped but postfix was not installed. Obviously
> not good, even if postfix will (probably!) get installed the next time
> puppet runs.
>
> I see two obvious choices, either
> - exit with an error if pkg didn't execute what was actually requested,
> because I asked for postfix to be installed, not pkg to be upgraded
> or
> - let pkg upgrade itself then execute what was actually requested and return
> the error code of the second operation, assuming it got to it. If pkg
> insists on upgrading itself IMHO this would be the better way.
>
> I hope I didn't miss it, but I didn't see any argument that can be passed to
> pkg to make it ignore the upgrade in the man page.
> _______________________________________________


How about a new subcommand 'pkg selfupgrade'? This would be the only
way to upgrade pkg itself, the 'pkg upgrade' would then notify the
user to use 'pkg selfupgrade' in case pkg was out of date but wouldn't
actually perform the upgrade.

-Kimmo



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B7WWSdrVor-0yAd=4heP%2BZ54=M8=n8g=Z55pQbUhpzM%2BHn6rA>