Hello,
I'm back with a fresh new patch. This time it's patch for bug
#2036114. I had to make some changes into makefile generation, but it
seems that the makefile containing TMPDIR is correctly generated.
But I've some problems with it. First, I don't know how to test it.
The other one is that I don't know if setting TMPDIR in makefile
actually do something, because this would work only when variable set
in makefile is used the same way as environment variables are in
shell. So can this work, or do I've to pass TMPDIR to all executed
programs?
Patch is attached.
Regards,
Lukáš "stativ" Jirkovský
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"hugin and other free panoramic software" group.
A list of frequently asked questions is available at:
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at http://groups.google.com/group/hugin-ptx
-~----------~----~----~----~------~----~------~--~---
Index: src/hugin1/PT/utils.h
===================================================================
--- src/hugin1/PT/utils.h (revision 3605)
+++ src/hugin1/PT/utils.h (working copy)
@@ -44,8 +44,9 @@
const PTPrograms & progs,
const std::string & includePath,
std::vector<std::string> & outputFiles
- std::ostream & o)
-{
+ std::ostream & o,
+ std::string & tmpDir)
+{
Panorama copyOfPano(pano);
HuginBase::PanoramaMakefileExport(copyOfPano, o, images, ptofile, outputPrefix, progs, includePath).run();
};
Index: src/hugin1/base_wx/RunStitchPanel.cpp
===================================================================
--- src/hugin1/base_wx/RunStitchPanel.cpp (revision 3605)
+++ src/hugin1/base_wx/RunStitchPanel.cpp (working copy)
@@ -199,6 +199,7 @@
makeFile.Close();
std::string resultFn(basename.mb_str(HUGIN_CONV_FILENAME));
std::string tmpPTOfnC = (const char *) m_currentPTOfn.mb_str(HUGIN_CONV_FILENAME);
+ std::string tmpDir((wxConfigBase::Get()->Read(wxT("tempDir"),wxT(""))).mb_str(HUGIN_CONV_FILENAME));
std::vector<std::string> outputFiles;
HuginBase::PanoramaMakefileExport::createMakefile(pano,
@@ -208,7 +209,8 @@
progs,
"",
outputFiles,
- makeFileStream);
+ makeFileStream,
+ tmpDir);
// cd to output directory, if one is given.
wxString oldCWD = wxFileName::GetCwd();
Index: src/hugin1/hugin/MainFrame.cpp
===================================================================
--- src/hugin1/hugin/MainFrame.cpp (revision 3605)
+++ src/hugin1/hugin/MainFrame.cpp (working copy)
@@ -547,6 +547,7 @@
wxString resultFnwx = scriptName.GetFullPath();
resultFn = resultFnwx.mb_str(HUGIN_CONV_FILENAME);
resultFn = utils::stripPath(utils::stripExtension(resultFn));
+ std::string tmpDir((wxConfigBase::Get()->Read(wxT("tempDir"),wxT(""))).mb_str(HUGIN_CONV_FILENAME));
std::vector<std::string> outputFiles;
HuginBase::PanoramaMakefileExport::createMakefile(pano,
@@ -556,7 +557,8 @@
progs,
"",
outputFiles,
- makefile);
+ makefile,
+ tmpDir);
}
}
SetStatusText(wxString::Format(_("saved project %s"), m_filename.c_str()),0);
Index: src/tools/pto2mk.cpp
===================================================================
--- src/tools/pto2mk.cpp (revision 3605)
+++ src/tools/pto2mk.cpp (working copy)
@@ -146,6 +146,7 @@
progs,
"",
outputFiles,
- makeFileStream);
+ makeFileStream,
+ "");
return 0;
}
Index: src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.cpp
===================================================================
--- src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.cpp (revision 3605)
+++ src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.cpp (working copy)
@@ -142,7 +142,8 @@
const PTPrograms& progs,
const std::string& includePath,
std::vector<std::string> & outputFiles,
- std::ostream& o)
+ std::ostream& o,
+ const std::string& tmpDir)
{
PanoramaOptions opts = pano.getOptions();
#ifdef __unix__
@@ -169,10 +170,22 @@
}
#endif
#endif
-
+
o << "# makefile for panorama stitching, created by hugin " << endl
<< endl;
+ // export temporary directory setting if tmpDir is set
+ if (tmpDir != "") {
+ o << "# Temporary directory configuration" << endl
+#ifdef __unix__
+ << "TMPDIR=" << quoteStringShell(tmpDir)
+#else // WINDOWS
+ << "TEMP=" << quoteStringShell(tmpDir) << endl
+ << "TMP=" << quoteStringShell(tmpDir)
+#endif
+ << endl;
+ }
+
o << endl
<< endl
<< "# Tool configuration" << endl
Index: src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.h
===================================================================
--- src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.h (revision 3605)
+++ src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.h (working copy)
@@ -105,7 +105,8 @@
const PTPrograms & progs,
const std::string & includePath,
std::vector<std::string> & outputFiles,
- std::ostream & o);
+ std::ostream & o,
+ const std::string& tmpDir);
public:
@@ -118,7 +119,7 @@
{
createMakefile(o_panorama,
o_images, o_ptofile, o_outputPrefix, o_progs, o_includePath,
- o_outputFiles, o_output);
+ o_outputFiles, o_output, o_tmpDir);
return true; // let's hope so.
}
@@ -133,6 +134,7 @@
PTPrograms o_progs;
std::vector<std::string> o_outputFiles;
String o_includePath;
+ String o_tmpDir;
};