From owner-svn-src-stable@FreeBSD.ORG Sat Oct 26 08:34:36 2013 Return-Path: Delivered-To: svn-src-stable@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 49FD030D; Sat, 26 Oct 2013 08:34:36 +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 366F12F97; Sat, 26 Oct 2013 08:34:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9Q8Ya86078348; Sat, 26 Oct 2013 08:34:36 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9Q8YaXL078347; Sat, 26 Oct 2013 08:34:36 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201310260834.r9Q8YaXL078347@svn.freebsd.org> From: Colin Percival Date: Sat, 26 Oct 2013 08:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257153 - stable/10/usr.sbin/freebsd-update X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 08:34:36 -0000 Author: cperciva Date: Sat Oct 26 08:34:35 2013 New Revision: 257153 URL: http://svnweb.freebsd.org/changeset/base/257153 Log: MFC r256646, r256767, r257038: When installing updates, install new directories first and remove old directories last. Allow ~ in file names so libtool droppings in contrib don't break updates. It has happened twice now, and is likely to happen again. Be more selective when filtering for lib*.so.N files. These are deleted at the end of the upgrade process, after warning users to upgrade any 3rd party software (e.g., from the ports tree) which might link to the libraries being removed. Approved by: re (gjb) Errata Notice: FreeBSD-EN-13:04.freebsd-update Modified: stable/10/usr.sbin/freebsd-update/freebsd-update.sh Directory Properties: stable/10/usr.sbin/freebsd-update/ (props changed) Modified: stable/10/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- stable/10/usr.sbin/freebsd-update/freebsd-update.sh Sat Oct 26 06:23:51 2013 (r257152) +++ stable/10/usr.sbin/freebsd-update/freebsd-update.sh Sat Oct 26 08:34:35 2013 (r257153) @@ -1200,7 +1200,7 @@ fetch_metadata_sanity () { # Some aliases to save space later: ${P} is a character which can # appear in a path; ${M} is the four numeric metadata fields; and # ${H} is a sha256 hash. - P="[-+./:=%@_[[:alnum:]]" + P="[-+./:=%@_[~[:alnum:]]" M="[0-9]+\|[0-9]+\|[0-9]+\|[0-9]+" H="[0-9a-f]{64}" @@ -2814,16 +2814,24 @@ 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 -E '/lib/.*\.so\.[0-9]+\|' > 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 '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD + grep -vE '^[^|]+\|d\|' | + grep -vE '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-OLD grep -vE '^/boot/' $1/INDEX-NEW | - grep -vE '/lib/.*\.so\.[0-9]+\|' > 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 @@ -2844,11 +2852,11 @@ Kernel updates have been installed. Ple # Do we need to ask the user to portupgrade now? grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' | cut -f 1 -d '|' | sort > newfiles if grep -vE '^/boot/' $1/INDEX-OLD | - grep -E '/lib/.*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' | cut -f 1 -d '|' | sort | join -v 1 - newfiles | @@ -2868,9 +2876,18 @@ again to finish installing updates. # Remove old shared libraries grep -vE '^/boot/' $1/INDEX-NEW | - grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW + grep -vE '^[^|]+\|d\|' | + grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW grep -vE '^/boot/' $1/INDEX-OLD | - grep -E '/lib/.*\.so\.[0-9]+\|' > 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