update-minetest-mods Linux bash scripts

ronoaldo
Member
Posts: 177
Joined: Mon Dec 07, 2020 01:04
GitHub: ronoaldo
IRC: ronoaldo
In-game: RonoaldoKakashi
Location: São Paulo, Brasil
Contact:

Re: update-minetest-mods Linux bash scripts

by ronoaldo » Post

I have started a tool to download from CDB but update is not yet implemented. Search and install is, missing dependency auto install.

Interested into joining forces? I could try to port to Python, but I do prefer Go as it generates a single binary at the end and can run on multiple platforms.

viewtopic.php?f=14&t=26446&p=392148#p392148
Servers: Mercurio | Tools: ContentDB CLI | Mods: minenews

ronoaldo
Member
Posts: 177
Joined: Mon Dec 07, 2020 01:04
GitHub: ronoaldo
IRC: ronoaldo
In-game: RonoaldoKakashi
Location: São Paulo, Brasil
Contact:

Re: update-minetest-mods Linux bash scripts

by ronoaldo » Post

If helps, since I use a mix of mods from both contentdb and git, here is my work so far, updated to also "git pull" when visiting a mod that is in a git repo:

https://github.com/ronoaldo/minetools/r ... tag/v0.1.4
Servers: Mercurio | Tools: ContentDB CLI | Mods: minenews

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: update-minetest-mods Linux bash scripts

by Miniontoby » Post

Nice. But yeah I think imma sticking to git
Mostly because i cannot use 'go'

But if you can add auto update and maybe add support to mtctl (to auto restart server....). would be nice ;)
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

ronoaldo
Member
Posts: 177
Joined: Mon Dec 07, 2020 01:04
GitHub: ronoaldo
IRC: ronoaldo
In-game: RonoaldoKakashi
Location: São Paulo, Brasil
Contact:

Re: update-minetest-mods Linux bash scripts

by ronoaldo » Post

Ah sure :) I got the tool working for git as well as mods from contentdb. You don't need to use Go itself, I made some pre-compiled versions for download under Releases on Github.

I'm using it to build my server images with a Docker container. In a Dockerfile it can be used like this:

Code: Select all

FROM ghcr.io/ronoaldo/minetestserver:stable-5

USER root
RUN cd /usr/share/minetest &&\
    contentdb install TenPlus1/ethereal

USER minetest
I use it here: https://github.com/ronoaldo/mercurio

About mtctl: is this another tool already implemented?

For updates of mods, you can do it like this using the program I wrote:

Code: Select all

contentdb update
This will fetch all new versions (if applicable) from contentdb and try a git pull as well to keep all mods in the mods/ folder updated.
Servers: Mercurio | Tools: ContentDB CLI | Mods: minenews

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: update-minetest-mods Linux bash scripts

by Miniontoby » Post

ronoaldo wrote:
Thu Sep 23, 2021 21:24
Ah sure :) I got the tool working for git as well as mods from contentdb. You don't need to use Go itself, I made some pre-compiled versions for download under Releases on Github.
Oke, but yeah i am on Openbsd
ronoaldo wrote:
Thu Sep 23, 2021 21:24
I'm using it to build my server images with a Docker container. In a Dockerfile it can be used like this:

Code: Select all

FROM ghcr.io/ronoaldo/minetestserver:stable-5

USER root
RUN cd /usr/share/minetest &&\
    contentdb install TenPlus1/ethereal

USER minetest
I use it here: https://github.com/ronoaldo/mercurio
I don't have docker!
ronoaldo wrote:
Thu Sep 23, 2021 21:24
About mtctl: is this another tool already implemented?
mtctl is my minetest server control command for all UNIX OS, check it here
ronoaldo wrote:
Thu Sep 23, 2021 21:24
For updates of mods, you can do it like this using the program I wrote:

Code: Select all

contentdb update
This will fetch all new versions (if applicable) from contentdb and try a git pull as well to keep all mods in the mods/ folder updated.
Oke, thanks for the information, but yeah I don't know....
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

ronoaldo
Member
Posts: 177
Joined: Mon Dec 07, 2020 01:04
GitHub: ronoaldo
IRC: ronoaldo
In-game: RonoaldoKakashi
Location: São Paulo, Brasil
Contact:

Re: update-minetest-mods Linux bash scripts

by ronoaldo » Post

I see. Our projects have very little in common then. Let's keep them separate as of now.

