Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 94013 Details for
Bug 118911
revdep-rebuild doesn't find /usr/share/games/glest/lib/glest
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
glest-2.0.0-home.patch
glest-2.0.0-home.patch (text/plain), 2.30 KB, created by
Tristan Heaven (RETIRED)
on 2006-08-11 12:59:43 UTC
(
hide
)
Description:
glest-2.0.0-home.patch
Filename:
MIME Type:
Creator:
Tristan Heaven (RETIRED)
Created:
2006-08-11 12:59:43 UTC
Size:
2.30 KB
patch
obsolete
>--- source/glest_game/main/main.cpp >+++ source/glest_game/main/main.cpp >@@ -13,6 +13,7 @@ > > #include <string> > #include <cstdlib> >+#include <sys/stat.h> > > #include "game.h" > #include "main_menu.h" >@@ -129,6 +130,17 @@ > ExceptionHandler exceptionHandler; > exceptionHandler.install(); > >+ if (!getenv("HOME")) >+ throw runtime_error("HOME not set!"); >+ >+ char str[PATH_MAX]; >+ snprintf(str, PATH_MAX, "%s/.glest", getenv("HOME")); >+ mkdir(str, 0750); >+ chdir(str); >+ mkdir("screens", 0750); >+ >+ chdir("GENTOO_DATADIR"); >+ > try{ > Config &config = Config::getInstance(); > >--- source/glest_game/main/program.cpp >+++ source/glest_game/main/program.cpp >@@ -65,8 +65,11 @@ > updateCameraTimer.init(config.getInt("CameraFps"), maxTimes); > > //log start >+ char str[PATH_MAX]; >+ snprintf(str, PATH_MAX, "%s/.glest/glest.log", getenv("HOME")); >+ > Logger &logger= Logger::getInstance(); >- logger.setFile("glest.log"); >+ logger.setFile(str); > logger.clear(); > > srand(time(NULL)); >@@ -134,9 +137,10 @@ > //save screen > if(key=='T'){ > for(int i=0; i<100; ++i){ >- string path= "screens/screen" + intToStr(i) + ".tga"; >+ char path[PATH_MAX]; >+ snprintf(path, PATH_MAX, "%s/.glest/screens/screen%d.tga", getenv("HOME"), i); > >- FILE *f= fopen(path.c_str(), "rb"); >+ FILE *f= fopen(path, "rb"); > if(f==NULL){ > Renderer::getInstance().saveScreen(path); > break; > >--- source/shared_lib/sources/util/properties.cpp >+++ source/shared_lib/sources/util/properties.cpp >@@ -33,9 +33,13 @@ > > this->path= path; > >- fileStream.open(path.c_str(), ios_base::in); >+ char str[PATH_MAX]; >+ snprintf(str, PATH_MAX, "%s/.glest/%s", getenv("HOME"), path.c_str()); >+ fileStream.open(str, ios_base::in); > if(fileStream.fail()){ >- throw runtime_error("Can't open properties file: " + path); >+ fileStream.open(path.c_str(), ios_base::in); // use defaults >+ if(fileStream.fail()) >+ throw runtime_error("Can't open properties file: " + path); > } > > properties.clear(); >@@ -70,7 +74,9 @@ > void Properties::save(const string &path){ > ofstream fileStream; > >- fileStream.open(path.c_str(), ios_base::out | ios_base::trunc); >+ char str[PATH_MAX]; >+ snprintf(str, PATH_MAX, "%s/.glest/%s", getenv("HOME"), path.c_str()); >+ fileStream.open(str, ios_base::out | ios_base::trunc); > > fileStream << "; === Properties File === \n"; > fileStream << '\n';
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 118911
:
87296
| 94013 |
94014
|
94914