unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 06d529872da518f177d2e796d9ef42734f2da748 1660 bytes (raw)
name: gnu/packages/patches/gnome-tweak-tool-search-paths.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
 
--- gnome-tweak-tool-3.18.1.orig/gtweak/gsettings.py	2015-04-08 15:21:32.000000000 +0200
+++ gnome-tweak-tool-3.18.1/gtweak/gsettings.py	2016-04-03 11:26:38.658482704 +0200
@@ -16,7 +16,8 @@
 # along with gnome-tweak-tool.  If not, see <http://www.gnu.org/licenses/>.
 
 import logging
-import os.path
+import os
+import sys
 import xml.dom.minidom
 import gettext
 
@@ -31,6 +32,13 @@
 class GSettingsMissingError(Exception):
     pass
 
+def file_from_path(path, file_name):
+    for dir in path:
+        f = os.path.join(dir, file_name)
+        if os.path.exists(f):
+            return f
+    return None
+
 class _GSettingsSchema:
     def __init__(self, schema_name, schema_dir=None, schema_filename=None, **options):
         if not schema_dir:
@@ -38,9 +46,14 @@
         if not schema_filename:
             schema_filename = schema_name + ".gschema.xml"
 
+        schema_prefix = os.path.join('glib-2.0', 'schemas')
         schema_path = os.path.join(schema_dir, schema_filename)
         if not os.path.exists(schema_path):
-            logging.critical("Could not find schema %s" % schema_path)
+            schema_path = file_from_path(os.environ.get ('GSETTINGS_SCHEMA_PATH', '').split(os.path.pathsep), schema_filename)
+        if not (schema_path and os.path.exists(schema_path)):
+            schema_path = file_from_path(os.environ.get ('XDG_DATA_DIRS', '').split(os.path.pathsep), os.path.join(schema_prefix, schema_filename))
+        if not (schema_path and os.path.exists(schema_path)):
+            logging.critical("Could not find schema %s" % schema_filename)
             assert(False)
 
         self._schema_name = schema_name

debug log:

solving 06d5298 ...
found 06d5298 in https://yhetil.org/guix-devel/87vb3z3q89.fsf@drakenvlieg.flower/

applying [1/1] https://yhetil.org/guix-devel/87vb3z3q89.fsf@drakenvlieg.flower/
diff --git a/gnu/packages/patches/gnome-tweak-tool-search-paths.patch b/gnu/packages/patches/gnome-tweak-tool-search-paths.patch
new file mode 100644
index 0000000..06d5298

1:11: trailing whitespace.
 
1:18: trailing whitespace.
 
1:22: trailing whitespace.
 
1:36: trailing whitespace.
 
1:47: trailing whitespace.
 
Checking patch gnu/packages/patches/gnome-tweak-tool-search-paths.patch...
Applied patch gnu/packages/patches/gnome-tweak-tool-search-paths.patch cleanly.
warning: 5 lines add whitespace errors.

index at:
100644 06d529872da518f177d2e796d9ef42734f2da748	gnu/packages/patches/gnome-tweak-tool-search-paths.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).