You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2010/10/20 11:18:24 UTC

svn commit: r1024558 - in /subversion/trunk/subversion/libsvn_subr: config_file.c config_impl.h

Author: philip
Date: Wed Oct 20 09:18:24 2010
New Revision: 1024558

URL: http://svn.apache.org/viewvc?rev=1024558&view=rev
Log:
This patch makes use of find_directory() on Haiku to locate the proper
directories to use.  Currently B_USER_SETTINGS_DIRECTORY points to
/boot/home/config/settings, so this puts the .subversion directory in
/boot/home/config/settings/subversion instead of $HOME/subversion or
$HOME/.subversion.

* subversion/libsvn_subr/config_file.c
  (svn_config__sys_config_path): Set the path on Haiku to point to
   "B_COMMON_SETTINGS_DIRECTORY" + SVN_CONFIG__SYS_DIRECTORY
  (svn_config__usr_config_path): Set the path on Haiku to point to
   "B_USER_SETTINGS_DIRECTORY" + SVN_CONFIG__USR_SUBDIRECTORY

* subversion/libsvn_subr/config_impl.h:
  Set SVN_CONFIG__SYS_DIRECTORY and SVN_CONFIG__USR_DIRECTORY for Haiku

Patch by: Scott McCreary <sc...@gmail.com> (HaikuPorts)
Found by: Chris Roberts <cp...@gmail.com> (HaikuPorts)

Modified:
    subversion/trunk/subversion/libsvn_subr/config_file.c
    subversion/trunk/subversion/libsvn_subr/config_impl.h

Modified: subversion/trunk/subversion/libsvn_subr/config_file.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/config_file.c?rev=1024558&r1=1024557&r2=1024558&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/config_file.c (original)
+++ subversion/trunk/subversion/libsvn_subr/config_file.c Wed Oct 20 09:18:24 2010
@@ -38,6 +38,11 @@
 
 #include "svn_private_config.h"
 
+#ifdef __HAIKU__
+#  include <FindDirectory.h>
+#  include <StorageDefs.h>
+#endif
+
 /* Used to terminate lines in large multi-line string literals. */
 #define NL APR_EOL_STR
 
@@ -331,7 +336,19 @@ svn_config__sys_config_path(const char *
                                    SVN_CONFIG__SUBDIRECTORY, fname, NULL);
   }
 
-#else  /* ! WIN32 */
+#elif defined(__HAIKU__)
+  {
+    char folder[B_PATH_NAME_LENGTH];
+
+    status_t error = find_directory(B_COMMON_SETTINGS_DIRECTORY, -1, false,
+                                    folder, sizeof(folder));
+    if (error)
+      return SVN_NO_ERROR;
+
+    *path_p = svn_dirent_join_many(pool, folder,
+                                   SVN_CONFIG__SYS_DIRECTORY, fname, NULL);
+  }
+#else  /* ! WIN32 && !__HAIKU__ */
 
   *path_p = svn_dirent_join_many(pool, SVN_CONFIG__SYS_DIRECTORY, fname, NULL);
 
@@ -1117,7 +1134,20 @@ svn_config_get_user_config_path(const ch
                                  SVN_CONFIG__SUBDIRECTORY, fname, NULL);
   }
 
-#else  /* ! WIN32 */
+#elif defined(__HAIKU__)
+  {
+    char folder[B_PATH_NAME_LENGTH];
+
+    status_t error = find_directory(B_USER_SETTINGS_DIRECTORY, -1, false,
+                                    folder, sizeof(folder));
+    if (error)
+      return SVN_NO_ERROR;
+
+    *path = svn_dirent_join_many(pool, folder,
+                                 SVN_CONFIG__USR_DIRECTORY, fname, NULL);
+  }
+#else  /* ! WIN32 && !__HAIKU__ */
+
   {
     const char *homedir = svn_user_get_homedir(pool);
     if (! homedir)

Modified: subversion/trunk/subversion/libsvn_subr/config_impl.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/config_impl.h?rev=1024558&r1=1024557&r2=1024558&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/config_impl.h (original)
+++ subversion/trunk/subversion/libsvn_subr/config_impl.h Wed Oct 20 09:18:24 2010
@@ -114,7 +114,10 @@ svn_error_t *svn_config__parse_registry(
    or svn_config_get_user_config_path() instead. */
 #ifdef WIN32
 #  define SVN_CONFIG__SUBDIRECTORY    "Subversion"
-#else  /* ! WIN32 */
+#elif defined __HAIKU__ /* HAIKU */
+#  define SVN_CONFIG__SYS_DIRECTORY   "subversion"
+#  define SVN_CONFIG__USR_DIRECTORY   "subversion"
+#else  /* ! WIN32 && ! __HAIKU__ */
 #  define SVN_CONFIG__SYS_DIRECTORY   "/etc/subversion"
 #  define SVN_CONFIG__USR_DIRECTORY   ".subversion"
 #endif /* WIN32 */