You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by David Kimdon <dw...@debian.org> on 2002/09/25 14:52:04 UTC

[PATCH] : Use /etc/subversion/config and global registry

Hi,

The following patch makes subversion look into /etc/subversion/config.
(Options in that file are overridden by ~/.subversion/config.)  Before
this patch /etc/subversion/config was completely ignored as far as I
can tell.  I'm also including the changes to enable similar beavior on
win32, but I don't have a win32 box to check it on.

-David

* config.c (svn_config_read_config) : Look in /etc/subversion/config and
  in SVN_REGISTRY_SYS_CONFIG_PROXY_PATH (on win32) for system wide
  configuration options.

Index: config.c
===================================================================
--- config.c
+++ config.c	2002-09-25 07:35:28.000000000 -0700
@@ -185,20 +185,25 @@
 svn_error_t *
 svn_config_read_config (svn_config_t **cfgp, apr_pool_t *pool)
 {
-  const char *usr_reg_path = NULL;
-  const char *usr_cfg_path;
+  const char *usr_reg_path = NULL, *sys_reg_path = NULL;
+  const char *usr_cfg_path, *sys_cfg_path;
 
 #ifdef SVN_WIN32
   usr_reg_path = SVN_REGISTRY_USR_CONFIG_CONFIG_PATH;
+  sys_reg_path = SVN_REGISTRY_SYS_CONFIG_PROXY_PATH;
 #endif /* SVN_WIN32 */
+  
+  SVN_ERR (svn_config__sys_config_path (&sys_cfg_path,
+                                        SVN_CONFIG__USR_CONFIG_FILE,
+                                        pool));
 
   SVN_ERR (svn_config__user_config_path (&usr_cfg_path,
                                          SVN_CONFIG__USR_CONFIG_FILE,
                                          pool));
 
   SVN_ERR (read_all (cfgp,
-                     NULL, usr_reg_path,
-                     NULL, usr_cfg_path,
+                     sys_reg_path, usr_reg_path,
+                     sys_cfg_path, usr_cfg_path,
                      pool));
 
   return SVN_NO_ERROR;

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] : Use /etc/subversion/config and global registry

Posted by Branko Čibej <br...@xbc.nu>.
David Kimdon wrote:

>Wed, Sep 25, 2002 at 05:35:13PM -0700 wrote:
>  
>
>>Quoting David Kimdon <dw...@debian.org>:
>>
>>    
>>
>>>+#  define SVN_REGISTRY_SYS_CONFIG_CONFIG_PATH \
>>>+                               SVN_REGISTRY_PREFIX     \
>>>+                               SVN_REGISTRY_HKCM       \
>>>      
>>>
>>This should be SVN_REGISTRY_HKLM   \
>>    
>>
>
>cool, thanks for spotting that, one more time, here we go:
>
>* subversion/libsvn_subr/config.c (svn_config_read_config) : Look in
>  /etc/subversion/config and in SVN_REGISTRY_SYS_CONFIG_CONFIG_PATH 
>  (on win32) for system wide configuration options.
>* subversion/libsvn_subr/config_impl.h : Define
>  SVN_REGISTRY_SYS_CONFIG_CONFIG_PATH, location of system wide subversion
>  client configuration on win32.
>  
>
Thanks! committed in r3233. I suppose you're about to add the logic to 
get diff and diff3 locations from that file, right? If so, there's also 
the SVN_DIFF3_HAS_DIFF_PROGRAM_ARG option, that should be settable in 
the config file, too.

-- 
Brane Čibej   <br...@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

Re: [PATCH] : Use /etc/subversion/config and global registry

Posted by David Kimdon <dw...@debian.org>.
Wed, Sep 25, 2002 at 05:35:13PM -0700 wrote:
> Quoting David Kimdon <dw...@debian.org>:
> 
> > +#  define SVN_REGISTRY_SYS_CONFIG_CONFIG_PATH \
> > +                               SVN_REGISTRY_PREFIX     \
> > +                               SVN_REGISTRY_HKCM       \
> 
> This should be SVN_REGISTRY_HKLM   \

cool, thanks for spotting that, one more time, here we go:

* subversion/libsvn_subr/config.c (svn_config_read_config) : Look in
  /etc/subversion/config and in SVN_REGISTRY_SYS_CONFIG_CONFIG_PATH 
  (on win32) for system wide configuration options.
* subversion/libsvn_subr/config_impl.h : Define
  SVN_REGISTRY_SYS_CONFIG_CONFIG_PATH, location of system wide subversion
  client configuration on win32.


