[22007] portutil.tcl mods / more portfile.7 changes needed?

Kevin Ballard eridius at macports.org
Tue Feb 13 21:17:35 PST 2007


On Feb 14, 2007, at 12:01 AM, Mark Duling wrote:

> I might be able to find time to document this.  Especially because  
> as I
> think about it there are still a couple of glaring omissions from our
> docs.  I've written many portfiles and I still don't know the  
> answer.  Is
> there a way to do recursive copies without using a system call?  I  
> know
> how to use glob and recurse files within a directory, but I'm still  
> not
> clear on whether it can be done for arbitrary contents of a  
> directory.  It
> seems not.

file copy will copy directories. And with my change, that can be  
shortened to just copy.

> So perhaps more portfile.7 manpage work is needed to answer these
> questions.  They all revolve around globbing or recursion.
>
> 1) The use of 'glob'.  It is missing from the manpages, is it not?   
> Also
> provide liberal examples in the reinplace section and xinstall  
> section.

Docs on this can be found with `man n glob`. You may simply want to  
put in a reference to glob(n) there.

> 2)  Is it possible for reinplace to replace multiple strings for  
> the same
> file with one statement?

Nope. The syntax for reinplace is `reinplace pattern file1 [file2 ...]`.

If you want to make things simple, you can do something like

foreach pat [list pat1 pat2 pat3] { reinplace $pat file1 file2 }

If the pattern has spaces, be sure to enclose it in quotes or braces  
(just like you do with reinplace)

Incidentally, the pattern is a single command as understood by sed  
(in fact, it's actually interpreted by sed under the hood).

> 3) The answer to whether generic recursive queries can be accomplished
> with TCL extensions.

What do you mean by this?

>    3a) If the answer is no but a generic TCL script can be wrapped  
> around
> xinstall using globs, then an example be given for doing this.  If  
> neither
> 3 or 3a is possible, state that system calls for recursive copies are
> acceptible.

Clarify 3 and I may be able to answer this as well.

> If someone can answer these questions adequately I may be able to find
> time to document this in portfile.7.  It should be pretty simple and I
> think it would clear up some confusion.

Sounds good.

-Kevin Ballard

-- 
Kevin Ballard
http://kevin.sb.org
eridius at macports.org
http://www.tildesoft.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-dev/attachments/20070214/ed63af9a/attachment.html


More information about the macports-dev mailing list