From owner-freebsd-pkg@FreeBSD.ORG Fri Jul 26 17:47:46 2013 Return-Path: Delivered-To: pkg@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2287444F for ; Fri, 26 Jul 2013 17:47:46 +0000 (UTC) (envelope-from mwlucas@bewilderbeast.blackhelicopters.org) Received: from bewilderbeast.blackhelicopters.org (mwlucas-2-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:b9c::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E75892898 for ; Fri, 26 Jul 2013 17:47:45 +0000 (UTC) Received: from bewilderbeast.blackhelicopters.org (localhost [127.0.0.1]) by bewilderbeast.blackhelicopters.org (8.14.5/8.14.5) with ESMTP id r6QHlhoM037962 for ; Fri, 26 Jul 2013 13:47:44 -0400 (EDT) (envelope-from mwlucas@bewilderbeast.blackhelicopters.org) Received: (from mwlucas@localhost) by bewilderbeast.blackhelicopters.org (8.14.5/8.14.5/Submit) id r6QHlh0D037961 for pkg@freebsd.org; Fri, 26 Jul 2013 13:47:43 -0400 (EDT) (envelope-from mwlucas) Date: Fri, 26 Jul 2013 13:47:43 -0400 From: "Michael W. Lucas" To: pkg@freebsd.org Subject: "pkg upgrade -y" behavior differs in script vs command line Message-ID: <20130726174743.GA37930@bewilderbeast.blackhelicopters.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (bewilderbeast.blackhelicopters.org [127.0.0.1]); Fri, 26 Jul 2013 13:47:44 -0400 (EDT) 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: Fri, 26 Jul 2013 17:47:46 -0000 Hi, I'm testing a 9.2-beta box, and want to deploy pkgng immediately upon installation. I'm writing a script to do this automatically, before any packages get installed. pkg upgrade -y behaves differently in a script versus the command line. Do I need to do something special to make pkg upgrade work in a script? The script and output follow. -- #!/bin/sh FTP_PROXY=blah HTTP_PROXY=blah ftp_proxy=blah http_proxy=blah pkg_add -r pkg echo "WITH_PKGNG=YES" >> /etc/make.conf pkg2ng cp pkg.conf /usr/local/etc/ chown root:wheel /usr/local/etc/pkg.conf echo "" echo "basic pkg config done, now let pkg upgrade itself" pkg upgrade -y pkg upgrade -y echo "pkgng now installed, so installing packages" -- (My setup script has more, but I've stripped the rest out while debugging this one problem.) When I run the script I get: ... basic pkg config done, now let pkg upgrade itself Updating repository catalogue digests.txz 100% 1040KB 1.0MB/s 1.0MB/s 00:00 packagesite.txz 100% 5689KB 1.9MB/s 2.2MB/s 00:03 pkg: Invalid manifest format: mapping values are not allowed in this context Incremental update completed, 0 packages processed: 0 packages updated, 0 removed and 23554 added. pkg: No digest falling back on legacy catalog format packagesite repository catalogue is up-to-date, no need to fetch fresh copy Nothing to do pkg install can't find any packages, even though 23554 should be there. I run the command interactively and get: # pkg upgrade -y Updating repository catalogue digests.txz 100% 1011KB 1.0MB/s 1.0MB/s 00:00 packagesite.txz 100% 5689KB 5.6MB/s 3.3MB/s 00:01 (long pause as pkg eats ~90% of my cpu) Incremental update completed, 0 packages processed: 0 packages updated, 0 removed and 22912 added. New version of pkg detected; it needs to be installed first. After this upgrade it is recommended that you do a full upgrade using: 'pkg upgrade' Uprgades have been requested for the following 1 packages: Reinstalling pkg-1.1.4_1 (needed shared library changed) The upgrade will free 10 kB 1 MB to be downloaded pkg-1.1.4_1.txz 100% 1598KB 1.6MB/s 1.6MB/s 00:01 Checking integrity... done [1/1] Reinstalling pkg-1.1.4_1... done # Do I need to do something special to script pkg commands? Thanks, ==ml -- Michael W. Lucas - mwlucas@michaelwlucas.com, Twitter @mwlauthor http://www.MichaelWLucas.com/, http://blather.MichaelWLucas.com/ Absolute OpenBSD 2/e - http://www.nostarch.com/openbsd2e coupon code "ILUVMICHAEL" gets you 30% off & helps me.