Page 1 of 1

Automatic Update of Mods

PostPosted: Tue Oct 07, 2014 14:47
by Nathan.S
Hello all, I've written up a script, Linux only, that can cycle through a folder where you've cloned mods from git and update them for you. It's still in it's early forms, there are more updates I plan, as outlined in the readme.

This script does require you to have rsync and git installed on your machines.

Download from https://github.com/NathanSalapat/Minetest_Mods_Updater.

USAGE:
Create a directory where you will git clone all the mods.
Place the Update.sh file in that folder, modify the file as needed, for locations, and renaming of mods.
Run the bash file, do it in a terminal if you want to see the output.
ENJOY fresh mods without out all the trouble of manually updating.

Optional, create a cron job to automatically run and update the mods for you.

Re: Automatic Update of Mods

PostPosted: Tue Oct 07, 2014 15:29
by Krock
Nathan.S wrote:Hello all, I've written up a script, Linux only

Oh, yay :(
Do you plan to make it compatible with windows?

Re: Automatic Update of Mods

PostPosted: Tue Oct 07, 2014 15:36
by Nathan.S
I don't use windows anymore, so I wouldn't be able to test any script. I don't know how much work it would be to change what I'm doing to a windows script/executable. Anyone is more than welcome to fork the project and make a windows version.

Re: Automatic Update of Mods

PostPosted: Tue Oct 07, 2014 18:54
by Mg
It's probably possible to create a ".bat" script using git, but not sure you can launch it automatically.
Good script nathan, thank you for sharing it.

Re: Automatic Update of Mods

PostPosted: Tue Oct 07, 2014 21:40
by philipbenr
Have you seen this post? This one updates minetest engine itself for you.

viewtopic.php?f=3&t=3837&start=25#p149113

(probably not...)

Re: Automatic Update of Mods

PostPosted: Wed Oct 08, 2014 04:14
by Nathan.S
Mg wrote:It's probably possible to create a ".bat" script using git, but not sure you can launch it automatically.
Good script nathan, thank you for sharing it.


Thank you.
I'll be updating the script some more tomorrow. I want to make it update itself, and read the mods that need to be renamed from an external file, so when it does update you don't have to modify that section, plus I think it would probably be a conflict with it updating itself and would wipe every time you run the script.

Re: Automatic Update of Mods

PostPosted: Wed Oct 08, 2014 04:17
by Nathan.S
philipbenr wrote:Have you seen this post? This one updates minetest engine itself for you.

viewtopic.php?f=3&t=3837&start=25#p149113

(probably not...)


No I hadn't seen that at all. It looks good, but I already get the daily builds so to build minetest myself every day would be overkill. This might be something to try out on my Debian system though, as it doesn't have the daily builds, and in APT minetest is still at like 4.4 or something, not up to date at all.

Re: Automatic Update of Mods

PostPosted: Wed Oct 08, 2014 14:00
by philipbenr
Well, I have a quad core, and I use make -j4. It completes the task extremely fast. Just put ./updateminetestscript.sh -j_ where _ is the # of cores you have. And I am using Slackware with window maker, so I have to use xterm to do basically everything...

Re: Automatic Update of Mods

PostPosted: Wed Oct 08, 2014 15:59
by Sol
Instead of ls better use bash builtin or find (which doesn't fail with huge amount of directories).
Though, I will send you a pull request some time soon. Cheers. (:

Re: Automatic Update of Mods

PostPosted: Wed Oct 08, 2014 17:12
by Nathan.S
Sol wrote:Instead of ls better use bash builtin or find (which doesn't fail with huge amount of directories).
Though, I will send you a pull request some time soon. Cheers. (:


I'll be looking for it. I did just push a few small changes, but they shouldn't make any changes as far as what you are suggesting.

Re: Automatic Update of Mods

PostPosted: Wed Oct 08, 2014 19:23
by Nathan.S
Okay, script seems to be working alright, it self updates and uses a secondary script to rename the folders that need it, so you don't have to worry about an update erasing those on you. Download from the same place. The readme has some helpful information about creating the rename.sh file and setting things up.

Re: Automatic Update of Mods

PostPosted: Wed Oct 08, 2014 19:58
by Nathan.S
philipbenr wrote:Well, I have a quad core, and I use make -j4. It completes the task extremely fast. Just put ./updateminetestscript.sh -j_ where _ is the # of cores you have. And I am using Slackware with window maker, so I have to use xterm to do basically everything...


I just went back to that post and ran that code on my Debian machine. Everything worked perfectly :) Now I can do multiplayer with compatible versions, and use all the same mods.

Thanks for the tip on -j4. I had no idea what the -j# meant, when I cranked it up to four, as I have a quad core machine too, it ran way faster.

Re: Automatic Update of Mods

PostPosted: Thu Oct 09, 2014 10:09
by Nathan.S
Please do not use the script right now. There is an error in the way it is copying the files, and will result in enormous CPU loads, and basically it tries to copy everything from your home folder to the mods folder.

Re: Automatic Update of Mods

PostPosted: Thu Oct 09, 2014 23:28
by Nathan.S
Okay, things should be working now. Read the readme for instructions on using as a cronjob and to set it up. Pay attention to those slashes, as they can send the files to all the wrong spots. I speak from experience here. :S

Re: Automatic Update of Mods

PostPosted: Fri Oct 10, 2014 12:18
by srifqi
How if player wants old version? Something like confirmation will be great.

Re: Automatic Update of Mods

PostPosted: Fri Oct 10, 2014 21:12
by Nathan.S
srifqi wrote:How if player wants old version? Something like confirmation will be great.


Right now I have no plans for a feature like that. One way to keep an old version would just be to delete the copy of it in the folder that you are cloning from GIT into.

Re: Automatic Update of Mods

PostPosted: Sat Oct 11, 2014 15:03
by Sol
srifqi wrote:How if player wants old version? Something like confirmation will be great.

What is the point of the script if you are gonna confirm every action anyway?
If you notice a problem with newer version of a mod you can do hard reset to an older version.
Alternatively, if you want particular mods not updated we might implement ignore list which would be a wiser decision than confirmation.

Re: Automatic Update of Mods

PostPosted: Sun Oct 12, 2014 01:47
by Nathan.S
I've went ahead and recorded a video explaining/showing how to use this script. You can watch it here: https://www.youtube.com/watch?v=r-lWIDO41kE

Re: Automatic Update of Mods

PostPosted: Sun Oct 12, 2014 10:53
by ExeterDad
You run Mint as well :D

Re: Automatic Update of Mods

PostPosted: Mon Apr 18, 2016 01:05
by wilkgr76
WIndows (bat) code for updating minetest_game. Relies on git to check for up-to-dateness.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
cd games\minetest_game
git pull
cd ..\..\bin
minetest.exe

Also automatically runs it. Place this in the root of the directory (not in the bin folder).