From owner-svn-src-projects@FreeBSD.ORG Wed Nov 23 03:15:35 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 336C01065674; Wed, 23 Nov 2011 03:15:35 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 235888FC18; Wed, 23 Nov 2011 03:15:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAN3FZZH022463; Wed, 23 Nov 2011 03:15:35 GMT (envelope-from linimon@svn.freebsd.org) Received: (from linimon@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAN3FZR6022461; Wed, 23 Nov 2011 03:15:35 GMT (envelope-from linimon@svn.freebsd.org) Message-Id: <201111230315.pAN3FZR6022461@svn.freebsd.org> From: Mark Linimon Date: Wed, 23 Nov 2011 03:15:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227858 - projects/portbuild/scripts X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 03:15:35 -0000 Author: linimon (doc,ports committer) Date: Wed Nov 23 03:15:34 2011 New Revision: 227858 URL: http://svn.freebsd.org/changeset/base/227858 Log: Try to make more robust. Modified: projects/portbuild/scripts/dodistfiles Modified: projects/portbuild/scripts/dodistfiles ============================================================================== --- projects/portbuild/scripts/dodistfiles Wed Nov 23 03:14:54 2011 (r227857) +++ projects/portbuild/scripts/dodistfiles Wed Nov 23 03:15:34 2011 (r227858) @@ -40,9 +40,13 @@ cd ${distdir} || exit 1 echo "Removing incomplete downloads" -# XXX MCL put an existance test here -find ${distdir}/.pbtmp/ -name .done -depth 2 | sed -e 's,/.done$,/,' | sort > .done || exit 1 -find -d ${distdir}/.pbtmp/ -type d -mindepth 1 |sed -E -e 's,([^/])$,\1/,' > .alldirs || exit 1 +if [ -d ${distdir}/.pbtmp/ ]; then + find ${distdir}/.pbtmp/ -name .done -depth 2 | sed -e 's,/.done$,/,' | sort > .done || exit 1 + find -d ${distdir}/.pbtmp/ -type d -mindepth 1 |sed -E -e 's,([^/])$,\1/,' > .alldirs || exit 1 +else + cp /dev/null .done + cp /dev/null .alldirs +fi sed -E -e "s,^(${distdir}/.pbtmp/[^/]+/).*,\1," < .alldirs | sort -u > .pkgdirs @@ -66,12 +70,13 @@ done cat .pkgsubdirs | xargs rmdir || exit 1 echo "Moving remaining distfiles" -# XXX MCL put an existance test here -find ${distdir}/.pbtmp/ -type f -depth 2 \! -name .done | xargs -J % mv % ${distdir} +if [ -d ${distdir}/.pbtmp/ ]; then + find ${distdir}/.pbtmp/ -type f -depth 2 \! -name .done | xargs -J % mv % ${distdir} +fi echo "Cleaning up" sed -e 's,$,.done,' < .pkgdirs | xargs rm -f || exit 1 cat .pkgdirs | xargs rmdir || exit 1 -rmdir .pbtmp || exit 1 +rmdir .pbtmp 2> /dev/null || exit 1 rm -f .alldirs .done .pkgdirs .pkgsubdirs .subdirs || exit 1