[mediatomb] Update to fix js printing routine
rmattes
rmattes at fedoraproject.org
Thu Jun 30 02:19:54 UTC 2011
commit 16f62e7eb8b77c720f8717812321fde6e3928eb1
Author: Rich Mattes <richmattes at gmail.com>
Date: Wed Jun 29 21:59:09 2011 -0400
Update to fix js printing routine
mediatomb-0.12.1-jsparse.patch | 62 ++++++++++++++++++++++++++++++++--------
mediatomb.spec | 7 +++-
2 files changed, 55 insertions(+), 14 deletions(-)
---
diff --git a/mediatomb-0.12.1-jsparse.patch b/mediatomb-0.12.1-jsparse.patch
index 59e2f83..9938939 100644
--- a/mediatomb-0.12.1-jsparse.patch
+++ b/mediatomb-0.12.1-jsparse.patch
@@ -1,7 +1,39 @@
diff -rup mediatomb-0.12.1/src/scripting/js_functions.cc ../mediatomb-0.12.1/src/scripting/js_functions.cc
---- mediatomb-0.12.1/src/scripting/js_functions.cc 2011-06-28 00:16:08.217550466 -0400
-+++ ../mediatomb-0.12.1/src/scripting/js_functions.cc 2011-06-28 00:13:27.403406447 -0400
-@@ -116,19 +116,49 @@ js_addCdsObject(JSContext *cx, uintN arg
+--- mediatomb-0.12.1/src/scripting/js_functions.cc 2011-06-29 21:51:13.641025479 -0400
++++ ../mediatomb-0.12.1/src/scripting/js_functions.cc 2011-06-29 21:49:21.071800273 -0400
+@@ -51,15 +51,28 @@ extern "C" {
+ JSBool
+ js_print(JSContext *cx, uintN argc, jsval *argv)
+ {
+- uintN i;
++ uintN i, j;
+ JSString *str;
+
+ for (i = 0; i < argc; i++)
+ {
+- str = JS_ValueToString(cx, argv[i]);
++ String fmtStr;
++ for (j = 0; j < argc; j++)
++ {
++ if (j == i)
++ fmtStr = fmtStr + "S";
++ else
++ fmtStr = fmtStr + "*";
++ }
++ if(!JS_ConvertArguments(cx, 1, JS_ARGV(cx, argv), fmtStr.c_str(), &str))
++ {
++ log_debug("Could not parse input arguments\n");
++ return JS_TRUE;
++ }
++
+ if (!str)
+ return JS_TRUE;
+- argv[i] = STRING_TO_JSVAL(str);
++
+ char * log_str = JS_EncodeString(cx, str);
+ log_js("%s\n", log_str);
+ JS_free(cx, log_str);
+@@ -116,24 +129,54 @@ js_addCdsObject(JSContext *cx, uintN arg
{
try
{
@@ -13,11 +45,11 @@ diff -rup mediatomb-0.12.1/src/scripting/js_functions.cc ../mediatomb-0.12.1/src
+ JSObject *js_cds_obj = NULL;
+ JSString *str = NULL;
+ JSString *cont = NULL;
-+
-+ String path = nil;
-+ String containerclass = nil;
- JSObject *js_cds_obj;
++ String path = nil;
++ String containerclass = nil;
++
+ JSObject *obj = JS_THIS_OBJECT(cx, argv);
JSObject *js_orig_obj = NULL;
Ref<CdsObject> orig_object;
@@ -33,21 +65,21 @@ diff -rup mediatomb-0.12.1/src/scripting/js_functions.cc ../mediatomb-0.12.1/src
+ if(!JS_ConvertArguments(cx, 1, JS_ARGV(cx, argv), "o", &js_cds_obj))
+ {
+ log_debug("Could not parse input arguments\n");
-+ return JS_FALSE;
++ return JS_TRUE;
+ }
+ break;
+ case 2:
+ if(!JS_ConvertArguments(cx, 2, JS_ARGV(cx, argv), "oS", &js_cds_obj, &str))
+ {
+ log_debug("Could not parse input arguments\n");
-+ return JS_FALSE;
++ return JS_TRUE;
+ }
+ break;
+ default:
+ if(!JS_ConvertArguments(cx, 3, JS_ARGV(cx, argv), "oSS", &js_cds_obj, &str, &cont))
+ {
+ log_debug("Could not parse input arguments\n");
-+ return JS_FALSE;
++ return JS_TRUE;
+ }
+ break;
+ }
@@ -57,7 +89,13 @@ diff -rup mediatomb-0.12.1/src/scripting/js_functions.cc ../mediatomb-0.12.1/src
if (self == NULL)
{
-@@ -144,23 +174,14 @@ js_addCdsObject(JSContext *cx, uintN arg
+ log_debug("Could not retrieve class instance from global object\n");
+- return JS_FALSE;
++ return JS_TRUE;
+ }
+
+ if (self->whoami() == S_PLAYLIST)
+@@ -144,23 +187,14 @@ js_addCdsObject(JSContext *cx, uintN arg
{
i2i = StringConverter::i2i();
}
@@ -82,7 +120,7 @@ diff -rup mediatomb-0.12.1/src/scripting/js_functions.cc ../mediatomb-0.12.1/src
if (cont)
{
containerclass = JS_EncodeString(cx, cont);
-@@ -169,9 +190,9 @@ js_addCdsObject(JSContext *cx, uintN arg
+@@ -169,9 +203,9 @@ js_addCdsObject(JSContext *cx, uintN arg
}
if (self->whoami() == S_PLAYLIST)
@@ -94,7 +132,7 @@ diff -rup mediatomb-0.12.1/src/scripting/js_functions.cc ../mediatomb-0.12.1/src
if (js_orig_obj == NULL)
{
-@@ -179,9 +200,6 @@ js_addCdsObject(JSContext *cx, uintN arg
+@@ -179,9 +213,6 @@ js_addCdsObject(JSContext *cx, uintN arg
return JS_TRUE;
}
diff --git a/mediatomb.spec b/mediatomb.spec
index 552f696..223b15a 100644
--- a/mediatomb.spec
+++ b/mediatomb.spec
@@ -1,7 +1,7 @@
Version: 0.12.1
Summary: UPnP AV MediaServer
Name: mediatomb
-Release: 11%{?dist}
+Release: 12%{?dist}
Summary: MediaTomb - UPnP AV Mediaserver for Linux
License: GPLv2
Group: Applications/Multimedia
@@ -13,7 +13,7 @@ Patch0: mediatomb-0.12.1.fixogg.patch
Patch1: mediatomb-0.12.1.fixbufferoverrun.patch
# Fix build issues related to GCC 4.6 (missing definitions.) Submitted upstream
Patch2: mediatomb-0.12.1.fixbuild.patch
-# Port to js-1.8 (thanks Jan!) Not yet submitted upstream
+#Port to js-1.8 (thanks Jan!) Not yet submitted upstream
Patch3: mediatomb-0.12.1.tonewjs.patch
# Fixes to the js/native code to allow custom js parsing. Not yet submitted upstream
Patch4: mediatomb-0.12.1-jsparse.patch
@@ -131,6 +131,9 @@ fi
%{_initrddir}/mediatomb
%changelog
+* Wed Jun 29 2011 Rich Mattes <richmattes at gmail.com> - 0.12.1-12
+- Update to fix js printing routine
+
* Tue Jun 28 2011 Rich Mattes <richmattes at gmail.com> - 0.12.1-11
- Added fix for custom JS parsing failure (#714466)
More information about the scm-commits
mailing list