[gnome-weather] package: fix source tree check for the jhbuild-in-$HOME case



commit 634f3b46bf722f96d10f5ee5ceb43f634baee817
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sat Jun 15 17:14:26 2013 +0200

    package: fix source tree check for the jhbuild-in-$HOME case
    
    Previously we were generically checking if the binary was launched
    somewhere from '.', under the assumption that packages are installed
    in /usr or /opt, so invocations like './.../' are only for uninstalled.
    This breaks if one configures jhbuild to install somewhere in the
    home directory, so instead we should check for ./src/$pkgname explicitly.
    In any case, running './program' from src/ would not work anyway,
    as the other relative paths would be wrong.

 src/package.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/package.js b/src/package.js
index 35f3319..34e0b96 100644
--- a/src/package.js
+++ b/src/package.js
@@ -50,8 +50,8 @@ function _runningFromSource(name) {
         let fileName = System.programInvocationName;
 
         let binary = Gio.File.new_for_path(fileName);
-        let cwd = Gio.File.new_for_path('.');
-        return binary.has_prefix(cwd);
+        let sourceBinary = Gio.File.new_for_path('./src/' + name);
+        return binary.equal(sourceBinary);
     } else {
         return GLib.file_test(name + '.doap',
                               GLib.FileTest.EXISTS);


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