You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/08/11 00:07:31 UTC

svn commit: r984234 [20/20] - in /subversion/branches/ignore-mergeinfo: ./ build/ build/ac-macros/ build/generator/ notes/ notes/api-errata/ notes/obliterate/ notes/obliterate/fspec-cc1/ notes/rename-tracking/ notes/svnpatch/ notes/tree-conflicts/ note...

Modified: subversion/branches/ignore-mergeinfo/subversion/tests/libsvn_subr/dirent_uri-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/libsvn_subr/dirent_uri-test.c?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/libsvn_subr/dirent_uri-test.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/libsvn_subr/dirent_uri-test.c Tue Aug 10 22:07:24 2010
@@ -24,7 +24,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#ifdef _MSC_VER
+#if defined(WIN32) || defined(__OS2__)
 #include <direct.h>
 #define getcwd _getcwd
 #define getdcwd _getdcwd
@@ -41,6 +41,11 @@
 
 #define SVN_EMPTY_PATH ""
 
+/* This check must match the check on top of dirent_uri.c */
+#if defined(WIN32) || defined(__CYGWIN__) || defined(__OS2__)
+#define SVN_USE_DOS_PATHS
+#endif
+
 #define COUNT_OF(x) (sizeof(x) / sizeof(x[0]))
 
 static svn_error_t *
@@ -57,7 +62,7 @@ test_dirent_is_root(apr_pool_t *pool)
     { "/foo/bar",      FALSE },
     { "/foo",          FALSE },
     { "",              FALSE },
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
     { "X:/foo",        FALSE },
     { "X:/",           TRUE },
     { "X:foo",         FALSE }, /* Based on non absolute root */
@@ -66,11 +71,11 @@ test_dirent_is_root(apr_pool_t *pool)
     { "//srv/shr/fld", FALSE },
     { "//srv/s r",     TRUE },
     { "//srv/s r/fld", FALSE },
-#else /* WIN32 or Cygwin */
+#else /* !SVN_USE_DOS_PATHS */
     { "/",             TRUE },
     { "/X:foo",        FALSE },
     { "/X:",           FALSE },
-#endif /* non-WIN32 */
+#endif /* SVN_USE_DOS_PATHS */
   };
 
   for (i = 0; i < COUNT_OF(tests); i++)
@@ -145,7 +150,7 @@ test_dirent_is_absolute(apr_pool_t *pool
     { "foo/bar",       FALSE },
     { "foo",           FALSE },
     { "",              FALSE },
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
     { "/foo/bar",      FALSE },
     { "/foo",          FALSE },
     { "/",             FALSE },
@@ -157,13 +162,13 @@ test_dirent_is_absolute(apr_pool_t *pool
     { "//srv/shr/fld", TRUE },
     { "//srv/s r",     TRUE },
     { "//srv/s r/fld", TRUE },
-#else/* WIN32 or Cygwin */
+#else /* !SVN_USE_DOS_PATHS */
     { "/foo/bar",      TRUE },
     { "/foo",          TRUE },
     { "/",             TRUE },
     { "X:/foo",        FALSE },
     { "X:/",           FALSE },
-#endif /* non-WIN32 */
+#endif /* SVN_USE_DOS_PATHS */
     { "X:foo",         FALSE }, /* Not special on Posix, relative on Windows */
     { "X:foo/bar",     FALSE },
     { "X:",            FALSE },
@@ -269,7 +274,7 @@ test_dirent_join(apr_pool_t *pool)
     { SVN_EMPTY_PATH, "/abc", "/abc" },
     { SVN_EMPTY_PATH, SVN_EMPTY_PATH, SVN_EMPTY_PATH },
     { "/", "/", "/" },
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
     { "X:/", SVN_EMPTY_PATH, "X:/" },
     { "X:/", "abc", "X:/abc" },
     { "X:/", "/def", "X:/def" },
@@ -292,11 +297,11 @@ test_dirent_join(apr_pool_t *pool)
     { "aa", "A:", "A:" },
     { "aa", "A:file", "A:file"},
     { "A:", "/", "A:/" },
-#else /* WIN32 or Cygwin */
+#else /* !SVN_USE_DOS_PATHS */
     { "X:abc", "X:/def", "X:abc/X:/def" },
     { "X:","abc", "X:/abc" },
     { "X:/abc", "X:/def", "X:/abc/X:/def" },
-#endif /* non-WIN32 */
+#endif /* SVN_USE_DOS_PATHS */
   };
 
   for (i = 0; i < COUNT_OF(joins); i++ )
@@ -360,7 +365,7 @@ test_dirent_join(apr_pool_t *pool)
   TEST_MANY((pool, SVN_EMPTY_PATH, "/", SVN_EMPTY_PATH, NULL), "/");
   TEST_MANY((pool, SVN_EMPTY_PATH, SVN_EMPTY_PATH, "/", NULL), "/");
 
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
   TEST_MANY((pool, "X:/", "def", "ghi", NULL), "X:/def/ghi");
   TEST_MANY((pool, "abc", "X:/", "ghi", NULL), "X:/ghi");
   TEST_MANY((pool, "abc", "def", "X:/", NULL), "X:/");
@@ -389,12 +394,12 @@ test_dirent_join(apr_pool_t *pool)
   TEST_MANY((pool, "abcd", "/dir", "A:", "file", NULL), "A:file");
   TEST_MANY((pool, "abcd", "A:", "/dir", "file", NULL), "A:/dir/file");
 
-#else /* WIN32 or Cygwin */
+#else /* !SVN_USE_DOS_PATHS */
   TEST_MANY((pool, "X:", "def", "ghi", NULL), "X:/def/ghi");
   TEST_MANY((pool, "X:", SVN_EMPTY_PATH, "ghi", NULL), "X:/ghi");
   TEST_MANY((pool, "X:", "def", SVN_EMPTY_PATH, NULL), "X:/def");
   TEST_MANY((pool, SVN_EMPTY_PATH, "X:", "ghi", NULL), "X:/ghi");
-#endif /* non-WIN32 */
+#endif /* SVN_USE_DOS_PATHS */
 
   /* ### probably need quite a few more tests... */
 
@@ -412,6 +417,8 @@ test_relpath_join(apr_pool_t *pool)
     { "a", "def", "a/def" },
     { "a", "d", "a/d" },
     { SVN_EMPTY_PATH, "abc", "abc" },
+    { "abc", SVN_EMPTY_PATH, "abc" },
+    { "", "", "" },
   };
 
   for (i = 0; i < COUNT_OF(joins); i++)
@@ -515,7 +522,7 @@ test_dirent_basename(apr_pool_t *pool)
     { "/", "" },
     { SVN_EMPTY_PATH, SVN_EMPTY_PATH },
     { "X:/abc", "abc" },
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
     { "X:", "" },
     { "X:/", "" },
     { "X:abc", "abc" },
