Author Topic: Best way to keep a custom built up to date?  (Read 12251 times)

Offline Sturm

  • Colonel
  • ****
  • Posts: 132
    • View Profile
Best way to keep a custom built up to date?
« on: September 27, 2014, 02:56:02 am »
So, I have some changes in the code and mods, how do I keep all that stuff up to date with the main version with a lowest amount of effort?

Offline myk002

  • Colonel
  • ****
  • Posts: 227
    • View Profile
Re: Best way to keep a custom built up to date?
« Reply #1 on: September 27, 2014, 03:21:25 am »
Can I presume you're using git?  Git is designed to allow you to continuously pull changes from upstream.  If you don't already have the upstream link set, you can set it with:

git remote add upstream https://github.com/SupSuper/OpenXcom.git

then it's just:

git fetch upstream
git merge upstream/master

Offline Sturm

  • Colonel
  • ****
  • Posts: 132
    • View Profile
Re: Best way to keep a custom built up to date?
« Reply #2 on: September 27, 2014, 04:52:30 am »
I'm not using git and I don't know how it works.

Also, how it would work with my changes and mods? Wouldn't there be errors at some point?

Offline myk002

  • Colonel
  • ****
  • Posts: 227
    • View Profile
Re: Best way to keep a custom built up to date?
« Reply #3 on: September 27, 2014, 05:53:51 am »
At some point there will absolutely be errors: when you and the base project happen to change the same line.  Git will tell you when that happens and will point you to the line where you have to manually figure out which change to keep.

Github has a lot of tutorials on this subject.  https://help.github.com/
And of course there is a lot of info on there about git itself.  https://git-scm.com/book

Offline xracer

  • Commander
  • *****
  • Posts: 565
  • X-COM lover, we've gone at it everywhere
    • View Profile
Re: Best way to keep a custom built up to date?
« Reply #4 on: September 30, 2014, 11:07:29 pm »
Actually git is not that bad, coming from a non programmer, i t looks more daunting than it actually is, so long as you do not use
git reset --hard <commit> you will be good to go :)

But now seriously, so long as you do not let the basecode get too far ahead of you the errors you encounter will be minimal plus if you are a programmer is the easy (I presume) to deal with.

Find a bit interface you feel comfortable with and there should be no problem.
For non-programmers like me the github interface is very simple 2 buttons :) one to submit a commit one to sync done.
For power user there are a lot of other.

Offline Sturm

  • Colonel
  • ****
  • Posts: 132
    • View Profile
Re: Best way to keep a custom built up to date?
« Reply #5 on: October 01, 2014, 02:09:33 am »
I tried git cloning the new release (so that I'd re-create the changes on it) and it wouldn't compile - I got some errors about signed/unsigned comparisons. Is it normal?

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Best way to keep a custom built up to date?
« Reply #6 on: October 01, 2014, 02:17:56 am »
those are warnings, not errors. they're completely normal and mostly harmless.

Offline Sturm

  • Colonel
  • ****
  • Posts: 132
    • View Profile
Re: Best way to keep a custom built up to date?
« Reply #7 on: October 01, 2014, 03:29:13 am »
those are warnings, not errors. they're completely normal and mostly harmless.
Ok, managed to build it in a separate directory. Is there any way to set it to use custom data folders in Linux? I never liked the Linux way of scattering the data all over the place.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Best way to keep a custom built up to date?
« Reply #8 on: October 01, 2014, 04:34:09 am »
there are command line switches?

Offline Sturm

  • Colonel
  • ****
  • Posts: 132
    • View Profile
Re: Best way to keep a custom built up to date?
« Reply #9 on: October 01, 2014, 04:52:59 am »
I see only one that changes user folder which is for screens, saves and settings. I want it to read read data folder from specified location.

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Best way to keep a custom built up to date?
« Reply #10 on: October 01, 2014, 06:45:24 am »
An option to define paths for the Linux installation would be nice, yes. I always feel like going on a quest when I need to look into my options.cfg, because first I need to find it, inside a hidden file that I always forget (but don't access often enough to warrant a shortcut/link to it).

It's similar for the screens/saves and data, but I access those often enough that now I made links.

If I could, I would lump everything under "/home/username/Documents/OpenXCom/", with a subdirectory for data and another one for saves.

I had some games under Windows that did that, and I really liked the ease of access to their data.

Offline Sturm

  • Colonel
  • ****
  • Posts: 132
    • View Profile
Re: Best way to keep a custom built up to date?
« Reply #11 on: October 01, 2014, 08:04:42 am »
An option to define paths for the Linux installation would be nice, yes. I always feel like going on a quest when I need to look into my options.cfg, because first I need to find it, inside a hidden file that I always forget (but don't access often enough to warrant a shortcut/link to it).

It's similar for the screens/saves and data, but I access those often enough that now I made links.

If I could, I would lump everything under "/home/username/Documents/OpenXCom/", with a subdirectory for data and another one for saves.

I had some games under Windows that did that, and I really liked the ease of access to their data.
Personally, I'd put it in the folder of the current build so that I could have multiple builds on on one computer. Personally, I like the old Windows way of handling stuff the best. Everything stays in the application folder. Which means I can easily backup the whole game with all the saves, all the mods, etc.

Anyway, is there any way to modify the paths in the source code? Which file are they in?

Offline Reaper

  • Sergeant
  • **
  • Posts: 14
    • View Profile
Re: Best way to keep a custom built up to date?
« Reply #12 on: October 01, 2014, 01:24:35 pm »
I tried git cloning the new release (so that I'd re-create the changes on it) and it wouldn't compile - I got some errors about signed/unsigned comparisons. Is it normal?
May be you mean "warnings"? Show messages.

Offline Sturm

  • Colonel
  • ****
  • Posts: 132
    • View Profile
Re: Best way to keep a custom built up to date?
« Reply #13 on: October 01, 2014, 08:18:39 pm »
May be you mean "warnings"? Show messages.
I don't have them any more. This time I cloned the git again and compiled using a different method and it compiled me an executable in the bin folder. My current problem is how to stop the thing from trying to use the default data folder which is used by my older build.

Offline myk002

  • Colonel
  • ****
  • Posts: 227
    • View Profile
Re: Best way to keep a custom built up to date?
« Reply #14 on: October 02, 2014, 02:55:19 am »
I'm pretty sure openxcom uses the standard data and config directories for Linux.  They are defined with the XDG_* environment variables.  If you set them on the commandline when you start openxcom, you can use custom directories.  For example:

Code: [Select]
XDG_DATA_HOME="/path/to/local/saves" XDG_CONFIG_HOME="/path/to/local/config" bin/openxcom -data share/openxcom/data
or, equivalently (but perhaps more clearly):

Code: [Select]
export XDG_DATA_HOME="/path/to/local/saves"
export XDG_CONFIG_HOME="/path/to/local/config"
bin/openxcom -data share/openxcom/data

of course, change those paths to whatever makes sense for you.
« Last Edit: October 02, 2014, 03:11:43 am by myk002 »