From owner-svn-src-head@freebsd.org Thu Aug 10 12:30:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7854DD14E0; Thu, 10 Aug 2017 12:30:35 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 857D082172; Thu, 10 Aug 2017 12:30:35 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7ACUYuv079720; Thu, 10 Aug 2017 12:30:34 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7ACUYla079719; Thu, 10 Aug 2017 12:30:34 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201708101230.v7ACUYla079719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 10 Aug 2017 12:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322352 - head/release/packages X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/packages X-SVN-Commit-Revision: 322352 X-SVN-Commit-Repository: base 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.23 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: Thu, 10 Aug 2017 12:30:35 -0000 Author: gjb Date: Thu Aug 10 12:30:34 2017 New Revision: 322352 URL: https://svnweb.freebsd.org/changeset/base/322352 Log: Revise part of r322327 in release/packages/kernel.ucl. It appears I misunderstand process forking and signal handling in how the pre-/post-install scripts are executed internally by pkg(8). In some cases (not all), ^C when prompted to cancel the kernel package update will stop the pre-install script from executing, but allow pkg(8) to continue extracting the package when it is not the intent. In order to keep somewhat of an anti-footshooting measure in place, print the recommendation to install the kernel package first if ASSUME_ALWAYS_YES is false and TERM is set, then sleep for 5 seconds to allow the user to see the message. MFC after: 5 days MFC with: r322327 X-MFC-Note: Maybe not until I am happy with this.. Sponsored by: The FreeBSD Foundation Modified: head/release/packages/kernel.ucl Modified: head/release/packages/kernel.ucl ============================================================================== --- head/release/packages/kernel.ucl Thu Aug 10 10:59:05 2017 (r322351) +++ head/release/packages/kernel.ucl Thu Aug 10 12:30:34 2017 (r322352) @@ -25,6 +25,9 @@ scripts: { continue ;; esac + if [ -z "${TERM}" ]; then + exit 0 + fi echo "****************************************************************" echo "It is recommended to install the FreeBSD-%PKGNAME% package" echo "with:" @@ -37,16 +40,7 @@ scripts: { echo " pkg upgrade" echo echo "****************************************************************" - echo - echo "Do you want to continue anyway?" - echo "[Enter] to continue, ^C to cancel." - echo - read ANSWER - case ${ANSWER} in - *) - continue - ;; - esac + sleep 5 EOD post-install = <