From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 11:42:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A9801065676; Wed, 21 Jul 2010 11:42:13 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 20B068FC14; Wed, 21 Jul 2010 11:42:13 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 3752235A852; Wed, 21 Jul 2010 13:42:12 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 2D95E171FA; Wed, 21 Jul 2010 13:42:12 +0200 (CEST) Date: Wed, 21 Jul 2010 13:42:12 +0200 From: Jilles Tjoelker To: Alex Kozlov Message-ID: <20100721114212.GA30431@stack.nl> References: <20100720170333.GA51595@ravenloft.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100720170333.GA51595@ravenloft.kiev.ua> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, Gabor Kovesdan Subject: Re: svn commit: r210254 - in head/etc: defaults periodic/security X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 21 Jul 2010 11:42:13 -0000 On Tue, Jul 20, 2010 at 08:03:33PM +0300, Alex Kozlov wrote: > On Tue, Jul 20, 2010 at 05:25:05PM +0300, Alex Kozlov wrote: > > > > + echo ${name}: ${one} > > > > > > This handles pathnames with spaces incorrectly. Consider reading lines > > > with > > > IFS= read -r line > > > This also collapses the nested case statements to one, for > > > 'Information for'*, Mismatched*, '' and /*. > > > > > > The variables in the echo commands should be quoted to avoid word > > > splitting and pathname generation. > > It's makes parser stateful and overly complex, I will think about most > > simple way to do this. Fortunately, at the moment very few, if any, ports > > have files with space in names. > It's seems I was wrong, We have more that 10k files with spaces in ports. > What do think about this solution? > Index: etc/periodic/security/460.chkportsum > @@ -26,8 +26,10 @@ > ;; > Mismatched|'') ;; > *) > - if [ -n ${name} ]; then > - echo ${name}: ${one} > + if [ -n "${name}" ]; then > + #handle filenames with spaces > + file="${one} ${two} ${three}" > + echo "${name}: ${file%% fails the original MD5 checksum}" > fi > ;; > esac This works but collapses sequences of multiple spaces (or even tabs) to a single space. -- Jilles Tjoelker