[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

demarchi at webkit.org demarchi at webkit.org
Wed Dec 22 13:37:55 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit b18c7f4677d966ba011a3664fe6e1808592539cf
Author: demarchi at webkit.org <demarchi at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 22 00:38:41 2010 +0000

    2010-09-21  Lucas De Marchi  <lucas.demarchi at profusion.mobi>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [EFL] Get fresh theme when running EWebLauncher
            https://bugs.webkit.org/show_bug.cgi?id=46210
    
            If user tried to run EWebLauncher outside of the build tree, it would
            not find the theme and fallback to the installed one. However, since
            EWebLauncher is not installed, we always want to take the theme from
            the just compiled source code. If user had never installed WebKit's
            EFL port it could even receive a segv since no theme would be found.
    
            Now EWebLauncher does not fallback to the installed theme and CMake
            gives as DATA_DIR the directory of the theme it has just built.
    
            * CMakeListsEfl.txt: export DATA_DIR to parent CMakeLists.txt in order
            to be used by EWebLauncher.
    2010-09-21  Lucas De Marchi  <lucas.demarchi at profusion.mobi>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [EFL] Get fresh theme when running EWebLauncher
            https://bugs.webkit.org/show_bug.cgi?id=46210
    
            If user tried to run EWebLauncher outside of the build tree, it would
            not find the theme and fallback to the installed one. However, since
            EWebLauncher is not installed, we always want to take the theme from
            the just compiled source code. If user had never installed WebKit's
            EFL port it could even receive a segv since no theme would be found.
    
            Now EWebLauncher does not fallback to the installed theme and CMake
            gives as DATA_DIR the directory of the theme it has just built.
    
            * CMakeListsEfl.txt: Pass the build directory as DATA_DIR to
            EWebLauncher.
            * EWebLauncher/main.c: Use only the theme from build director. Do not
            fallback to others as this could hide real bugs.
            (quit):
            (browserCreate):
            (findThemePath):
            (main):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68002 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/efl/CMakeListsEfl.txt b/WebKit/efl/CMakeListsEfl.txt
index 8b77260..c154b66 100644
--- a/WebKit/efl/CMakeListsEfl.txt
+++ b/WebKit/efl/CMakeListsEfl.txt
@@ -88,8 +88,11 @@ IF (WTF_USE_CURL)
   LIST(APPEND WebKit_LIBRARIES ${CURL_LIBRARIES})
 ENDIF ()
 
-FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/WebKit/efl/DefaultTheme)
-SET(WebKit_THEME ${CMAKE_BINARY_DIR}/WebKit/efl/DefaultTheme/default.edj)
+SET(BUILD_DATA_DIR ${CMAKE_BINARY_DIR}/WebKit/efl/DefaultTheme)
+SET(BUILD_DATA_DIR ${BUILD_DATA_DIR} PARENT_SCOPE)
+FILE(MAKE_DIRECTORY ${BUILD_DATA_DIR})
+
+SET(WebKit_THEME ${BUILD_DATA_DIR}/default.edj)
 ADD_CUSTOM_COMMAND(
   OUTPUT ${WebKit_THEME}
   COMMAND ${EDJE_CC_EXECUTABLE} -v -id ${WEBKIT_DIR}/efl/DefaultTheme ${WEBKIT_DIR}/efl/DefaultTheme/default.edc ${WebKit_THEME}
diff --git a/WebKit/efl/ChangeLog b/WebKit/efl/ChangeLog
index 879a1af..5df265c 100644
--- a/WebKit/efl/ChangeLog
+++ b/WebKit/efl/ChangeLog
@@ -1,3 +1,23 @@
+2010-09-21  Lucas De Marchi  <lucas.demarchi at profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [EFL] Get fresh theme when running EWebLauncher
+        https://bugs.webkit.org/show_bug.cgi?id=46210
+
+        If user tried to run EWebLauncher outside of the build tree, it would
+        not find the theme and fallback to the installed one. However, since
+        EWebLauncher is not installed, we always want to take the theme from
+        the just compiled source code. If user had never installed WebKit's
+        EFL port it could even receive a segv since no theme would be found.
+
+        Now EWebLauncher does not fallback to the installed theme and CMake
+        gives as DATA_DIR the directory of the theme it has just built.
+
+
+        * CMakeListsEfl.txt: export DATA_DIR to parent CMakeLists.txt in order
+        to be used by EWebLauncher.
+
 2010-09-17  Darin Adler  <darin at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/WebKitTools/CMakeListsEfl.txt b/WebKitTools/CMakeListsEfl.txt
index b9086ac..732b4b3 100644
--- a/WebKitTools/CMakeListsEfl.txt
+++ b/WebKitTools/CMakeListsEfl.txt
@@ -1,5 +1,4 @@
 SET(EWebLauncher_SOURCES
-    ${WebKit_THEME}
     ${WEBKITTOOLS_DIR}/EWebLauncher/main.c
 )
 
@@ -50,6 +49,10 @@ IF (WTF_USE_CURL)
   LIST(APPEND EWebLauncher_LINK_FLAGS ${CURL_LDFLAGS})
 ENDIF ()
 
+# Override data directory. We always want to get a fresh theme.
+REMOVE_DEFINITIONS(-DDATA_DIR=\"${DATA_DIR}\")
+ADD_DEFINITIONS(-DDATA_DIR=\"${BUILD_DATA_DIR}\")
+
 INCLUDE_DIRECTORIES(${EWebLauncher_INCLUDE_DIRECTORIES})
 ADD_EXECUTABLE(Programs/EWebLauncher ${EWebLauncher_SOURCES})
 TARGET_LINK_LIBRARIES(Programs/EWebLauncher ${EWebLauncher_LIBRARIES})
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 538cf32..3977e66 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,28 @@
+2010-09-21  Lucas De Marchi  <lucas.demarchi at profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [EFL] Get fresh theme when running EWebLauncher
+        https://bugs.webkit.org/show_bug.cgi?id=46210
+
+        If user tried to run EWebLauncher outside of the build tree, it would
+        not find the theme and fallback to the installed one. However, since
+        EWebLauncher is not installed, we always want to take the theme from
+        the just compiled source code. If user had never installed WebKit's
+        EFL port it could even receive a segv since no theme would be found.
+
+        Now EWebLauncher does not fallback to the installed theme and CMake
+        gives as DATA_DIR the directory of the theme it has just built.
+
+        * CMakeListsEfl.txt: Pass the build directory as DATA_DIR to
+        EWebLauncher.
+        * EWebLauncher/main.c: Use only the theme from build director. Do not
+        fallback to others as this could hide real bugs.
+        (quit):
+        (browserCreate):
+        (findThemePath):
+        (main):
+
 2010-09-21  Dirk Pranke  <dpranke at chromium.org>
 
         Unreviewed, build fix.
diff --git a/WebKitTools/EWebLauncher/main.c b/WebKitTools/EWebLauncher/main.c
index c1956a2..7bdfc72 100644
--- a/WebKitTools/EWebLauncher/main.c
+++ b/WebKitTools/EWebLauncher/main.c
@@ -605,7 +605,10 @@ quit(Eina_Bool success, const char *msg)
     if (msg)
         fputs(msg, (success) ? stdout : stderr);
 
-    free(themePath);
+    if (themePath) {
+        free(themePath);
+        themePath = NULL;
+    }
 
     if (!success)
         return EXIT_FAILURE;
@@ -642,9 +645,6 @@ browserCreate(const char *url, const char *theme, const char *userAgent, Eina_Re
     if (!app->evas)
         return quit(EINA_FALSE, "ERROR: could not get evas from evas-ecore\n");
 
-    if (!theme)
-        theme = themePath;
-
     app->theme = theme;
     app->userAgent = userAgent;
 
@@ -741,26 +741,25 @@ main_signal_exit(void *data, int ev_type, void *ev)
 }
 
 static char *
-findThemePath(void)
+findThemePath(const char *theme)
 {
-    const char **itr, *locations[] = {
-        "./default.edj",
-        "./WebKit/efl/DefaultTheme/default.edj",
-        "../WebKit/efl/DefaultTheme/default.edj",
-        DATA_DIR"/themes/default.edj",
-        NULL
-    };
+    const char *defaultTheme = DATA_DIR"/default.edj";
+    char *rpath;
+    struct stat st;
 
-    for (itr = locations; *itr; itr++) {
-        struct stat st;
-        if (!stat(*itr, &st)) {
-            char path[PATH_MAX];
-            if (realpath(*itr, path))
-                return strdup(path);
-        }
+    if (!theme)
+        theme = defaultTheme;
+
+    rpath = realpath(theme, NULL);
+    if (!rpath)
+        return NULL;
+
+    if (stat(rpath, &st)) {
+        free(rpath);
+        return NULL;
     }
 
-    return NULL;
+    return rpath;
 }
 
 int
@@ -824,7 +823,9 @@ main(int argc, char *argv[])
     if (sudoWorkaround)
         strcat(getenv("HOME"), "blah");
 
-    themePath = findThemePath();
+    themePath = findThemePath(theme);
+    if (!themePath)
+        return quit(EINA_FALSE, "ERROR: could not find theme.\n");
 
     ewk_init();
     tmp = getenv("TMPDIR");
@@ -839,7 +840,7 @@ main(int argc, char *argv[])
     if (proxyUri)
         ewk_settings_proxy_uri_set(proxyUri);
 
-    browserCreate(url, theme, userAgent, geometry, engine, isFullscreen);
+    browserCreate(url, themePath, userAgent, geometry, engine, isFullscreen);
     ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, main_signal_exit, &windows);
 
     ecore_main_loop_begin();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list