unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 97a2f5bd3950ef4838696fcb0a4693284704dc38 1643 bytes (raw)
name: gnu/packages/patches/idris-IDRIS_LIBRARY_PATH.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
43
44
45
46
 
From 8617ba8f391da875ea0d59c6b8fdce26b64e2abd Mon Sep 17 00:00:00 2001
From: David Craven <david@craven.ch>
Date: Sun, 6 Nov 2016 15:46:50 +0100
Subject: [PATCH 1/2] IDRIS_LIBRARY_PATH accepts a colon separated search path.

* src/Idris/Imports.hs (installedPackages): SplitOn colon and concatMap
  the results.
---
 src/Idris/Imports.hs | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/Idris/Imports.hs b/src/Idris/Imports.hs
index f7bec7be..7018ec57 100644
--- a/src/Idris/Imports.hs
+++ b/src/Idris/Imports.hs
@@ -18,6 +18,7 @@ import IRTS.System (getIdrisLibDir)
 import Control.Applicative ((<$>))
 import Control.Monad.State.Strict
 import Data.List (isSuffixOf)
+import Data.List.Split (splitOn)
 import System.Directory
 import System.FilePath
 
@@ -94,7 +95,7 @@ findPkgIndex p = do let idx = pkgIndex p
 installedPackages :: IO [String]
 installedPackages = do
   idir <- getIdrisLibDir
-  filterM (goodDir idir) =<< dirContents idir
+  filterM (goodDir idir) =<< concat <$> (mapM dirContents (splitOn ":" idir))
   where
   allFilesInDir base fp = do
     let fullpath = base </> fp
@@ -102,7 +103,9 @@ installedPackages = do
     if isDir
       then fmap concat (mapM (allFilesInDir fullpath) =<< dirContents fullpath)
       else return [fp]
-  dirContents = fmap (filter (not . (`elem` [".", ".."]))) . getDirectoryContents
+  prependDirname dir = fmap (fmap (dir </>))
+  filterPaths = fmap (filter (not . (`elem` [".", ".."])))
+  dirContents dir = prependDirname dir (filterPaths (getDirectoryContents dir))
   goodDir idir d = any (".ibc" `isSuffixOf`) <$> allFilesInDir idir d
 
 
-- 
2.11.0


debug log:

solving 97a2f5bd3 ...
found 97a2f5bd3 in https://yhetil.org/guix-devel/20161215172835.7300-1-david@craven.ch/

applying [1/1] https://yhetil.org/guix-devel/20161215172835.7300-1-david@craven.ch/
diff --git a/gnu/packages/patches/idris-IDRIS_LIBRARY_PATH.patch b/gnu/packages/patches/idris-IDRIS_LIBRARY_PATH.patch
new file mode 100644
index 000000000..97a2f5bd3

1:29: trailing whitespace.
 
1:48: trailing whitespace.
 
1:49: trailing whitespace.
 
1:50: trailing whitespace.
-- 
Checking patch gnu/packages/patches/idris-IDRIS_LIBRARY_PATH.patch...
1:52: new blank line at EOF.
+
Applied patch gnu/packages/patches/idris-IDRIS_LIBRARY_PATH.patch cleanly.
warning: 5 lines add whitespace errors.

index at:
100644 97a2f5bd3950ef4838696fcb0a4693284704dc38	gnu/packages/patches/idris-IDRIS_LIBRARY_PATH.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).