diff options
Diffstat (limited to 'devel/seed/files')
-rw-r--r-- | devel/seed/files/patch-libseed_seed-importer.c | 49 | ||||
-rw-r--r-- | devel/seed/files/patch-modules_gettext_seed-gettext.c | 27 | ||||
-rw-r--r-- | devel/seed/files/patch-modules_os_seed-os.c | 77 |
3 files changed, 153 insertions, 0 deletions
diff --git a/devel/seed/files/patch-libseed_seed-importer.c b/devel/seed/files/patch-libseed_seed-importer.c new file mode 100644 index 000000000000..c216fa88c4a2 --- /dev/null +++ b/devel/seed/files/patch-libseed_seed-importer.c @@ -0,0 +1,49 @@ +--- libseed/seed-importer.c.orig 2009-08-10 16:23:35.000000000 -0400 ++++ libseed/seed-importer.c 2009-08-22 14:36:00.000000000 -0400 +@@ -22,6 +22,8 @@ + + #include <gio/gio.h> + #include <string.h> ++#include <stdlib.h> ++#include <unistd.h> + + #include "seed-private.h" + +@@ -637,8 +639,9 @@ seed_importer_handle_file (JSContextRef + JSValueRef js_file_dirname; + JSObjectRef global, c_global; + JSStringRef file_contents, file_name; +- gchar *contents, *walk, *file_path, *canonical, *absolute_path; ++ gchar *contents, *walk, *file_path, *canonical, *absolute_path, *normalp; + gchar *normalized_path; ++ gsize path_max; + + file_path = g_build_filename (dir, file, NULL); + canonical = seed_importer_canonicalize_path (file_path); +@@ -692,15 +695,24 @@ seed_importer_handle_file (JSContextRef + g_path_get_dirname (file_path), NULL); + } + +- normalized_path = canonicalize_file_name (absolute_path); ++#ifdef PATH_MAX ++ path_max = PATH_MAX; ++#else ++ path_max = pathconf (absolute_path, _PC_PATH_MAX); ++ if (path_max <= 0) ++ path_max = 4096; ++#endif ++ normalized_path = (gchar *) g_malloc (path_max); ++ normalp = realpath (absolute_path, normalized_path); + +- js_file_dirname = seed_value_from_string (ctx, normalized_path, NULL); ++ js_file_dirname = seed_value_from_string (ctx, normalp, NULL); + + seed_object_set_property (nctx, global, "__script_path__", js_file_dirname); + + g_hash_table_insert (file_imports, canonical, global); + g_free (file_path); + g_free (absolute_path); ++ g_free (normalized_path); + + JSEvaluateScript (nctx, file_contents, NULL, file_name, 0, exception); + diff --git a/devel/seed/files/patch-modules_gettext_seed-gettext.c b/devel/seed/files/patch-modules_gettext_seed-gettext.c new file mode 100644 index 000000000000..999f1d97a905 --- /dev/null +++ b/devel/seed/files/patch-modules_gettext_seed-gettext.c @@ -0,0 +1,27 @@ +--- modules/gettext/seed-gettext.c.orig 2009-07-26 19:23:31.000000000 -0400 ++++ modules/gettext/seed-gettext.c 2009-07-26 19:25:12.000000000 -0400 +@@ -293,12 +293,24 @@ seed_module_init(SeedEngine *local_eng) + DEFINE_ENUM_MEMBER(ns_ref, LC_MONETARY); + DEFINE_ENUM_MEMBER(ns_ref, LC_MESSAGES); + DEFINE_ENUM_MEMBER(ns_ref, LC_ALL); ++#ifdef LC_PAPER + DEFINE_ENUM_MEMBER(ns_ref, LC_PAPER); ++#endif ++#ifdef LC_NAME + DEFINE_ENUM_MEMBER(ns_ref, LC_NAME); ++#endif ++#ifdef LC_ADDRESS + DEFINE_ENUM_MEMBER(ns_ref, LC_ADDRESS); ++#endif ++#ifdef LC_TELEPHONE + DEFINE_ENUM_MEMBER(ns_ref, LC_TELEPHONE); ++#endif ++#ifdef LC_MEASUREMENT + DEFINE_ENUM_MEMBER(ns_ref, LC_MEASUREMENT); ++#endif ++#ifdef LC_IDENTIFICATION + DEFINE_ENUM_MEMBER(ns_ref, LC_IDENTIFICATION); ++#endif + DEFINE_ENUM_MEMBER(ns_ref, LC_CTYPE); + + return ns_ref; diff --git a/devel/seed/files/patch-modules_os_seed-os.c b/devel/seed/files/patch-modules_os_seed-os.c new file mode 100644 index 000000000000..1aec71b71988 --- /dev/null +++ b/devel/seed/files/patch-modules_os_seed-os.c @@ -0,0 +1,77 @@ +--- modules/os/seed-os.c.orig 2009-08-10 16:23:35.000000000 -0400 ++++ modules/os/seed-os.c 2009-08-22 14:43:42.000000000 -0400 +@@ -31,6 +31,10 @@ + #include <sys/utsname.h> + + #include <sys/types.h> ++#include <sys/ioctl.h> ++#include <termios.h> ++#include <libutil.h> ++#include <unistd.h> + + #include <fcntl.h> + +@@ -54,18 +58,32 @@ seed_os_realpath (SeedContext ctx, + const SeedValue arguments[], + SeedException * exception) + { ++ SeedValue sv; + gchar *arg; ++ gchar *resolved_path; + gchar *ret; ++ gsize path_max; + + if (argument_count != 1) + { + EXPECTED_EXCEPTION("os.realpath", "1 argument"); + } + arg = seed_value_to_string (ctx, arguments[0], exception); +- ret = canonicalize_file_name(arg); ++#ifdef PATH_MAX ++ path_max = PATH_MAX; ++#else ++ path_max = pathconf (arg, _PC_PATH_MAX); ++ if (path_max <= 0) ++ path_max = 4096; ++#endif ++ resolved_path = (gchar *) g_malloc (path_max); ++ ret = realpath(arg, resolved_path); + g_free (arg); + +- return seed_value_from_string (ctx, ret, exception); ++ sv = seed_value_from_string (ctx, ret, exception); ++ g_free (resolved_path); ++ ++ return sv; + } + + SeedValue +@@ -702,6 +720,7 @@ seed_os_fdatasync (SeedContext ctx, + const SeedValue arguments[], + SeedException * exception) + { ++#if !defined(__FreeBSD__) + gint fd; + + if (argument_count != 1) +@@ -711,6 +730,10 @@ seed_os_fdatasync (SeedContext ctx, + fd = seed_value_to_int (ctx, arguments[0], exception); + + return seed_value_from_int (ctx, fdatasync (fd), exception); ++#else ++ errno = ENOSYS; ++ return seed_value_from_int (ctx, -1, exception); ++#endif + } + + SeedValue +@@ -1112,7 +1135,9 @@ seed_module_init(SeedEngine * eng) + #if defined (O_DIRECT) + OS_DEFINE_QUICK_ENUM (O_DIRECT); + #endif ++#if defined (O_DIRECTORY) + OS_DEFINE_QUICK_ENUM (O_DIRECTORY); ++#endif + OS_DEFINE_QUICK_ENUM (O_NOFOLLOW); + #if defined (O_NOATIME) + OS_DEFINE_QUICK_ENUM (O_NOATIME); |