[gnome-weather] package: look for gnome-weather.doap instead of src/
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-weather] package: look for gnome-weather.doap instead of src/
- Date: Sat, 4 May 2013 13:57:58 +0000 (UTC)
commit b351f4bb624e86eb1b02f7655edaa24e1cb9c5fb
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]