Here's the updated patch vs. svn r1022152, feel free to add a
"reviewed by" to the message below.
Thanks,
-scottmc
------------------------------------------------------------------------------------------------------
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 <scottmc2_at_gmail.com> (HaikuPorts)
Found by: Chris Roberts <cpr420_at_gmail.com> (HaikuPorts)
------------------
Index: subversion/libsvn_subr/config_file.c
===================================================================
--- subversion/libsvn_subr/config_file.c (revision 1022152)
+++ subversion/libsvn_subr/config_file.c (working copy)
@@ -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,8 +336,20 @@
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);
#endif /* WIN32 */
@@ -1117,8 +1134,21 @@
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)
return SVN_NO_ERROR;
Index: subversion/libsvn_subr/config_impl.h
===================================================================
--- subversion/libsvn_subr/config_impl.h (revision 1022152)
+++ subversion/libsvn_subr/config_impl.h (working copy)
@@ -114,7 +114,10 @@
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 */
Received on 2010-10-13 19:27:53 CEST