[38144] branches/gsoc08-privileges/base/src/port1.0

Ryan Schmidt ryandesign at macports.org
Tue Jul 8 13:38:19 PDT 2008


On Jul 8, 2008, at 15:35, pmagrath at macports.org wrote:

> Revision: 38144
>           http://trac.macosforge.org/projects/macports/changeset/38144
> Author:   pmagrath at macports.org
> Date:     2008-07-08 13:35:34 -0700 (Tue, 08 Jul 2008)
> Log Message:
> -----------
> Added a new procedure for recursive chowning of directories.  
> Inserted calls to this procedure where necessary.


> +##
> +# Recusively chown the given file or directory to the specified user.
> +#
> +# @param path the file/directory to be chowned
> +# @param user the user to chown file to
> +proc chown {path user} {
> +	file attributes $path -owner [name_to_uid "$user"]
> +	
> +    if {[file isdirectory $path]} {
> +		foreach g [glob [file join $path *]] {
> +			chown $g $user
> +		}
> +    }
> +}

We already have fs-traverse... couldn't that be used? See example in  
the CronniX port's post-destroot.


More information about the macports-dev mailing list