all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pierre Neidhardt <mail@ambrevar.xyz>
To: 29686@debbugs.gnu.org
Subject: bug#29686: gnu: aspell: Do not ignore GuixOS system profile.
Date: Sat, 26 Oct 2019 13:02:34 +0200	[thread overview]
Message-ID: <87k18rahx1.fsf@ambrevar.xyz> (raw)
In-Reply-To: <87k193r09v.fsf@ambrevar.xyz>


[-- Attachment #1.1: Type: text/plain, Size: 169 bytes --]

I just noticed that Nix has a different, possibly better approach to
this in the attached patch.

What do you think?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: data-dirs-from-nix-profiles.patch --]
[-- Type: text/x-patch, Size: 1181 bytes --]

diff --git a/common/info.cpp b/common/info.cpp
index 8291cc7..6216326 100644
--- a/common/info.cpp
+++ b/common/info.cpp
@@ -36,6 +36,7 @@
 #include "strtonum.hpp"
 #include "lock.hpp"
 #include "string_map.hpp"
+#include "file_util.hpp"
 
 #include "gettext.h"
 
@@ -495,6 +496,25 @@ namespace acommon {
     lst.clear();
     lst.add(config->retrieve("data-dir"));
     lst.add(config->retrieve("dict-dir"));
+    if (config->lookup("data-dir") == NULL && config->lookup("dict-dir") == NULL) {
+        const char* cprofiles = getenv("NIX_PROFILES");
+        if (cprofiles != NULL) {
+            char* profiles = strdup(cprofiles);
+            char* profile = profiles;
+            char* end = profile;
+            while (*end != '\0') {
+                if (*end == ' ') {
+                    *end = '\0';
+                    lst.add(add_possible_dir(profile, "lib/aspell"));
+                    profile = ++end;
+                } else {
+                    ++end;
+                }
+            }
+            lst.add(add_possible_dir(profile, "lib/aspell"));
+            free(profiles);
+        }
+    }
   }
 
   DictExt::DictExt(ModuleInfo * m, const char * e)

  reply	other threads:[~2019-10-26 11:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13  6:43 bug#29686: gnu: aspell: Do not ignore GuixOS system profile Oleg Pykhalov
2017-12-13 21:52 ` Ludovic Courtès
2017-12-20 13:14   ` Ludovic Courtès
2017-12-20 14:47     ` Oleg Pykhalov
2017-12-20 20:55       ` Ludovic Courtès
2019-11-13 17:51         ` Ludovic Courtès
2019-11-14 11:22           ` Pierre Neidhardt
2019-11-14 21:39             ` Ludovic Courtès
2019-10-17 13:04 ` Pierre Neidhardt
2019-10-26 11:02   ` Pierre Neidhardt [this message]
2019-10-27 22:31     ` Ludovic Courtès
2019-10-28  7:42       ` Pierre Neidhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k18rahx1.fsf@ambrevar.xyz \
    --to=mail@ambrevar.xyz \
    --cc=29686@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.