From owner-svn-src-head@FreeBSD.ORG Sun Nov 17 17:42:15 2013 Return-Path: Delivered-To: svn-src-head@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 ESMTPS id DE06F60F; Sun, 17 Nov 2013 17:42:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 B3FA129D0; Sun, 17 Nov 2013 17:42:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAHHgFfO094458; Sun, 17 Nov 2013 17:42:15 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAHHgFjN094456; Sun, 17 Nov 2013 17:42:15 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201311171742.rAHHgFjN094456@svn.freebsd.org> From: Devin Teske Date: Sun, 17 Nov 2013 17:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258265 - head/usr.sbin/bsdconfig/share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Nov 2013 17:42:15 -0000 Author: dteske Date: Sun Nov 17 17:42:15 2013 New Revision: 258265 URL: http://svnweb.freebsd.org/changeset/base/258265 Log: Improve debugging with f_eval_catch() introduced by SVN r257784 and also fix a bug where "pkg update" was not getting the value of PACKAGESITE. NB: PACKAGESITE needs to be explicitly exported in support of children. MFC after: 3 days Modified: head/usr.sbin/bsdconfig/share/packages/index.subr head/usr.sbin/bsdconfig/share/packages/packages.subr Modified: head/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/index.subr Sun Nov 17 17:35:51 2013 (r258264) +++ head/usr.sbin/bsdconfig/share/packages/index.subr Sun Nov 17 17:42:15 2013 (r258265) @@ -86,6 +86,7 @@ INDEX_FORMAT="$INDEX_FORMAT|" # disc # f_index_initialize() { + local __funcname=f_index_initialize local __var_to_set="${2:-PACKAGE_INDEX}" [ "$_INDEX_INITTED" ] && return $SUCCESS @@ -117,7 +118,9 @@ f_index_initialize() $DEVICE_TYPE_NFS) __site="file://$MOUNTPOINT" ;; esac - if ! PACKAGESITE="$__site" f_quietly pkg update; then + export PACKAGESITE="$__site" + f_dprintf "PACKAGESITE=[%s]" "$PACKAGESITE" + if ! f_eval_catch $__funcname pkg "pkg update"; then f_show_err "$msg_unable_to_update_pkg_from_selected_media" f_device_shutdown media return $FAILURE Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Sun Nov 17 17:35:51 2013 (r258264) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Sun Nov 17 17:42:15 2013 (r258265) @@ -1013,9 +1013,9 @@ f_package_extract() # Request the package be added via pkg-install(8) if f_debugging; then - pkg -d install -y "$name" + f_eval_catch $funcname pkg 'pkg -d install -y "%s"' "$name" else - f_quietly pkg install -y "$name" + f_eval_catch $funcname pkg 'pkg install -y "%s"' "$name" fi if [ $? -ne $SUCCESS ]; then $alert "$msg_pkg_install_apparently_did_not_like_the_package" \ @@ -1144,9 +1144,9 @@ f_package_delete() # f_show_info "$msg_uninstalling_package_waiting_for_pkg_delete" "$name" if f_debugging; then - pkg -d delete -y "$name" + f_eval_catch $funcname pkg 'pkg -d delete -y "%s"' "$name" else - f_quietly pkg delete -y "$name" + f_eval_catch $funcname pkg 'pkg delete -y "%s"' "$name" fi if [ $? -ne $SUCCESS ]; then f_show_msg "$msg_pkg_delete_failed" "$name"