Automatic Update of Mods

User avatar
Nathan.S
Member
 
Posts: 679
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Automatic Update of Mods

by Nathan.S » Tue Oct 07, 2014 14:47

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.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: Automatic Update of Mods

by Krock » Tue Oct 07, 2014 15:29

Nathan.S wrote:Hello all, I've written up a script, Linux only

Oh, yay :(
Do you plan to make it compatible with windows?
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
Nathan.S
Member
 
Posts: 679
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Re: Automatic Update of Mods

by Nathan.S » Tue Oct 07, 2014 15:36

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.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website.
 

User avatar
Mg
Member
 
Posts: 86
Joined: Sun Mar 02, 2014 20:49
GitHub: LeMagnesium
IRC: ElectronLibre Mg
In-game: Mg

Re: Automatic Update of Mods

by Mg » Tue Oct 07, 2014 18:54

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.
 

User avatar
philipbenr
Member
 
Posts: 1665
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: WisdomFire or philipbenr

Re: Automatic Update of Mods

by philipbenr » Tue Oct 07, 2014 21:40

Have you seen this post? This one updates minetest engine itself for you.

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

(probably not...)
 

User avatar
Nathan.S
Member
 
Posts: 679
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Re: Automatic Update of Mods

by Nathan.S » Wed Oct 08, 2014 04:14

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.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website.
 

User avatar
Nathan.S
Member
 
Posts: 679
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Re: Automatic Update of Mods

by Nathan.S » Wed Oct 08, 2014 04:17

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.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website.
 

User avatar
philipbenr
Member
 
Posts: 1665
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: WisdomFire or philipbenr

Re: Automatic Update of Mods

by philipbenr » Wed Oct 08, 2014 14:00

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...
 

Sol
Member
 
Posts: 73
Joined: Thu Jul 31, 2014 05:21
In-game: sol

Re: Automatic Update of Mods

by Sol » Wed Oct 08, 2014 15:59

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. (:
There is no such thing as duty. If you know that a thing is right, you want to do it. If you don't want to do it—it isn't right. If it's right and you don't want to do it—you don't know what right is and you're not a man. -- Ayn Rand
 

User avatar
Nathan.S
Member
 
Posts: 679
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Re: Automatic Update of Mods

by Nathan.S » Wed Oct 08, 2014 17:12

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.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website.
 

User avatar
Nathan.S
Member
 
Posts: 679
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Re: Automatic Update of Mods

by Nathan.S » Wed Oct 08, 2014 19:23

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.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website.
 

User avatar
Nathan.S
Member
 
Posts: 679
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Re: Automatic Update of Mods

by Nathan.S » Wed Oct 08, 2014 19:58

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.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website.
 

User avatar
Nathan.S
Member
 
Posts: 679
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Re: Automatic Update of Mods

by Nathan.S » Thu Oct 09, 2014 10:09

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.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website.
 

User avatar
Nathan.S
Member
 
Posts: 679
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Re: Automatic Update of Mods

by Nathan.S » Thu Oct 09, 2014 23:28

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
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website.
 

User avatar
srifqi
Member
 
Posts: 508
Joined: Sat Jun 28, 2014 04:31
GitHub: srifqi
IRC: srifqi
In-game: srifqi

Re: Automatic Update of Mods

by srifqi » Fri Oct 10, 2014 12:18

How if player wants old version? Something like confirmation will be great.
I'm from Indonesia! Saya dari Indonesia!
Terjemahkan Minetest!
Mods by me. Modifikasi oleh saya.

Pronounce my nick as in: es-rifqi (IPA: /es rifˈki/)
 

User avatar
Nathan.S
Member
 
Posts: 679
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Re: Automatic Update of Mods

by Nathan.S » Fri Oct 10, 2014 21:12

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.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website.
 

Sol
Member
 
Posts: 73
Joined: Thu Jul 31, 2014 05:21
In-game: sol

Re: Automatic Update of Mods

by Sol » Sat Oct 11, 2014 15:03

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.
There is no such thing as duty. If you know that a thing is right, you want to do it. If you don't want to do it—it isn't right. If it's right and you don't want to do it—you don't know what right is and you're not a man. -- Ayn Rand
 

User avatar
Nathan.S
Member
 
Posts: 679
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Re: Automatic Update of Mods

by Nathan.S » Sun Oct 12, 2014 01:47

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
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website.
 

User avatar
ExeterDad
Member
 
Posts: 1121
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad

Re: Automatic Update of Mods

by ExeterDad » Sun Oct 12, 2014 10:53

You run Mint as well :D
٩(̾●̮̮̃̾•̃̾)۶

Kibbie and I have a beautiful public server now! HOMETOWN
 

User avatar
wilkgr76
Member
 
Posts: 680
Joined: Wed Feb 18, 2015 02:44
GitHub: wilkgr76
IRC: wilkgr
In-game: wilkgr

Re: Automatic Update of Mods

by wilkgr76 » Mon Apr 18, 2016 01:05

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).
I do not care.
 


Return to Minetest-Related

Who is online

Users browsing this forum: No registered users and 1 guest

cron