Do your project is hosted somewhere online? I could not figure it out from the link you shared in the forum post. I ask because I also like Bash (for Linux in my case) and perhaps it worth seeing if I can contribute. If you are accepting contributions, off course.
Servers: Mercurio | Tools: ContentDB CLI | Mods: minenews

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: update-minetest-mods Linux bash scripts

by Miniontoby » Post

ronoaldo wrote:
Sat Sep 25, 2021 15:34
I see. Our projects have very little in common then. Let's keep them separate as of now.

Do your project is hosted somewhere online? I could not figure it out from the link you shared in the forum post. I ask because I also like Bash (for Linux in my case) and perhaps it worth seeing if I can contribute. If you are accepting contributions, off course.
Uhhh the project itself is not only for openbsd... but yeah i am also wanting to have it for multi OS.

About the code: check my signature below this post (p.s. i changed the topic today)
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
stylite
New member
Posts: 7
Joined: Mon Aug 01, 2022 11:07

Re: update-minetest-mods Linux bash scripts

by stylite » Post

Wow, what a time-saver!

I had a problem when updating. The error was:
Checking mod dir ./mods/mesecons Installed version /mesecons@0, update: error upgrading mod mods/mesecons: contentdb: package not found
But mesecons exists. Maybe i had installed a to old version?
My solution was to remove the folder and re-install mesecon.


And second, i was working in the /mods/ folder. When installing, it creates a /mod/ folder into the /mod/-folder ;-). Should there be a check what the path is?

ronoaldo
Member
Posts: 177
Joined: Mon Dec 07, 2020 01:04
GitHub: ronoaldo
IRC: ronoaldo
In-game: RonoaldoKakashi
Location: São Paulo, Brasil
Contact:

Re: update-minetest-mods Linux bash scripts

by ronoaldo » Post

stylite wrote:
Wed Aug 10, 2022 20:49
Wow, what a time-saver!

I had a problem when updating. The error was:
Checking mod dir ./mods/mesecons Installed version /mesecons@0, update: error upgrading mod mods/mesecons: contentdb: package not found
But mesecons exists. Maybe i had installed a to old version?
My solution was to remove the folder and re-install mesecon.
Hi! I am assuming you have used the 'contentdb' CLI tool I wrote for this, is that correct?

The tool checks the mod author/version from the downloaded mod/modpack.conf file. It is needed because of how the API works, as it prefixes the mod with the author name in the URL to allow to discover the package versions. Maye this could allow you to update mesecons in your case:

Code: Select all

echo 'author = Jeija' >> mods/mesecons/modpack.conf
(or just edit the file to add the author= attribute with a graphical text editor). This done once, should allow you to keep updating in batch. I recommend backups as the update removes the current install!

This is as example usage where it installs an older version, then it updates mesecons:

Code: Select all

$ contentdb install Jeija/mesecons@12542
Fetching package details:  Jeija/mesecons
Downloading Jeija/mesecons@12542 ...
Extracting package contents ...
Installed Jeija/mesecons into mods/mesecons
* Dependencies: 
* Optional dependencies: 
$ contentdb update
Updating 1 mods in ./mods ...
* Checking mod dir ./mods/mesecons Installed version Jeija/mesecons@12542, remote version Jeija/mesecons@13007: updating to version 13007 ...
Fetching package details:  Jeija/mesecons
Downloading Jeija/mesecons@13007 ...
Removing previous installation (performing in-place update as requested) ...
Extracting package contents ...
Installed Jeija/mesecons into mods/mesecons
* Dependencies: 
* Optional dependencies:
stylite wrote:
Wed Aug 10, 2022 20:49
And second, i was working in the /mods/ folder. When installing, it creates a /mod/ folder into the /mod/-folder ;-). Should there be a check what the path is?
You are correct. Since the minetest build can be configured with different system paths and both system path and user path are scanned to discover where mods are, I opted to expect that the tool is executed at the top leve dir where minetest data is stored. For instance, if you use the build flag RUN_IN_PLACE=1, the tool should be executed at the root source tree. If you are installing/updating user mods, it expectes to start from ~/.minetest and for system-wide mods it expects to start at /usr/share/minetest. It will create the mods subdir if it is not found! This also has another use case: download a set of mods to build a bundle and move it elsewhere later on.

However, detecting if we are under a folder named mods and using it regardless could be a good default indeed which also would work!
Servers: Mercurio | Tools: ContentDB CLI | Mods: minenews

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests