From owner-freebsd-pkg@FreeBSD.ORG Thu Oct 3 09:13:23 2013 Return-Path: Delivered-To: freebsd-pkg@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9E0DE55B for ; Thu, 3 Oct 2013 09:13:23 +0000 (UTC) (envelope-from bw.mail.lists@gmail.com) Received: from mail-ea0-x22c.google.com (mail-ea0-x22c.google.com [IPv6:2a00:1450:4013:c01::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 393722F95 for ; Thu, 3 Oct 2013 09:13:23 +0000 (UTC) Received: by mail-ea0-f172.google.com with SMTP id r16so951015ead.17 for ; Thu, 03 Oct 2013 02:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=G6WWF5bnI91yRyBEEAkRD7a/G2a2x96iXwQpFjB+4iY=; b=J8M7scIr1+fJD0J8PfrVXJDJKQiJfpFwylbrobBRkn9A0P69uB0Ys4mvDgPP0hIC16 /xCK0Hk8waaABJ+OXAjTKdYTb1yB+UcDFrzQSbhZBvD2b96lG9Kbz0/+cLScHIaDK0Il RHjZsS97prd7Im+YjHTItZ83HnAdM9qezO2vJCnrLaYSHuSrTNuqMvU7v7zIb5rZm7ev 7n7MkgNGiKFY2mvU7ri5PQHxM5aXnkHIOtvXwbun4O8Nl5Zoc+/t8yeu93760u8Qwbt7 T2HGZj7kLEdqNlsELVD4isGlBwuOkE/YRdhIvVfPohhVqNg3ux5InMKtHWZ/VHe6n5AL eEAw== X-Received: by 10.14.241.141 with SMTP id g13mr1358925eer.75.1380791601692; Thu, 03 Oct 2013 02:13:21 -0700 (PDT) Received: from [172.28.23.192] ([87.213.55.5]) by mx.google.com with ESMTPSA id j7sm13319488eeo.15.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Oct 2013 02:13:20 -0700 (PDT) Message-ID: <524D3525.4000201@gmail.com> Date: Thu, 03 Oct 2013 11:13:09 +0200 From: "bw.mail.lists" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: freebsd-pkg@freebsd.org Subject: pkgng install/upgrade and puppet or similar Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-pkg@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 03 Oct 2013 09:13:23 -0000 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.