From owner-freebsd-ports@FreeBSD.ORG Thu Dec 17 07:11:11 2009 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DF3D1065672 for ; Thu, 17 Dec 2009 07:11:11 +0000 (UTC) (envelope-from tkjacobsen@gmail.com) Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by mx1.freebsd.org (Postfix) with ESMTP id 923EA8FC0A for ; Thu, 17 Dec 2009 07:11:10 +0000 (UTC) Received: by ewy26 with SMTP id 26so920101ewy.3 for ; Wed, 16 Dec 2009 23:11:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=31oeeI1JlQJTPdPeHllWWSYESUVUZ+DzeTWMs+z3Lyo=; b=EVjCzS9Knml1MoNGIPkiBx+L1+2vV97PuLyAeXCJkZeKEhFhavwozt7w72Gz18rgAv /egm2UGPA1VCbX05w8L6YRVnQbZJ1f4v815sTfisjq09Nu92ntCPVJ7g+ysfj+11rrlV 8noxOdqdz7Vn3bdjNjzevAmREaTQqn010kuFo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=U/TDsgnjNe9gxQ3qqbllYJicqkN+M1h1gM8mZs8m6UMY85bYy/nYlJsGt3kxJQ0Wik +kc8pXp6kUH/Kxp647mnNCvGb2niFyAbs2/hqgRf1pMNTTfyY8/zzFHp0+pxzYRU5Oxy Z+bYlisJ/Ymanrdw17OMAmt7mI9ddg5L+z4iI= Received: by 10.213.98.144 with SMTP id q16mr2482376ebn.29.1261033869633; Wed, 16 Dec 2009 23:11:09 -0800 (PST) Received: from localhost (84-238-114-250.u.parknet.dk [84.238.114.250]) by mx.google.com with ESMTPS id 13sm1063179ewy.1.2009.12.16.23.11.07 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 16 Dec 2009 23:11:08 -0800 (PST) Date: Thu, 17 Dec 2009 08:11:06 +0100 From: Troels Kofoed Jacobsen To: freebsd-ports@freebsd.org Message-ID: <20091217071106.GA1401@photon.std> References: <4B295701.2000908@telenix.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B295701.2000908@telenix.org> User-Agent: Mutt/1.4.2.3i Cc: chuckr@telenix.org Subject: Re: trying to fix a sed line X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2009 07:11:11 -0000 On Wed, Dec 16, 2009 at 04:54:09PM -0500, Chuck Robey wrote: > I don't do enough in sed .... if I could figure out what it is that the broken > line is TRYING to do, I think maybe I could fix it, I HAVE used sed before, and > I know about the s command, and how it sets it's delimiters. Anyhow, here's the > broken line, and I hope my mailer doesn't decide to break the line for me: > > REINPLACE_ARGS= -i.bak -E -e "1s,^(\#!.* )python$$,\1 -S PYTHONPATH=${DATADIR} > ${PYTHON_CMD},1" Inside "" we have 1s make a find replace in first line ^(\#!.* )python$$ Is a regexp matching what to be replaced: #!/usr/bin/env python In detail: ^ matches start of line () marks a group \#!.* matches /usr/bin/env (ending with a space) python matches python! $ matches end of line. I think this could be the error as the line only ends once \1 -S PYTHONPATH=${DATADIR} ${PYTHON_CMD} This is what the previous expression is replaced with: \1 puts what was in the group () from first regexp e.g. #!/usr/bin/env The rest is just to set the pythonpath before executing python. I have never seen this though and do not know if it will work Best regards Troels Kofoed Jacobsen chuckr@telenix.org > > should be only a single space between ${DATADIR} and ${PYTHON_CMD}, my mailer > put a line break in there for me ... > > If you care, this came from editors/spe/Makefile. > _______________________________________________ > freebsd-ports@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-ports > To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org"