unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob d3024a5c9694d494e0f9be8b8e652fefba1fc13f 1995 bytes (raw)
name: gnu/packages/patches/minetest-subgame-env-var.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
47
48
49
50
51
52
 
From 80a1054060006e9e6c3f87d8c0826b1f620789f1 Mon Sep 17 00:00:00 2001
From: David Thompson <dthompson2@worcester.edu>
Date: Sat, 6 Sep 2014 13:21:46 -0400
Subject: [PATCH] Search for subgames using $MINETEST_SUBGAME_PATH.

---
 src/subgame.cpp | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/subgame.cpp b/src/subgame.cpp
index f2465c9..24a4af5 100644
--- a/src/subgame.cpp
+++ b/src/subgame.cpp
@@ -66,6 +66,19 @@ SubgameSpec findSubgame(const std::string &id)
 	std::string share = porting::path_share;
 	std::string user = porting::path_user;
 	std::vector<GameFindPath> find_paths;
+
+        char *search_paths = getenv("MINETEST_SUBGAME_PATH");
+        char *search_path = strtok(search_paths, ":");
+
+        while(search_path != NULL) {
+                std::string path = std::string(search_path);
+                find_paths.push_back(GameFindPath(
+                                       path + DIR_DELIM + id, false));
+                find_paths.push_back(GameFindPath(
+                                       path + DIR_DELIM + id + "_game", false));
+                search_path = strtok(NULL, ":");
+        }
+
 	find_paths.push_back(GameFindPath(
 			user + DIR_DELIM + "games" + DIR_DELIM + id + "_game", true));
 	find_paths.push_back(GameFindPath(
@@ -129,6 +142,15 @@ std::set<std::string> getAvailableGameIds()
 	std::set<std::string> gamespaths;
 	gamespaths.insert(porting::path_share + DIR_DELIM + "games");
 	gamespaths.insert(porting::path_user + DIR_DELIM + "games");
+
+        char *search_paths = getenv("MINETEST_SUBGAME_PATH");
+        char *search_path = strtok(search_paths, ":");
+
+        while(search_path != NULL) {
+                gamespaths.insert(std::string(search_path));
+                search_path = strtok(NULL, ":");
+        }
+
 	for(std::set<std::string>::const_iterator i = gamespaths.begin();
 			i != gamespaths.end(); i++){
 		std::vector<fs::DirListNode> dirlist = fs::GetDirListing(*i);
-- 
2.1.0


debug log:

solving d3024a5 ...
found d3024a5 in https://yhetil.org/guix-devel/1410028023-16046-2-git-send-email-dthompson2@worcester.edu/

applying [1/1] https://yhetil.org/guix-devel/1410028023-16046-2-git-send-email-dthompson2@worcester.edu/
diff --git a/gnu/packages/patches/minetest-subgame-env-var.patch b/gnu/packages/patches/minetest-subgame-env-var.patch
new file mode 100644
index 0000000..d3024a5

1:21: space before tab in indent.
 	std::string share = porting::path_share;
1:22: space before tab in indent.
 	std::string user = porting::path_user;
1:23: space before tab in indent.
 	std::vector<GameFindPath> find_paths;
1:37: space before tab in indent.
 	find_paths.push_back(GameFindPath(
1:38: space before tab in indent.
 			user + DIR_DELIM + "games" + DIR_DELIM + id + "_game", true));
Checking patch gnu/packages/patches/minetest-subgame-env-var.patch...
Applied patch gnu/packages/patches/minetest-subgame-env-var.patch cleanly.
warning: squelched 9 whitespace errors
warning: 14 lines add whitespace errors.

index at:
100644 d3024a5c9694d494e0f9be8b8e652fefba1fc13f	gnu/packages/patches/minetest-subgame-env-var.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).