Index: subversion/libsvn_subr/config.c
===================================================================
--- subversion/libsvn_subr/config.c
+++ subversion/libsvn_subr/config.c	2002-09-25 16:58:57.000000000 -0700
@@ -185,20 +185,25 @@
 svn_error_t *
 svn_config_read_config (svn_config_t **cfgp, apr_pool_t *pool)
 {
-  const char *usr_reg_path = NULL;
-  const char *usr_cfg_path;
+  const char *usr_reg_path = NULL, *sys_reg_path = NULL;
+  const char *usr_cfg_path, *sys_cfg_path;
 
 #ifdef SVN_WIN32
+  sys_reg_path = SVN_REGISTRY_SYS_CONFIG_CONFIG_PATH;
   usr_reg_path = SVN_REGISTRY_USR_CONFIG_CONFIG_PATH;
 #endif /* SVN_WIN32 */
+  
+  SVN_ERR (svn_config__sys_config_path (&sys_cfg_path,
+                                        SVN_CONFIG__USR_CONFIG_FILE,
+                                        pool));
 
   SVN_ERR (svn_config__user_config_path (&usr_cfg_path,
                                          SVN_CONFIG__USR_CONFIG_FILE,
                                          pool));
 
   SVN_ERR (read_all (cfgp,
-                     NULL, usr_reg_path,
-                     NULL, usr_cfg_path,
+                     sys_reg_path, usr_reg_path,
+                     sys_cfg_path, usr_cfg_path,
                      pool));
 
   return SVN_NO_ERROR;
Index: subversion/libsvn_subr/config_impl.h
===================================================================
--- subversion/libsvn_subr/config_impl.h
+++ subversion/libsvn_subr/config_impl.h	2002-09-25 19:57:28.000000000 -0700
@@ -94,6 +94,11 @@
                                SVN_REGISTRY_PATH       \
                                SVN_REGISTRY_CONFIG_PROXY_KEY
 #  define SVN_REGISTRY_CONFIG_CONFIG_KEY "Config"
+#  define SVN_REGISTRY_SYS_CONFIG_CONFIG_PATH \
+                               SVN_REGISTRY_PREFIX     \
+                               SVN_REGISTRY_HKLM       \
+                               SVN_REGISTRY_PATH       \
+                               SVN_REGISTRY_CONFIG_CONFIG_KEY
 #  define SVN_REGISTRY_USR_CONFIG_CONFIG_PATH \
                                SVN_REGISTRY_PREFIX     \
                                SVN_REGISTRY_HKCU       \

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] : Use /etc/subversion/config and global registry

Posted by Kevin Pilch-Bisson <ke...@pilch-bisson.net>.
Quoting David Kimdon <dw...@debian.org>:

> +#  define SVN_REGISTRY_SYS_CONFIG_CONFIG_PATH \
> +                               SVN_REGISTRY_PREFIX     \
> +                               SVN_REGISTRY_HKCM       \

This should be SVN_REGISTRY_HKLM   \

(for HKEY_LOCAL_MACHINE, verus HKEY_CURRENT_USER)
> +                               SVN_REGISTRY_PATH       \
> +                               SVN_REGISTRY_CONFIG_CONFIG_KEY
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson
kevin@pilch-bisson.net
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] : Use /etc/subversion/config and global registry

Posted by David Kimdon <dw...@debian.org>.
> also slightly wrong: it shouldn't be using any ..._CONFIG_PROXY_PATH, of 
> course.
oops, umm, yea . . .  /me hides.


Here is an updated patch, fixing the PROXY error discussed above.  I
have checked this on unix (behaves as advertised and passes the
testsuite).  For the win32 I am following the framework that was layed
out for the proxy config file.  It is untested on win32 but it looks
correct.

-David


* subversion/libsvn_subr/config.c (svn_config_read_config) : Look in
  /etc/subversion/config and in SVN_REGISTRY_SYS_CONFIG_CONFIG_PATH 
  (on win32) for system wide configuration options.
* subversion/libsvn_subr/config_impl.h : Define
  SVN_REGISTRY_SYS_CONFIG_CONFIG_PATH. This is the location of system 
  wide subversion client configuration on win32.