@@ -523,10 +530,10 @@ test_dirent_basename(apr_pool_t *pool)
     { "//srv/shr/fld", "fld" },
     { "//srv/shr/fld/subfld", "subfld" },
     { "//srv/s r/fld", "fld" },
-#else /* WIN32 or Cygwin */
+#else /* !SVN_USE_DOS_PATHS */
     { "X:", "X:" },
     { "X:abc", "X:abc" },
-#endif /* non-WIN32 */
+#endif /* SVN_USE_DOS_PATHS */
   };
 
   for (i = 0; i < COUNT_OF(tests); i++)
@@ -633,7 +640,7 @@ test_dirent_dirname(apr_pool_t *pool)
     { "/", "/" },
     { SVN_EMPTY_PATH, SVN_EMPTY_PATH },
     { "X:abc/def", "X:abc" },
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
     { "X:/", "X:/" },
     { "X:/abc", "X:/" },
     { "X:abc", "X:" },
@@ -642,11 +649,11 @@ test_dirent_dirname(apr_pool_t *pool)
     { "//srv/shr/fld",  "//srv/shr" },
     { "//srv/shr/fld/subfld", "//srv/shr/fld" },
     { "//srv/s r/fld",  "//srv/s r" },
-#else  /* WIN32 or Cygwin */
+#else /* !SVN_USE_DOS_PATHS */
     /* on non-Windows platforms, ':' is allowed in pathnames */
     { "X:", "" },
     { "X:abc", "" },
-#endif /* non-WIN32 */
+#endif /* SVN_USE_DOS_PATHS */
   };
 
   for (i = 0; i < COUNT_OF(tests); i++)
@@ -776,7 +783,7 @@ test_dirent_canonicalize(apr_pool_t *poo
     { "X:",                   "X:" },
     { "X:foo",                "X:foo" },
     { "C:/folder/subfolder/file", "C:/folder/subfolder/file" },
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
     { "X:/",                  "X:/" },
     { "X:/./",                "X:/" },
     { "x:/",                  "X:/" },
@@ -793,7 +800,7 @@ test_dirent_canonicalize(apr_pool_t *poo
     { "//SERVER/SHare/",      "//server/SHare" },
     { "//srv/s r",            "//srv/s r" },
     { "//srv/s r/qq",         "//srv/s r/qq" },
-#endif /* WIN32 or Cygwin */
+#endif /* SVN_USE_DOS_PATHS */
   };
   int i;
 
@@ -963,15 +970,15 @@ test_uri_canonicalize(apr_pool_t *pool)
     { "s://d/c#",              "s://d/c%23" }, /* Escape schema separator */
     { "s://d/c($) .+?",        "s://d/c($)%20.+%3F" }, /* Test special chars */
     { "file:///C%3a/temp",     "file:///C:/temp" },
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
     { "file:///c:/temp/repos", "file:///C:/temp/repos" },
     { "file:///c:/temp/REPOS", "file:///C:/temp/REPOS" },
     { "file:///C:/temp/REPOS", "file:///C:/temp/REPOS" },
-#else /* WIN32 or Cygwin */
+#else /* !SVN_USE_DOS_PATHS */
     { "file:///c:/temp/repos", "file:///c:/temp/repos" },
     { "file:///c:/temp/REPOS", "file:///c:/temp/REPOS" },
     { "file:///C:/temp/REPOS", "file:///C:/temp/REPOS" },
-#endif /* non-WIN32 */
+#endif /* SVN_USE_DOS_PATHS */
   };
   int i;
 
@@ -1036,7 +1043,7 @@ test_dirent_is_canonical(apr_pool_t *poo
     { "X:foo",                 TRUE },
     { "X:foo/",                FALSE },
     { "file with spaces",      TRUE },
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
     { "X:/",                   TRUE },
     { "X:/foo",                TRUE },
     { "X:",                    TRUE },
@@ -1055,13 +1062,13 @@ test_dirent_is_canonical(apr_pool_t *poo
     { "//server/SHare",        TRUE },
     { "//SERVER/SHare",        FALSE },
     { "//srv/SH RE",           TRUE },
-#else /* WIN32 or Cygwin */
+#else /* !SVN_USE_DOS_PATHS */
     { "X:/",                   FALSE },
     /* Some people use colons in their filenames. */
     { ":", TRUE },
     { ".:", TRUE },
     { "foo/.:", TRUE },
-#endif /* non-WIN32 */
+#endif /* SVN_USE_DOS_PATHS */
   };
   int i;
 
@@ -1262,15 +1269,15 @@ test_uri_is_canonical(apr_pool_t *pool)
     { "file:///folder/c#",      FALSE }, /* # needs escaping */
     { "file:///fld/with space", FALSE }, /* # needs escaping */
     { "file:///fld/c%23",       TRUE }, /* Properly escaped C# */
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
     { "file:///c:/temp/repos", FALSE },
     { "file:///c:/temp/REPOS", FALSE },
     { "file:///C:/temp/REPOS", TRUE },
-#else /* WIN32 or Cygwin */
+#else /* !SVN_USE_DOS_PATHS */
     { "file:///c:/temp/repos", TRUE },
     { "file:///c:/temp/REPOS", TRUE },
     { "file:///C:/temp/REPOS", TRUE },
-#endif /* non-WIN32 */
+#endif /* SVN_USE_DOS_PATHS */
   };
   int i;
 
@@ -1324,23 +1331,23 @@ test_dirent_split(apr_pool_t *pool)
     { "/",               "/",             "" },
     { "X:/foo/bar",      "X:/foo",        "bar" },
     { "X:foo/bar",       "X:foo",         "bar" },
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
     { "X:/",             "X:/",           "" },
     { "X:/foo",          "X:/",           "foo" },
     { "X:foo",           "X:",            "foo" },
     { "//srv/shr",       "//srv/shr",     "" },
     { "//srv/shr/fld",   "//srv/shr",     "fld" },
     { "//srv/s r",       "//srv/s r",     "" },
-#else /* WIN32 or Cygwin */
+#else /* !SVN_USE_DOS_PATHS */
     { "X:foo",           SVN_EMPTY_PATH,  "X:foo" },
