[gnome-weather/gnome-3-8] package: look for gnome-weather.doap instead of src/



commit 0a4fc1609c929002ab45beddf3464f929e33dd42
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sat May 4 15:52:26 2013 +0200

    package: look for gnome-weather.doap instead of src/
    
    Apparently, it's not uncommon to have src/ in the home directory.
    This is still wrong, because I might be running the installed version
    from the source tree. The right check is to look at the launched
    script and see if it is a descedendant of the current directory
    (like ./src/gnome-weather), but that's not possible because gjs
    does not include the file as ARGV[0].
    
    Also, fix taking up JS modules when running uninstalled.

 src/package.js |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/package.js b/src/package.js
index 67d98d1..26f26d1 100644
--- a/src/package.js
+++ b/src/package.js
@@ -100,8 +100,8 @@ function init(params) {
     datadir = GLib.build_filenamev([prefix, 'share']);
     let libpath, girpath;
 
-    if (GLib.file_test('./src',
-                       GLib.FileTest.IS_DIR)) {
+    if (GLib.file_test(name + '.doap',
+                       GLib.FileTest.EXISTS)) {
         log('Running from source tree, using local files');
         // Running from source directory
         _base = GLib.get_current_dir();
@@ -121,7 +121,7 @@ function init(params) {
         moduledir = pkgdatadir;
     }
 
-    imports.searchPath.push(moduledir);
+    imports.searchPath.unshift(moduledir);
     GIRepository.Repository.prepend_search_path(girpath);
     GIRepository.Repository.prepend_library_path(libpath);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]