Index: subversion/libsvn_subr/config.c
===================================================================
--- subversion/libsvn_subr/config.c
+++ subversion/libsvn_subr/config.c	2002-09-25 16:58:57.000000000 -0700
@@ -185,20 +185,25 @@
 svn_error_t *
 svn_config_read_config (svn_config_t **cfgp, apr_pool_t *pool)
 {
-  const char *usr_reg_path = NULL;
-  const char *usr_cfg_path;
+  const char *usr_reg_path = NULL, *sys_reg_path = NULL;
+  const char *usr_cfg_path, *sys_cfg_path;
 
 #ifdef SVN_WIN32
+  sys_reg_path = SVN_REGISTRY_SYS_CONFIG_CONFIG_PATH;
   usr_reg_path = SVN_REGISTRY_USR_CONFIG_CONFIG_PATH;
 #endif /* SVN_WIN32 */
+  
+  SVN_ERR (svn_config__sys_config_path (&sys_cfg_path,
+                                        SVN_CONFIG__USR_CONFIG_FILE,
+                                        pool));
 
   SVN_ERR (svn_config__user_config_path (&usr_cfg_path,
                                          SVN_CONFIG__USR_CONFIG_FILE,
                                          pool));
 
   SVN_ERR (read_all (cfgp,
-                     NULL, usr_reg_path,
-                     NULL, usr_cfg_path,
+                     sys_reg_path, usr_reg_path,
+                     sys_cfg_path, usr_cfg_path,
                      pool));
 
   return SVN_NO_ERROR;
Index: subversion/libsvn_subr/config_impl.h
===================================================================
--- subversion/libsvn_subr/config_impl.h
+++ subversion/libsvn_subr/config_impl.h	2002-09-25 17:04:51.000000000 -0700
@@ -94,6 +94,11 @@
                                SVN_REGISTRY_PATH       \
                                SVN_REGISTRY_CONFIG_PROXY_KEY
 #  define SVN_REGISTRY_CONFIG_CONFIG_KEY "Config"
+#  define SVN_REGISTRY_SYS_CONFIG_CONFIG_PATH \
+                               SVN_REGISTRY_PREFIX     \
+                               SVN_REGISTRY_HKCM       \
+                               SVN_REGISTRY_PATH       \
+                               SVN_REGISTRY_CONFIG_CONFIG_KEY
 #  define SVN_REGISTRY_USR_CONFIG_CONFIG_PATH \
                                SVN_REGISTRY_PREFIX     \
                                SVN_REGISTRY_HKCU       \




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] : Use /etc/subversion/config and global registry

Posted by Branko Čibej <br...@xbc.nu>.
cmpilato@collab.net wrote:

>David Kimdon <dw...@debian.org> writes:
>
>  
>
>>Sorry, the first patch didn't have the full path, here is an update:
>>
>>
>>* subversion/libsvn_subr/config.c (svn_config_read_config) : Look in
>>  /etc/subversion/config and in SVN_REGISTRY_SYS_CONFIG_PROXY_PATH 
>>  (on win32) for system wide configuration options.
>>
>>    
>>
>
>This patch is so freakin' obvious that I can't help but wonder why in
>the world we weren't already doing this.  Anyone remember any history
>here?
>  
>

Dunno (you added support for the config file, IIRC :-), but the patch is 
also slightly wrong: it shouldn't be using any ..._CONFIG_PROXY_PATH, of 
course.

-- 
Brane Čibej   <br...@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

Re: [PATCH] : Use /etc/subversion/config and global registry

Posted by cm...@collab.net.
David Kimdon <dw...@debian.org> writes:

> Sorry, the first patch didn't have the full path, here is an update:
> 
> 
> * subversion/libsvn_subr/config.c (svn_config_read_config) : Look in
>   /etc/subversion/config and in SVN_REGISTRY_SYS_CONFIG_PROXY_PATH 
>   (on win32) for system wide configuration options.
> 

This patch is so freakin' obvious that I can't help but wonder why in
the world we weren't already doing this.  Anyone remember any history
here?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] : Use /etc/subversion/config and global registry

Posted by David Kimdon <dw...@debian.org>.
Sorry, the first patch didn't have the full path, here is an update:


* subversion/libsvn_subr/config.c (svn_config_read_config) : Look in
  /etc/subversion/config and in SVN_REGISTRY_SYS_CONFIG_PROXY_PATH 
  (on win32) for system wide configuration options.

Index: subversion/libsvn_subr/config.c
===================================================================
--- subversion/libsvn_subr/config.c
+++ subversion/libsvn_subr/config.c	2002-09-25 07:35:28.000000000 -0700
@@ -185,20 +185,25 @@
 svn_error_t *
 svn_config_read_config (svn_config_t **cfgp, apr_pool_t *pool)
 {
-  const char *usr_reg_path = NULL;
-  const char *usr_cfg_path;
+  const char *usr_reg_path = NULL, *sys_reg_path = NULL;
+  const char *usr_cfg_path, *sys_cfg_path;
 
 #ifdef SVN_WIN32
   usr_reg_path = SVN_REGISTRY_USR_CONFIG_CONFIG_PATH;
+  sys_reg_path = SVN_REGISTRY_SYS_CONFIG_PROXY_PATH;
 #endif /* SVN_WIN32 */
+  
+  SVN_ERR (svn_config__sys_config_path (&sys_cfg_path,
+                                        SVN_CONFIG__USR_CONFIG_FILE,
+                                        pool));
 
   SVN_ERR (svn_config__user_config_path (&usr_cfg_path,
                                          SVN_CONFIG__USR_CONFIG_FILE,
                                          pool));
 
   SVN_ERR (read_all (cfgp,
-                     NULL, usr_reg_path,
-                     NULL, usr_cfg_path,
+                     sys_reg_path, usr_reg_path,
+                     sys_cfg_path, usr_cfg_path,
                      pool));
 
   return SVN_NO_ERROR;


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org