-#endif /* non-WIN32 */
+#endif /* SVN_USE_DOS_PATHS */
   };
 
   for (i = 0; i < COUNT_OF(paths); i++)
     {
       const char *dir, *base_name;
 
-      svn_dirent_split(paths[i][0], &dir, &base_name, pool);
+      svn_dirent_split(&dir, &base_name, paths[i][0], pool);
       if (strcmp(dir, paths[i][1]))
         {
           return svn_error_createf
@@ -1375,7 +1382,7 @@ test_relpath_split(apr_pool_t *pool)
     {
       const char *dir, *base_name;
 
-      svn_relpath_split(paths[i][0], &dir, &base_name, pool);
+      svn_relpath_split( &dir, &base_name, paths[i][0], pool);
       if (strcmp(dir, paths[i][1]))
         {
           return svn_error_createf
@@ -1414,7 +1421,7 @@ test_uri_split(apr_pool_t *pool)
     {
       const char *dir, *base_name;
 
-      svn_uri_split(paths[i][0], &dir, &base_name, pool);
+      svn_uri_split(&dir, &base_name, paths[i][0], pool);
       if (strcmp(dir, paths[i][1]))
         {
           return svn_error_createf
@@ -1461,7 +1468,7 @@ test_dirent_is_ancestor(apr_pool_t *pool
     { SVN_EMPTY_PATH,    SVN_EMPTY_PATH,  TRUE},
     { "/",               "/",             TRUE},
     { "X:foo",           "X:bar",         FALSE},
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
     { "//srv/shr",       "//srv",         FALSE},
     { "//srv/shr",       "//srv/shr/fld", TRUE },
     { "//srv/s r",       "//srv/s r/fld", TRUE },
@@ -1473,10 +1480,10 @@ test_dirent_is_ancestor(apr_pool_t *pool
     { "X:/",             "X:/foo",        TRUE},
     { "X:",              "X:foo",         TRUE},
     { SVN_EMPTY_PATH,    "C:/",           FALSE},
-#else /* WIN32 or Cygwin */
+#else /* !SVN_USE_DOS_PATHS */
     { "X:",              "X:foo",         FALSE},
     { SVN_EMPTY_PATH,    "C:/",           TRUE},
-#endif /* non-WIN32 */
+#endif /* SVN_USE_DOS_PATHS */
   };
 
   for (i = 0; i < COUNT_OF(tests); i++)
@@ -1612,7 +1619,7 @@ test_dirent_skip_ancestor(apr_pool_t *po
     { "foo/bar",         "foo",             "foo"},
     { "/foo/bar",        "foo",             "foo"},
     { "/",               "bar/bla",         "bar/bla"},
-#ifdef WIN32
+#ifdef SVN_USE_DOS_PATHS
     { "A:/foo",          "A:/foo/bar",      "bar"},
     { "A:/foo",          "A:/foot",         "A:/foot"},
     { "A:/",             "A:/foo",          "foo"},
@@ -1750,7 +1757,7 @@ test_dirent_get_longest_ancestor(apr_poo
     { "/",              "/",               "/"},
     { "X:foo",          "Y:foo",           SVN_EMPTY_PATH},
     { "X:/folder1",     "Y:/folder2",      SVN_EMPTY_PATH},
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
     { "X:/",            "X:/",             "X:/"},
     { "X:/foo/bar/A/D/H/psi", "X:/foo/bar/A/B", "X:/foo/bar/A" },
     { "X:/foo/bar/boo", "X:/foo/bar/baz/boz", "X:/foo/bar"},
@@ -1764,12 +1771,12 @@ test_dirent_get_longest_ancestor(apr_poo
     { "X:",             "X:foo",           "X:"},
     { "X:",             "X:/",             SVN_EMPTY_PATH},
     { "X:foo",          "X:bar",           "X:"},
-#else /* WIN32 or Cygwin */
+#else /* !SVN_USE_DOS_PATHS */
     { "X:/foo",         "X:",              "X:"},
     { "X:/folder1",     "X:/folder2",      "X:"},
     { "X:",             "X:foo",           SVN_EMPTY_PATH},
     { "X:foo",          "X:bar",           SVN_EMPTY_PATH},
-#endif /* non-WIN32 */
+#endif /* SVN_USE_DOS_PATHS */
   };
 
   for (i = 0; i < COUNT_OF(tests); i++)
@@ -1945,7 +1952,7 @@ test_dirent_is_child(apr_pool_t *pool)
     ".foo",
     "/",
     "foo2",
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
     "//srv",
     "//srv2",
     "//srv/shr",
@@ -1960,7 +1967,7 @@ test_dirent_is_child(apr_pool_t *pool)
     "H:",
     "H:foo",
     "H:foo/baz",
-#endif /* Win32 and Cygwin */
+#endif /* SVN_USE_DOS_PATHS */
     };
 
   /* Maximum number of path[] items for all platforms */
@@ -1991,7 +1998,7 @@ test_dirent_is_child(apr_pool_t *pool)
       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
     { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
     /* //srv paths */
     { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
       0, 0, "shr", "shr/fld", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
@@ -2024,7 +2031,7 @@ test_dirent_is_child(apr_pool_t *pool)
       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "baz" },
     { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-#endif /* Win32 and Cygwin */
+#endif /* SVN_USE_DOS_PATHS */
   };
 
   for (i = 0; i < COUNT_OF(paths); i++)
@@ -2233,10 +2240,10 @@ test_dirent_get_absolute(apr_pool_t *poo
   int i;
   const char *curdir;
   char buf[8192];
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
   const char *curdironc;
   char curdrive[3] = "C:";
-#endif /* WIN32 */
+#endif /* SVN_USE_DOS_PATHS */
 
   struct {
     const char *path;
@@ -2245,7 +2252,7 @@ test_dirent_get_absolute(apr_pool_t *poo
     /* '%' will be replaced by the current working dir. */
     { "abc", "%/abc" },
     { SVN_EMPTY_PATH, "%" },
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
     /* '@' will be replaced by the current working dir on C:\. */
     /* '$' will be replaced by the current drive */
     { "C:/", "C:/" },
@@ -2262,12 +2269,12 @@ test_dirent_get_absolute(apr_pool_t *poo
     { "//srv/shr",      "//srv/shr" },
     { "//srv/shr/fld",  "//srv/shr" },
     { "//srv/shr/fld/subfld", "//srv/shr/fld" }, */
-#else  /* WIN32 or Cygwin */
+#else /* !SVN_USE_DOS_PATHS */
     { "/abc", "/abc" },
     { "/x/abc", "/x/abc" },
     { "X:", "%/X:" },
     { "X:abc", "%/X:abc" },
-#endif /* non-WIN32 */
+#endif /* SVN_USE_DOS_PATHS */
   };
 
   if (! getcwd(buf, sizeof(buf)))
@@ -2275,13 +2282,13 @@ test_dirent_get_absolute(apr_pool_t *poo
 
   curdir = svn_dirent_internal_style(buf, pool);
 
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
   if (! getdcwd(3, buf, sizeof(buf))) /* 3 stands for drive C: */
     return svn_error_create(SVN_ERR_BASE, NULL, "getdcwd() failed");
 
   curdironc = svn_dirent_internal_style(buf, pool);
   curdrive[0] = curdir[0];
-#endif /* WIN32 */
+#endif /* SVN_USE_DOS_PATHS */
 
   for (i = 0 ; i < COUNT_OF(tests) ; i++ )
     {
@@ -2292,7 +2299,7 @@ test_dirent_get_absolute(apr_pool_t *poo
       expect_abs = expect;
       if (*expect == '%')
         expect_abs = apr_pstrcat(pool, curdir, expect + 1, NULL);
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
       if (*expect == '@')
         expect_abs = apr_pstrcat(pool, curdironc, expect + 1, NULL);
 
@@ -2301,7 +2308,7 @@ test_dirent_get_absolute(apr_pool_t *poo
 
       /* Remove double '/' when CWD was the root dir (E.g. C:/) */
       expect_abs = svn_dirent_canonicalize(expect_abs, pool);
-#endif /* WIN32 */
+#endif /* SVN_USE_DOS_PATHS */
 
       SVN_ERR(svn_dirent_get_absolute(&result, path, pool));
       if (strcmp(result, expect_abs))
@@ -2389,7 +2396,7 @@ test_dirent_condense_targets(apr_pool_t 
     { { "/dir", "/dir/file", NULL },         NULL,     { "", "file" } },
     { { "/dir1", "/dir2", NULL },            NULL,     { "dir1", "dir2" } },
     { { "dir1", "dir2", NULL },              NULL,     { "dir1", "dir2" } },
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
     { {"C:/", "C:/zeta", NULL},              "C:/",    {"", "zeta"} },
     { {"C:/dir", "C:/dir/zeta", NULL},       "C:/dir", {"", "zeta"} },
     { {"C:/dir/omega", "C:/dir/zeta", NULL}, "C:/dir", {"omega", "zeta" } },
@@ -2518,7 +2525,7 @@ test_dirent_local_style(apr_pool_t *pool
   } tests[] = {
     { "",                     "." },
     { ".",                    "." },
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
     { "A:/",                 "A:\\" },
     { "A:/file",             "A:\\file" },
     { "a:/",                 "A:\\" },
@@ -2561,7 +2568,7 @@ test_relpath_local_style(apr_pool_t *poo
     { "",                     "." },
     { ".",                    "." },
     { "c:hi",                 "c:hi" },
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
     { "dir/file",             "dir\\file" },
     { "a:/file",              "a:\\file" },
 #else
@@ -2598,7 +2605,7 @@ test_dirent_internal_style(apr_pool_t *p
     { "file",                "file" },
     { "dir/file",            "dir/file" },
     { "dir/file/./.",        "dir/file" },
-#if defined(WIN32) || defined(__CYGWIN__)
+#ifdef SVN_USE_DOS_PATHS
     { "A:\\",                "A:/" },
     { "A:\\file",            "A:/file" },
     { "A:file",              "A:file" },
@@ -2670,6 +2677,121 @@ test_relpath_internal_style(apr_pool_t *
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_dirent_from_file_url(apr_pool_t *pool)
+{
+  struct {
+    const char *url;
+    const char *result;
+  } tests[] = {
+    { "file://",                   "/" },
+    { "file:///dir",               "/dir" },
+    { "file:///dir/path",          "/dir/path" },
+    { "file://localhost",          "/" },
+    { "file://localhost/dir",      "/dir" },
+    { "file://localhost/dir/path", "/dir/path" },
+#ifdef SVN_USE_DOS_PATHS
+    { "file://server/share",       "//server/share" },
+    { "file://server/share/dir",   "//server/share/dir" },
+    { "file:///A:",                "A:/" },
+    { "file:///A:/dir",            "A:/dir" },
+    { "file:///A:dir",             "A:dir" },
+    { "file:///A%7C",              "A:/" },
+    { "file:///A%7C/dir",          "A:/dir" },
+    { "file:///A%7Cdir",           "A:dir" },
+#endif
+  };
+  int i;
+
+  for (i = 0; i < COUNT_OF(tests); i++)
+    {
+      const char *result;
+      
+      SVN_ERR(svn_uri_get_dirent_from_file_url(&result, tests[i].url, pool));
+
+      if (strcmp(result, tests[i].result))
+        return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
+                                 "svn_uri_get_dirent_from_file_url(\"%s\") "
+                                 "returned \"%s\" expected \"%s\"",
+                                 tests[i].url, result, tests[i].result);
+    }
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+test_dirent_from_file_url_errors(apr_pool_t *pool)
+{
+  const char *bad_file_urls[] = {
+    /* error if scheme is not "file" */
+    "http://localhost/dir",
+    "file+ssh://localhost/dir",
+#ifndef SVN_USE_DOS_PATHS
+    "file://localhostwrongname/dir",  /* error if host name not "localhost" */
+#endif
+  };
+  int i;
+
+  for (i = 0; i < COUNT_OF(bad_file_urls); i++)
+    {
+      const char *result;
+      svn_error_t *err;
+
+      err = svn_uri_get_dirent_from_file_url(&result, bad_file_urls[i],
+                                             pool);
+
+      if (err == NULL)
+        return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
+                                 "svn_uri_get_dirent_from_file_url(\"%s\") "
+                                 "didn't return an error.",
+                                 bad_file_urls[i]);
+      svn_error_clear(err);
+    }
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+test_file_url_from_dirent(apr_pool_t *pool)
+{
+  struct {
+    const char *dirent;
+    const char *result;
+  } tests[] = {
+#ifdef SVN_USE_DOS_PATHS
+    { "C:/file",                   "file:///C:/file" },
+    { "C:/",                       "file:///C:/" },
+    { "C:/File#$",                 "file:///C:/File%23$" },
+    /* We can't check these as svn_dirent_get_absolute() won't work
+       on shares that don't exist */
+    /*{ "//server/share",            "file://server/share" },
+    { "//server/share/file",       "file://server/share/file" },*/
+#else
+    { "/a/b",                      "file:///a/b" },
+    { "/a",                        "file:///a" },
+    { "/",                         "file:///" },
+    { "/File#$",                   "file:///File%23$" },
+#endif
+  };
+  int i;
+
+  for (i = 0; i < COUNT_OF(tests); i++)
+    {
+      const char *result;
+      
+      SVN_ERR(svn_uri_get_file_url_from_dirent(&result, tests[i].dirent,
+                                               pool));
+
+      if (strcmp(result, tests[i].result))
+        return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
+                                 "svn_uri_get_file_url_from_dirent(\"%s\") "
+                                 "returned \"%s\" expected \"%s\"",
+                                 tests[i].dirent, result, tests[i].result);
+    }
+
+  return SVN_NO_ERROR;
+}
+
 
 /* The test table.  */
 
@@ -2762,5 +2884,11 @@ struct svn_test_descriptor_t test_funcs[
                    "test svn_dirent_internal_style"),
     SVN_TEST_PASS2(test_relpath_internal_style,
                    "test svn_relpath_internal_style"),
+    SVN_TEST_PASS2(test_dirent_from_file_url,
+                   "test svn_uri_get_dirent_from_file_url"),
+    SVN_TEST_PASS2(test_dirent_from_file_url_errors,
+                   "test svn_uri_get_dirent_from_file_url errors"),
+    SVN_TEST_PASS2(test_file_url_from_dirent,
+                   "test svn_uri_get_file_url_from_dirent"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/ignore-mergeinfo/subversion/tests/libsvn_wc/db-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/libsvn_wc/db-test.c?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/libsvn_wc/db-test.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/libsvn_wc/db-test.c Tue Aug 10 22:07:24 2010
@@ -838,9 +838,9 @@ test_working_info(apr_pool_t *pool)
   const char *original_root_url;
   const char *original_uuid;
   svn_revnum_t original_revnum;
-  svn_boolean_t text_mod;
   svn_boolean_t props_mod;
-  svn_boolean_t base_shadowed;
+  svn_boolean_t have_base;
+  svn_boolean_t have_work;
   svn_boolean_t conflicted;
   svn_wc__db_lock_t *lock;
   svn_wc__db_t *db;
@@ -857,7 +857,7 @@ test_working_info(apr_pool_t *pool)
             &depth, &checksum, &translated_size, &target,
             &changelist, &original_repos_relpath, &original_root_url,
             &original_uuid, &original_revnum,
-            &text_mod, &props_mod, &base_shadowed,
+            &props_mod, &have_base, &have_work,
             &conflicted, &lock,
             db, svn_dirent_join(local_abspath, "I", pool),
             pool, pool));
@@ -879,9 +879,9 @@ test_working_info(apr_pool_t *pool)
   SVN_TEST_STRING_ASSERT(original_root_url, ROOT_TWO);
   SVN_TEST_STRING_ASSERT(original_uuid, UUID_TWO);
   SVN_TEST_ASSERT(original_revnum == 2);
-  SVN_TEST_ASSERT(text_mod == FALSE);
   SVN_TEST_ASSERT(props_mod == FALSE);
-  SVN_TEST_ASSERT(base_shadowed == TRUE);
+  SVN_TEST_ASSERT(have_base == TRUE);
+  SVN_TEST_ASSERT(have_work == TRUE);
   SVN_TEST_ASSERT(conflicted == FALSE);
   SVN_TEST_ASSERT(lock == NULL);
 

Modified: subversion/branches/ignore-mergeinfo/subversion/tests/libsvn_wc/pristine-store-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/libsvn_wc/pristine-store-test.c?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/libsvn_wc/pristine-store-test.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/libsvn_wc/pristine-store-test.c Tue Aug 10 22:07:24 2010
@@ -43,6 +43,7 @@
 #include "../../libsvn_wc/wc.h"
 #include "../../libsvn_wc/wc_db.h"
 #include "../../libsvn_wc/wc-queries.h"
+#include "../../libsvn_wc/workqueue.h"
 
 #include "private/svn_wc_private.h"
 
@@ -85,7 +86,7 @@ create_repos_and_wc(const char **repos_u
     svn_repos_t *repos;
 
     SVN_ERR(svn_test__create_repos(&repos, repos_path, opts, pool));
-    SVN_ERR(svn_test__current_directory_url(repos_url, repos_path, pool));
+    SVN_ERR(svn_uri_get_file_url_from_dirent(repos_url, repos_path, pool));
   }
 
   /* Create a WC */
@@ -226,11 +227,103 @@ pristine_write_read(const svn_test_opts_
   return SVN_NO_ERROR;
 }
 
+/* Test the WQ item for getting and translating a text. */
+static svn_error_t *
+pristine_get_translated(const svn_test_opts_t *opts,
+                        apr_pool_t *pool)
+{
+  svn_wc__db_t *db;
+  const char *repos_url;
+  const char *wc_abspath, *versioned_abspath, *new_abspath;
+  const char data[] = "Blah at r$Rev$\n";
+  const char expected_data[] = "Blah at r$Rev: -1 $\n";
+  svn_checksum_t *data_sha1, *data_md5;
+
+  SVN_ERR(create_repos_and_wc(&repos_url, &wc_abspath, &db,
+                              "pristine_get_translated", opts, pool));
+
+  versioned_abspath = svn_dirent_join(wc_abspath, "foo", pool);
+  new_abspath = svn_dirent_join(wc_abspath, "foo.fetched", pool);
+
+  /* Create VERSIONED_ABSPATH, whose metadata will be used for the
+     translation. Set some properties on it. */
+  {
+    svn_wc_context_t *wc_ctx;
+
+    SVN_ERR(svn_wc__context_create_with_db(&wc_ctx, NULL, db, pool));
+    SVN_ERR(svn_io_file_create(versioned_abspath, data, pool));
+    SVN_ERR(svn_wc_add4(wc_ctx, versioned_abspath, svn_depth_empty,
+                        NULL, SVN_INVALID_REVNUM, NULL, NULL, NULL, NULL,
+                        pool));
+    SVN_ERR(svn_wc_prop_set4(wc_ctx, versioned_abspath,
+                             "svn:keywords", svn_string_create("Rev", pool),
+                             FALSE, NULL, NULL, pool));
+  }
+
+  /* Store a pristine text, and set DATA_SHA1 and DATA_MD5. */
+  {
+    const char *pristine_tmp_dir;
+    const char *pristine_tmp_abspath;
+    svn_stream_t *pristine_tmp_stream;
+
+    SVN_ERR(svn_wc__db_pristine_get_tempdir(&pristine_tmp_dir, db,
+                                            wc_abspath, pool, pool));
+    SVN_ERR(svn_stream_open_unique(&pristine_tmp_stream, &pristine_tmp_abspath,
+                                   pristine_tmp_dir, svn_io_file_del_none,
+                                   pool, pool));
+
+    pristine_tmp_stream = svn_stream_checksummed2(
+                            pristine_tmp_stream, NULL, &data_sha1,
+                            svn_checksum_sha1, TRUE, pool);
+    pristine_tmp_stream = svn_stream_checksummed2(
+                            pristine_tmp_stream, NULL, &data_md5,
+                            svn_checksum_md5, TRUE, pool);
+
+    SVN_ERR(svn_stream_printf(pristine_tmp_stream, pool, "%s", data));
+    SVN_ERR(svn_stream_close(pristine_tmp_stream));
+
+    SVN_ERR(svn_wc__db_pristine_install(db, pristine_tmp_abspath,
+                                        data_sha1, data_md5, pool));
+  }
+
+  /* Run a work item to read and translate the text into NEW_ABSPATH. */
+  {
+    svn_skel_t *work_item;
+
+    SVN_ERR(svn_wc__wq_build_pristine_get_translated(&work_item,
+                                                     db, versioned_abspath,
+                                                     new_abspath, data_sha1,
+                                                     pool, pool));
+    SVN_ERR(svn_wc__db_wq_add(db, versioned_abspath, work_item, pool));
+
+    SVN_ERR(svn_wc__wq_run(db, wc_abspath, NULL, NULL, pool));
+  }
+
+  /* Check that NEW_ABSPATH has been created with the translated text. */
+  {
+    svn_stream_t *expected_stream
+      = svn_stream_from_string(svn_string_create(expected_data, pool), pool);
+    svn_stream_t *file_stream;
+    svn_boolean_t same;
+
+    SVN_ERR(svn_stream_open_readonly(&file_stream, new_abspath,
+                                     pool, pool));
+    SVN_ERR(svn_stream_contents_same2(&same, expected_stream, file_stream,
+                                      pool));
+
+    SVN_TEST_ASSERT(same);
+  }
+
+  return SVN_NO_ERROR;
+}
+
 
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,
     SVN_TEST_OPTS_PASS(pristine_write_read,
                        "pristine_write_read"),
+    SVN_TEST_OPTS_PASS(pristine_get_translated,
+                       "pristine_get_translated"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/ignore-mergeinfo/subversion/tests/svn_test_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/svn_test_fs.c?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/svn_test_fs.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/svn_test_fs.c Tue Aug 10 22:07:24 2010
@@ -24,13 +24,6 @@
 #include <string.h>
 #include <apr_pools.h>
 
-#ifdef _MSC_VER
-#include <direct.h>
-#define getcwd _getcwd
-#else
-#include <unistd.h> /* for getcwd() */
-#endif
-
 #include "svn_test.h"
 
 #include "svn_string.h"
@@ -238,37 +231,6 @@ svn_test__create_repos(svn_repos_t **rep
   return SVN_NO_ERROR;
 }
 
-
-/* Helper function.  Set URL to a "file://" url for the current directory,
-   suffixed by the forward-slash-style relative path SUFFIX, performing all
-   allocation in POOL. */
-svn_error_t *
-svn_test__current_directory_url(const char **url,
-                                const char *suffix,
-                                apr_pool_t *pool)
-{
-  /* 8KB is a lot, but it almost guarantees that any path will fit. */
-  char curdir[8192];
-  const char *utf8_ls_curdir, *utf8_is_curdir, *unencoded_url;
-
-  if (! getcwd(curdir, sizeof(curdir)))
-    return svn_error_create(SVN_ERR_BASE, NULL, "getcwd() failed");
-
-  SVN_ERR(svn_utf_cstring_to_utf8(&utf8_ls_curdir, curdir, pool));
-  utf8_is_curdir = svn_path_internal_style(utf8_ls_curdir, pool);
-
-  unencoded_url = apr_psprintf(pool, "file://%s%s%s%s",
-                               (utf8_is_curdir[0] != '/') ? "/" : "",
-                               utf8_is_curdir,
-                               (suffix[0] && suffix[0] != '/') ? "/" : "",
-                               suffix);
-
-  *url = svn_path_uri_encode(unencoded_url, pool);
-
-  return SVN_NO_ERROR;
-}
-
-
 svn_error_t *
 svn_test__stream_to_string(svn_stringbuf_t **string,
                            svn_stream_t *stream,

Modified: subversion/branches/ignore-mergeinfo/subversion/tests/svn_test_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/svn_test_fs.h?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/svn_test_fs.h (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/svn_test_fs.h Tue Aug 10 22:07:24 2010
@@ -73,14 +73,6 @@ svn_test__create_repos(svn_repos_t **rep
                        const svn_test_opts_t *opts,
                        apr_pool_t *pool);
 
-/* Set URL to a "file://" url for the current directory, suffixed by the
-   forward-slash-style relative path SUFFIX, performing all allocation
-   in POOL. */
-svn_error_t *
-svn_test__current_directory_url(const char **url,
-                                const char *suffix,
-                                apr_pool_t *pool);
-
 /* Read all data from a generic read STREAM, and return it in STRING.
    Allocate the svn_stringbuf_t in POOL.  (All data in STRING will be
    dup'ed from STREAM using POOL too.) */

Modified: subversion/branches/ignore-mergeinfo/subversion/tests/svn_test_main.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/svn_test_main.c?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/svn_test_main.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/svn_test_main.c Tue Aug 10 22:07:24 2010
@@ -50,6 +50,13 @@ const char **test_argv;
 /* Test option: Print more output */
 static svn_boolean_t verbose_mode = FALSE;
 
+/* Test option: Trap SVN_ERR_ASSERT failures in the code under test. Default
+ * is false so the test can easily be run in a debugger with the debugger
+ * catching the assertion failure. Test suites should enable this in order
+ * to be able to continue with other sub-tests and report the results even
+ * when a test hits an assertion failure. */
+static svn_boolean_t trap_assertion_failures = FALSE;
+
 /* Test option: Print only unexpected results */
 static svn_boolean_t quiet_mode = FALSE;
 
@@ -62,6 +69,7 @@ enum {
   fstype_opt,
   list_opt,
   verbose_opt,
+  trap_assert_opt,
   quiet_opt,
   config_opt,
   server_minor_version_opt
@@ -82,6 +90,8 @@ static const apr_getopt_option_t cl_opti
   {"server-minor-version", server_minor_version_opt, 1,
                     N_("set the minor version for the server ('3', '4',\n"
                        "'5', or '6')")},
+  {"trap-assertion-failures", trap_assert_opt, 0,
+                    N_("catch and report SVN_ERR_ASSERT failures")},
   {"quiet",         quiet_opt, 0,
                     N_("print only unexpected results")},
   {0,               0, 0, 0}
@@ -107,6 +117,7 @@ cleanup_rmtree(void *data)
 
       /* Ignore errors here. */
       svn_error_t *err = svn_io_remove_dir2(path, FALSE, NULL, NULL, pool);
+      svn_error_clear(err);
       if (verbose_mode)
         {
           if (err)
@@ -350,6 +361,9 @@ main(int argc, const char *argv[])
         case verbose_opt:
           verbose_mode = TRUE;
           break;
+        case trap_assert_opt:
+          trap_assertion_failures = TRUE;
+          break;
         case quiet_opt:
           quiet_mode = TRUE;
           break;
@@ -383,6 +397,9 @@ main(int argc, const char *argv[])
   cleanup_pool = svn_pool_create(pool);
   test_pool = svn_pool_create(pool);
 
+  if (trap_assertion_failures)
+    svn_error_set_malfunction_handler(svn_error_raise_on_malfunction);
+
   if (argc >= 2)  /* notice command-line arguments */
     {
       if (! strcmp(argv[1], "list") || list_mode)

Modified: subversion/branches/ignore-mergeinfo/tools/backup/hot-backup.py.in
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/tools/backup/hot-backup.py.in?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/tools/backup/hot-backup.py.in (original)
+++ subversion/branches/ignore-mergeinfo/tools/backup/hot-backup.py.in Tue Aug 10 22:07:24 2010
@@ -53,7 +53,8 @@ num_backups = int(os.environ.get("SVN_HO
 archive_map = {
   'gz'  : ".tar.gz",
   'bz2' : ".tar.bz2",
-  'zip' : ".zip"
+  'zip' : ".zip",
+  'zip64' : ".zip"
   }
 
 # Chmod recursively on a whole subtree
@@ -100,9 +101,10 @@ the BACKUP_PATH location, named after th
 
 Options:
   --archive-type=FMT Create an archive of the backup. FMT can be one of:
-                       bz2 : Creates a bzip2 compressed tar file.
-                       gz  : Creates a gzip compressed tar file.
-                       zip : Creates a compressed zip file.
+                       bz2  : Creates a bzip2 compressed tar file.
+                       gz   : Creates a gzip compressed tar file.
+                       zip  : Creates a compressed zip file.
+                       zip64: Creates a zip64 file (can be > 2GB).
   --num-backups=N    Number of prior backups to keep around (0 to keep all).
   --help      -h     Print this help message and exit.
 
@@ -284,7 +286,7 @@ if archive_type:
       err_msg = "Tar failed: " + str(e)
       err_code = -3
 
-  elif archive_type == 'zip':
+  elif archive_type == 'zip' or archive_type == 'zip64':
     try:
       import zipfile
       
@@ -299,7 +301,7 @@ if archive_type:
             for dirpath, dirs, files in os.walk(path):
               add_to_zip(zp, path, dirpath, dirs + files)
             
-      zp = zipfile.ZipFile(archive_path, 'w', zipfile.ZIP_DEFLATED)
+      zp = zipfile.ZipFile(archive_path, 'w', zipfile.ZIP_DEFLATED, archive_type == 'zip64')
       for dirpath, dirs, files in os.walk(backup_subdir):
         add_to_zip(zp, backup_dir, dirpath, dirs + files)
       zp.close()

Modified: subversion/branches/ignore-mergeinfo/tools/dev/unix-build/Makefile.svn
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/tools/dev/unix-build/Makefile.svn?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/tools/dev/unix-build/Makefile.svn (original)
+++ subversion/branches/ignore-mergeinfo/tools/dev/unix-build/Makefile.svn Tue Aug 10 22:07:24 2010
@@ -61,14 +61,14 @@ GNU_ICONV_VER	= 1.13.1
 APR_UTIL_VER	= 1.3.9
 HTTPD_VER	= 2.2.15
 NEON_VER	= 0.29.3
-SERF_VER	= 0.6.1
+SERF_VER	= 0.6.x
 SQLITE_VER	= 3.6.23.1
 
 BDB_DIST	= db-$(BDB_VER).tar.gz
 APR_ICONV_DIST	= apr-iconv-$(APR_ICONV_VER).tar.gz
 GNU_ICONV_DIST	= libiconv-$(GNU_ICONV_VER).tar.gz
 NEON_DIST	= neon-$(NEON_VER).tar.gz
-SERF_DIST	= serf-$(SERF_VER).tar.gz
+#SERF_DIST	= serf-$(SERF_VER).tar.gz
 SQLITE_DIST	= sqlite-$(SQLITE_VER).tar.gz
 HTTPD_DIST	= httpd-$(HTTPD_VER).tar.bz2
 
@@ -82,14 +82,15 @@ DISTFILES	= $(DISTDIR)/$(NEON_DIST) \
 FETCH_CMD	= wget -c
 
 SUBVERSION_REPOS_URL = https://svn.apache.org/repos/asf/subversion
-BDB_URL		= http://download.oracle.com/berkeley-db/$(BDB_DIST)
+BDB_URL		= http://ftp2.de.freebsd.org/pub/FreeBSD/distfiles/bdb/$(BDB_DIST)
 APR_URL		= http://svn.apache.org/repos/asf/apr/apr
 APR_ICONV_URL	= ftp://ftp.fu-berlin.de/unix/www/apache/apr/$(APR_ICONV_DIST)
 GNU_ICONV_URL	= ftp://ftp.fu-berlin.de/unix/gnu/libiconv/$(GNU_ICONV_DIST)
 APR_UTIL_URL	= http://svn.apache.org/repos/asf/apr/apr-util
 HTTPD_URL	= http://archive.apache.org/dist/httpd/$(HTTPD_DIST)
 NEON_URL	= http://webdav.org/neon/$(NEON_DIST)
-SERF_URL	= http://serf.googlecode.com/files/$(SERF_DIST)
+#SERF_URL	= http://serf.googlecode.com/files/$(SERF_DIST)
+SERF_URL	= http://serf.googlecode.com/svn/branches/$(SERF_VER)
 SQLITE_URL	= http://www.sqlite.org/$(SQLITE_DIST)
 
 BDB_SRCDIR	= $(SRCDIR)/db-$(BDB_VER)
@@ -249,7 +250,7 @@ $(APR_OBJDIR)/.configured: $(APR_OBJDIR)
 			> $(APR_SRCDIR)/build/apr_hints.m4
 	cd $(APR_SRCDIR) && ./buildconf
 	cd $(APR_OBJDIR) \
-		&& $(APR_SRCDIR)/configure \
+		&& env CFLAGS="-O0 -g" $(APR_SRCDIR)/configure \
 		--prefix=$(PREFIX)/apr \
 		--enable-maintainer-mode \
 		--disable-threads
@@ -323,22 +324,58 @@ gnu-iconv-reset:
 
 gnu-iconv-clean:
 	-(cd $(GNU_ICONV_OBJDIR) && make clean)
+	rm -f $(GNU_ICONV_OBJDIR)/lib_encodings.def.diff
+	rm -f $(GNU_ICONV_OBJDIR)/lib_aliases.gperf.diff
 
 # fetch distfile for gnu-iconv
 $(DISTDIR)/$(GNU_ICONV_DIST):
 	cd $(DISTDIR) && $(FETCH_CMD) $(GNU_ICONV_URL)
 
-# retrieve gnu-iconv
-$(GNU_ICONV_OBJDIR)/.retrieved: $(DISTDIR)/$(GNU_ICONV_DIST)
+$(GNU_ICONV_OBJDIR)/lib_encodings.def.diff:
+	[ -d $(GNU_ICONV_OBJDIR) ] || mkdir -p $(GNU_ICONV_OBJDIR)
+	echo "--- lib/encodings.def.orig	Wed Oct 24 23:41:41 2007" > $@
+	echo "+++ lib/encodings.def	Wed Oct 24 23:43:47 2007" >> $@
+	echo "@@ -37,6 +37,7 @@" >> $@
+	echo " " >> $@
+	echo " " >> $@
+	echo " DEFENCODING(( \"US-ASCII\",               /* IANA */" >> $@
+	echo "+              \"646\"," >> $@
+	echo "               \"ASCII\",                  /* IANA, JDK 1.1 */" >> $@
+	echo "               \"ISO646-US\",              /* IANA */" >> $@
+	echo "               \"ISO_646.IRV:1991\",       /* IANA */" >> $@
+
+$(GNU_ICONV_OBJDIR)/lib_aliases.gperf.diff:
 	[ -d $(GNU_ICONV_OBJDIR) ] || mkdir -p $(GNU_ICONV_OBJDIR)
+	echo "--- lib/aliases.gperf.orig	Wed Oct 24 23:41:32 2007" > $@
+	echo "+++ lib/aliases.gperf	Wed Oct 24 23:47:38 2007" >> $@
+	echo "@@ -10,6 +10,7 @@ struct alias { int name; unsigned int encoding_index; " >> $@
+	echo " %pic" >> $@
+	echo " %%" >> $@
+	echo " US-ASCII, ei_ascii" >> $@
+	echo "+646, ei_ascii" >> $@
+	echo " ASCII, ei_ascii" >> $@
+	echo " ISO646-US, ei_ascii" >> $@
+	echo " ISO_646.IRV:1991, ei_ascii" >> $@
+
+# retrieve gnu-iconv
+# Add 646 as an alias for ASCII to fix prop_test 22 on OpenBSD
+$(GNU_ICONV_OBJDIR)/.retrieved: $(DISTDIR)/$(GNU_ICONV_DIST) \
+		$(GNU_ICONV_OBJDIR)/lib_encodings.def.diff \
+		$(GNU_ICONV_OBJDIR)/lib_aliases.gperf.diff
 	tar -C $(SRCDIR) -zxf $(DISTDIR)/$(GNU_ICONV_DIST)
+	cd $(SRCDIR)/libiconv-$(GNU_ICONV_VER) && \
+		patch -p0 < $(GNU_ICONV_OBJDIR)/lib_encodings.def.diff && \
+		patch -p0 < $(GNU_ICONV_OBJDIR)/lib_aliases.gperf.diff
 	touch $@
 
 # configure gnu-iconv
 $(GNU_ICONV_OBJDIR)/.configured: $(GNU_ICONV_OBJDIR)/.retrieved
+	cd $(SRCDIR)/libiconv-${GNU_ICONV_VER} && \
+		${MAKE} -f Makefile.devel lib/aliases.h
 	cd $(GNU_ICONV_OBJDIR) \
 		&& env CFLAGS="-g" $(GNU_ICONV_SRCDIR)/configure \
-		--prefix=$(PREFIX)/iconv
+		--prefix=$(PREFIX)/iconv \
+		--enable-extra-encodings
 	touch $@
 
 # compile gnu-iconv
@@ -403,6 +440,7 @@ $(APR_UTIL_OBJDIR)/.configured: $(APR_UT
 	cd $(APR_UTIL_SRCDIR) && ./buildconf --with-apr=$(APR_SRCDIR)
 	cd $(APR_UTIL_OBJDIR) \
 		&& env LD_LIBRARY_PATH=$(PREFIX)/bdb/lib \
+			CFLAGS="-O0 -g" \
 			$(APR_UTIL_SRCDIR)/configure \
 		--prefix=$(PREFIX)/apr \
 		--enable-maintainer-mode \
@@ -505,9 +543,9 @@ neon-reset:
 neon-clean:
 	-(cd $(NEON_OBJDIR) && make clean)
 
-# fetch distfile for serf
-$(DISTDIR)/$(SERF_DIST):
-	cd $(DISTDIR) && $(FETCH_CMD) $(SERF_URL)
+# fetch distfile for neon
+$(DISTDIR)/$(NEON_DIST):
+	cd $(DISTDIR) && $(FETCH_CMD) $(NEON_URL)
 
 # retrieve neon
 $(NEON_OBJDIR)/.retrieved: $(DISTDIR)/$(NEON_DIST)
@@ -552,21 +590,30 @@ serf-clean:
 	-(cd $(SERF_SRCDIR) && ./serfmake clean)
 
 
-# fetch distfile for neon
-$(DISTDIR)/$(NEON_DIST):
-	cd $(DISTDIR) && $(FETCH_CMD) $(NEON_URL)
+# fetch distfile for serf
+#$(DISTDIR)/$(SERF_DIST):
+#	cd $(DISTDIR) && $(FETCH_CMD) $(SERF_URL)
 #
 # retrieve serf
-$(SERF_OBJDIR)/.retrieved: $(DISTDIR)/$(SERF_DIST)
+#$(SERF_OBJDIR)/.retrieved: $(DISTDIR)/$(SERF_DIST)
+#	[ -d $(SERF_OBJDIR) ] || mkdir -p $(SERF_OBJDIR)
+#	tar -C $(SRCDIR) -zxf $(DISTDIR)/$(SERF_DIST)
+#	cd $(SRCDIR)/serf-$(SERF_VER) && \
+#		svn diff -c1394 http://serf.googlecode.com/svn | patch -p2
+#	touch $@
+
+# retrieve serf if not present yet
+$(SERF_OBJDIR)/.retrieved:
 	[ -d $(SERF_OBJDIR) ] || mkdir -p $(SERF_OBJDIR)
-	tar -C $(SRCDIR) -zxf $(DISTDIR)/$(SERF_DIST)
+	if [ ! -d $(SERF_SRCDIR) ]; then \
+		svn export $(SERF_URL) $(SERF_SRCDIR); \
+	fi
 	touch $@
 
 # compile serf (serf won't compile outside its source tree)
 $(SERF_OBJDIR)/.compiled: $(SERF_OBJDIR)/.retrieved
 	cd $(SERF_SRCDIR) && \
-		./serfmake --with-apr=$(PREFIX)/apr \
-			--with-apr-util=$(PREFIX)/apr \
+		env CFLAGS="-O0 -g" ./serfmake --with-apr=$(PREFIX)/apr \
 			--prefix=$(PREFIX)/serf \
 			build
 	touch $@