Package: mothur / 1.33.3+dfsg-2

find_pat_files Patch series | download
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
Author: Tim Booth <tbooth@ceh.ac.uk>
Last-Update: Thu, 24 Apr 2014 18:41:42 +0100
Description: Mothur ships with some .pat files which are needed by a couple of commands.
 Default behaviour is to fall back to looking in the exec dir, which makes
 no sense in a package, so redirect it.

--- a/shhhercommand.cpp
+++ b/shhhercommand.cpp
@@ -314,10 +314,10 @@
 					for (int i = 0; i < exepath.length(); i++) { tempPath[i] = tolower(exepath[i]); }
 					exepath = exepath.substr(0, (tempPath.find_last_of('m')));
 					
-					string tryPath = m->getFullPathName(exepath) + m->getSimpleName(lookupFileName);
-					m->mothurOut("Unable to open " + lookupFileName + ". Trying mothur's executable location " + tryPath); m->mothurOutEndLine();
+					string tryPath = "/usr/share/mothur/";
+					m->mothurOut("Unable to open " + lookupFileName + ". Trying default location " + tryPath); m->mothurOutEndLine();
 					ifstream in2;
-					ableToOpen = m->openInputFile(tryPath, in2, "noerror");
+					ableToOpen = m->openInputFile(tryPath +  m->getSimpleName(lookupFileName), in2, "noerror");
 					in2.close();
 					lookupFileName = tryPath;
 				}
@@ -334,10 +334,10 @@
 				for (int i = 0; i < exepath.length(); i++) { tempPath[i] = tolower(exepath[i]); }
 				exepath = exepath.substr(0, (tempPath.find_last_of('m')));
 					
-				string tryPath = m->getFullPathName(exepath) + m->getSimpleName(lookupFileName);
-				m->mothurOut("Unable to open " + lookupFileName + ". Trying mothur's executable location " + tryPath); m->mothurOutEndLine();
+				string tryPath = "/usr/share/mothur/";
+				m->mothurOut("Unable to open " + lookupFileName + ". Trying default location " + tryPath); m->mothurOutEndLine();
 				ifstream in2;
-				int ableToOpen = m->openInputFile(tryPath, in2, "noerror");
+				int ableToOpen = m->openInputFile(tryPath + m->getSimpleName(lookupFileName), in2, "noerror");
 				in2.close();
 				lookupFileName = tryPath;
 				
--- a/sffmultiplecommand.cpp
+++ b/sffmultiplecommand.cpp
@@ -315,10 +315,10 @@
 				for (int i = 0; i < exepath.length(); i++) { tempPath[i] = tolower(exepath[i]); }
 				exepath = exepath.substr(0, (tempPath.find_last_of('m')));
                 
-				string tryPath = m->getFullPathName(exepath) + m->getSimpleName(lookupFileName);
-				m->mothurOut("Unable to open " + lookupFileName + ". Trying mothur's executable location " + tryPath); m->mothurOutEndLine();
+				string tryPath = "/usr/share/mothur/";
+				m->mothurOut("Unable to open " + lookupFileName + ". Trying default location " + tryPath); m->mothurOutEndLine();
 				ifstream in2;
-				int ableToOpen = m->openInputFile(tryPath, in2, "noerror");
+				int ableToOpen = m->openInputFile(tryPath + m->getSimpleName(lookupFileName), in2, "noerror");
 				in2.close();
 				lookupFileName = tryPath;