[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] svnadmin create --owner --group patch (new feature)

From: Branko Čibej <brane_at_xbc.nu>
Date: 2003-09-16 20:20:38 CEST

John Peacock wrote:

> brane@xbc.nu wrote:
>
>> I suppose an #ifdef would be appropriate in this case, at least
>> temporarily, as
>> long as it's carefully localized. I'd suggest just ignoring the
>> option on
>> Windows, not removing the option itself. The option's docstring
>> should indicate
>> that it's a no-op on non-Unix systems.
>
>
> Like this?
>
> $ ./svnadmin create --owner nobody /tmp/test
> svn: Client error in parsing arguments
> svn: --owner and --group unavailable under Win32

Heh, that's exactly the opposite of ignoring the option. :-) A warning
would be O.K., but an error is overdoing it in this case. It makes it
harder for people to write platform-independent scripts.

[skip]

>
> The patch changes to look like this:
>
>> + if (opt_state->owner_id)
>> + {
>> +#ifdef SVN_WIN32
>> + return svn_error_createf (SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
>> + "--owner and --group unavailable under
>> Win32");
>> +#else
>> + apr_uid_t retrieved_uid;
>> + apr_gid_t retrieved_gid;
>> + apr_status_t apr_err;
>
> ...snip...
>
> so that all of the Unix specific stuff doesn't exist for Win32...

In cases like this, I (we) prefer feature tests rather than platform
tests. That would involve adding checks for umask, setgid and setuid to
configure.in, then checking HAVE_UMASK, HAVE_SETUID and HAVE_SETGID.
There are (admittedly obscure) Unix-like systems that have some, but not
all of these functions. In any case, the world isn't divided between
Windows and Unix. :-)

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Sep 16 20:21:33 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.