From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Sep 12 02:30:03 2007 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69F9316A41B for ; Wed, 12 Sep 2007 02:30:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 30B9913C45B for ; Wed, 12 Sep 2007 02:30:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8C2U3oV062500 for ; Wed, 12 Sep 2007 02:30:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8C2U305062499; Wed, 12 Sep 2007 02:30:03 GMT (envelope-from gnats) Resent-Date: Wed, 12 Sep 2007 02:30:03 GMT Resent-Message-Id: <200709120230.l8C2U305062499@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, NIIMI Satoshi Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 830A616A419 for ; Wed, 12 Sep 2007 02:23:04 +0000 (UTC) (envelope-from sa2c@sa2c.net) Received: from sakura.and.or.jp (sakura.and.or.jp [59.106.20.85]) by mx1.freebsd.org (Postfix) with ESMTP id 3AC3F13C458 for ; Wed, 12 Sep 2007 02:23:03 +0000 (UTC) (envelope-from sa2c@sa2c.net) Received: from sakura.and.or.jp (localhost [127.0.0.1]) by sakura.and.or.jp (Postfix) with ESMTP id F388561C56; Wed, 12 Sep 2007 11:23:02 +0900 (JST) Received: from berkeley.l.sa2c.net (berkeley.vpn.and.or.jp [10.46.49.3]) by sakura.and.or.jp (Postfix) with ESMTP id D6CE861C34; Wed, 12 Sep 2007 11:23:02 +0900 (JST) Received: by berkeley.l.sa2c.net (Postfix, from userid 3104) id B180B5C54; Wed, 12 Sep 2007 11:23:02 +0900 (JST) Message-Id: <20070912022302.B180B5C54@berkeley.l.sa2c.net> Date: Wed, 12 Sep 2007 11:23:02 +0900 (JST) From: NIIMI Satoshi To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/116298: ports-mgmt/portmaster: don't delete common distfiles with old and new versions X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: NIIMI Satoshi List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2007 02:30:03 -0000 >Number: 116298 >Category: ports >Synopsis: ports-mgmt/portmaster: don't delete common distfiles with old and new versions >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Sep 12 02:30:02 GMT 2007 >Closed-Date: >Last-Modified: >Originator: NIIMI Satoshi >Release: FreeBSD 6.2-RELEASE-p7 i386 >Organization: >Environment: System: FreeBSD berkeley.l.sa2c.net 6.2-RELEASE-p7 FreeBSD 6.2-RELEASE-p7 #2: Thu Aug 2 09:30:08 JST 2007 root@berkeley.l.sa2c.net:/usr/obj/usr/src/sys/GENERIC i386 >Description: When upgrading ports, distfiles in the old set is deleted even if listed in the new set. For example, consider upgrading of editors/vim from 7.1.87 to 7.1.100. distfiles of the former are "vim-7.1.tar.bz2", "7.1.001"..."7.1.87" and distfiles of the latter are "vim-7.1.tar.bz2", "7.1.001"..."7.1.87"..."7.1.100". In this senario, common distfiles "vim-7.1.tar.bz2", "7.1.001"..."7.1.87" will be deleted. In addition, this PR contains small fixes which makes emacs happy around quote, and makes --clean-distfiles work even if DISTDIR is a symbolic link. >How-To-Repeat: >Fix: --- portmaster.diff begins here --- Index: files/portmaster.sh.in =================================================================== RCS file: /home/ncvs/ports/ports-mgmt/portmaster/files/portmaster.sh.in,v retrieving revision 1.20 diff -u -r1.20 portmaster.sh.in --- files/portmaster.sh.in 27 Aug 2007 22:48:24 -0000 1.20 +++ files/portmaster.sh.in 12 Sep 2007 02:04:59 -0000 @@ -28,7 +28,7 @@ umask 022 usage () { - echo "portmaster version `grep "[$]FreeBSD:" $0 | cut -d ' ' -f 4`" + echo "portmaster version `grep '[$]FreeBSD:' $0 | cut -d ' ' -f 4`" echo '' echo 'Usage:' echo "Common flags: [--force-config] [-CGgntvw B|b uf|i D|d]" @@ -775,7 +775,7 @@ delete_stale_distfiles () { # distfiles is used globally # inherit distdir from the environment, but only modify our copy - local distdir dist_subdir file DELORNOT distfile + local distdir dist_subdir file DELORNOT distfile x dist_subdir=`make BEFOREPORTMK=yes $PM_MAKE_ARGS -V DIST_SUBDIR` test -n "$dist_subdir" && distdir="${distdir}/${dist_subdir}" @@ -800,6 +800,12 @@ for file in $cont_distfiles; do [ -f $file ] || continue + # Don't delete files which are also listed in + # the current set. + for x in $distfiles; do + [ "$file" = "$x" ] && continue 2 + done + if [ -n "$ALWAYS_SCRUB_DISTFILES" ]; then echo "===>>> Deleting stale distfile: $file" rm -f $file @@ -946,7 +952,7 @@ read_distinfos echo "===>>> Checking for stale distfiles" - for df in `find $distdir -type f`; do + for df in `find ${distdir%/}/ -type f`; do f=${df#$distdir/} if ! grep -q \(${f}\) $DI_FILES; then if [ -n "$ALL" ]; then --- portmaster.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: