From owner-svn-src-all@FreeBSD.ORG Wed Oct 16 18:36:54 2013 Return-Path: Delivered-To: svn-src-all@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 0D98C6B7; Wed, 16 Oct 2013 18:36:54 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) 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 D622A22BD; Wed, 16 Oct 2013 18:36:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9GIarUA095869; Wed, 16 Oct 2013 18:36:53 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9GIarDb095868; Wed, 16 Oct 2013 18:36:53 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201310161836.r9GIarDb095868@svn.freebsd.org> From: Colin Percival Date: Wed, 16 Oct 2013 18:36:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256646 - head/usr.sbin/freebsd-update X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Oct 2013 18:36:54 -0000 Author: cperciva Date: Wed Oct 16 18:36:53 2013 New Revision: 256646 URL: http://svnweb.freebsd.org/changeset/base/256646 Log: When installing updates, install new directories first and remove old directories last. This is generally handled by the fact that the list of filesystem objects is sorted, but this sorting is broken by code which moves .so files ahead (so that they're present before any binaries which use them)... that code also moved .so files ahead of directories, which is a problem for upgrading to 10.0 where there's a new directory containing new .so files. Errata Notice Candidate. Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Wed Oct 16 18:20:27 2013 (r256645) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Wed Oct 16 18:36:53 2013 (r256646) @@ -2814,15 +2814,23 @@ Kernel updates have been installed. Ple # If we haven't already dealt with the world, deal with it. if ! [ -f $1/worlddone ]; then + # Create any necessary directories first + grep -vE '^/boot/' $1/INDEX-NEW | + grep -E '^[^|]+\|d\|' > INDEX-NEW + install_from_index INDEX-NEW || return 1 + # Install new shared libraries next grep -vE '^/boot/' $1/INDEX-NEW | + grep -vE '^[^|]+\|d\|' | grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 # Deal with everything else grep -vE '^/boot/' $1/INDEX-OLD | + grep -vE '^[^|]+\|d\|' | grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD grep -vE '^/boot/' $1/INDEX-NEW | + grep -vE '^[^|]+\|d\|' | grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 install_delete INDEX-OLD INDEX-NEW || return 1 @@ -2868,11 +2876,20 @@ again to finish installing updates. # Remove old shared libraries grep -vE '^/boot/' $1/INDEX-NEW | + grep -vE '^[^|]+\|d\|' | grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW grep -vE '^/boot/' $1/INDEX-OLD | + grep -vE '^[^|]+\|d\|' | grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD install_delete INDEX-OLD INDEX-NEW || return 1 + # Remove old directories + grep -vE '^/boot/' $1/INDEX-OLD | + grep -E '^[^|]+\|d\|' > INDEX-OLD + grep -vE '^/boot/' $1/INDEX-OLD | + grep -E '^[^|]+\|d\|' > INDEX-OLD + install_delete INDEX-OLD INDEX-NEW || return 1 + # Remove temporary files rm INDEX-OLD INDEX-NEW }