From owner-svn-src-head@FreeBSD.ORG Fri Jun 14 19:35:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A6F61753; Fri, 14 Jun 2013 19:35:31 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 806571476; Fri, 14 Jun 2013 19:35:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5EJZVn0046601; Fri, 14 Jun 2013 19:35:31 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5EJZUYx046600; Fri, 14 Jun 2013 19:35:30 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201306141935.r5EJZUYx046600@svn.freebsd.org> From: Devin Teske Date: Fri, 14 Jun 2013 19:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251758 - 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.14 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: Fri, 14 Jun 2013 19:35:31 -0000 Author: dteske Date: Fri Jun 14 19:35:30 2013 New Revision: 251758 URL: http://svnweb.freebsd.org/changeset/base/251758 Log: Add skeleton processing of selected packages in the order in which they should be processed. De-select each package as we "process" (actual processing still pending) each package so that if we get an error, we can return to an accurate state of selected packages. Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jun 14 19:26:32 2013 (r251757) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Fri Jun 14 19:35:30 2013 (r251758) @@ -603,18 +603,53 @@ f_package_review() --menu \"\$prompt\" \ $height $width $rows \ $menu_list \ - 2> /dev/null - local retval=$? + 2> /dev/null || return $? + # Return if the user pressed ESC or chose Cancel/No # - # XXX - # - f_show_msg "Coming soon..." + # Process each of the selected packages: + # + First, process dependencies. + # + Second, process packages marked for Install. + # + Third, process packages marked for Re-install. + # + Finally, process packages marked for Uninstall. # + for package in $SELECTED_PACKAGES; do + mark= + f_str2varname "$package" varpkg + f_getvar _mark_$varpkg mark + [ "$mark" = "D" ] || continue + # XXX Install dependency + f_package_deselect "$package" + done + for package in $SELECTED_PACKAGES; do + mark= + f_str2varname "$package" varpkg + f_getvar _mark_$varpkg mark + [ "$mark" = "I" ] || continue + # XXX Install package + f_package_deselect "$package" + done + for package in $SELECTED_PACKAGES; do + mark= + f_str2varname "$package" varpkg + f_getvar _mark_$varpkg mark + [ "$mark" = "R" ] || continue + # XXX Re-install package + f_package_deselect "$package" + done + for package in $SELECTED_PACKAGES; do + mark= + f_str2varname "$package" varpkg + f_getvar _mark_$varpkg mark + [ "$mark" = "U" ] || continue + # XXX Uninstall package + f_package_deselect "$package" + done + # XXX - # + f_show_msg "Coming soon..." - return $retval + return $SUCCESS } # f_package_config