Page 1 of 3

Minetest ModManager 0.1.4 Alpha <- You can upload your Mods to my Repo

PostPosted: Fri Dec 23, 2011 13:04
by sfan5
I wrote a Mod Manager in Python.
http://pastebin.com/SNZsgGcz
==How to set up==
Install Python, if you haven't already.
Go to http://pastebin.com/download.php?i=SNZsgGcz and save the file as mm.py
Go to the Command Line and type ./mm.py add-repo sfan.sf.funpic.de
You just added my Reposity to ModManager!
Type ./mm.py config moddir "path_to_your_minetest_mod_folder".
Example: "./mm.py config moddir ~/.minetest/data/mods"
Type ./mm.py update to update the Package List.
Now try ./mm.py install coalmod
coalmod.zip should appear in your folder and the folder coalmod should appear in your minetest mod folder
==Host your own Repo==
Create a Folder called minetest in the root of your Website.
e.g. "yoursite.com/minetest" not "yoursite.com/myfolder/docs/minetest"
Create a file called "PackageList" with a List of your Packages in it(1 Line = 1 Package)
Create a File called Pkg-name for each.
Fill it with this Information and adjust the Name and so on.
Now, upload the tar.bz2/tar.gz/zip/tar of your mod folder to your Site.
You can try installing your Package now:
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
./mm.py add-repo mysite.com
./mm.py update
./mm.py install yourmod

Browse my Repo for Examples
===Creating a Package which downloads your Gitorious-Repo===
Delete the "File: ..." Line from your Pkg-yourmod
Add "Gitorious:project_name,repo_name,branch" to the file.
Example: http://sfan.sf.funpic.de/minetest/Pkg-worldedit

PS.: I can host your Mods on my Repo if you want: http://sfan.sf.funpic.de/minetest/

PostPosted: Fri Dec 23, 2011 14:19
by bwog
Minetest 0.1?

PostPosted: Fri Dec 23, 2011 14:19
by sfan5
The Version of the Mod Manager is 0.1 Alpha
I changed the Title

PostPosted: Fri Dec 23, 2011 17:11
by RAPHAEL
Nice and simple. I like it. However, you may want to look into compiling the python script to an exe for Windows at least since many will not install python just for a mod manager.

PostPosted: Fri Dec 23, 2011 17:13
by xyz
Could you make it decompress packages?

PostPosted: Fri Dec 23, 2011 17:30
by Menche
Is there a certain folder I have to run it from? When I first try to add your repo, I get this:
IOError: [Errno 2] No such file or directory: '/home/user/.mm/repos.txt'

If I make that folder, I get this:
OSError: [Errno 17] File exists: '/home/user/.mm'

PostPosted: Fri Dec 23, 2011 17:53
by RAPHAEL
Menche wrote:Is there a certain folder I have to run it from? When I first try to add your repo, I get this:
IOError: [Errno 2] No such file or directory: '/home/user/.mm/repos.txt'

If I make that folder, I get this:
OSError: [Errno 17] File exists: '/home/user/.mm'


I was testing this on Windows XP and came across a similar error. It seems it expects a folder in C:\Documents and Settings\User\.mm but it doesn't exist. If you make it, it still wont work lol. If I knew more about python I'd try to see if I could fix it.

PostPosted: Fri Dec 23, 2011 18:15
by MarkTraceur
sfan5, your add-repo code only creates the directory if the directory is already there. Reverse the condition:

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
if(not os.path.exists(homedir + "/.mm")):


I'm not sure if that will work in Python 3, though....

PostPosted: Fri Dec 23, 2011 18:21
by sfan5
xyz wrote:Could you make it decompress packages?

In a later Version

PostPosted: Fri Dec 23, 2011 18:23
by sfan5
MarkTraceur wrote:sfan5, your add-repo code only creates the directory if the directory is already there. Reverse the condition:

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
if(not os.path.exists(homedir + "/.mm")):


I fixed it, please redownload ModManager

PostPosted: Fri Dec 23, 2011 18:24
by sfan5
Menche wrote:Is there a certain folder I have to run it from? When I first try to add your repo, I get this:
IOError: [Errno 2] No such file or directory: '/home/user/.mm/repos.txt'

If I make that folder, I get this:
OSError: [Errno 17] File exists: '/home/user/.mm'

Its a bug, please redownload ModManager:
MarkTraceur wrote:sfan5, your add-repo code only creates the directory if the directory is already there. Reverse the condition:

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
if(not os.path.exists(homedir + "/.mm")):


PostPosted: Fri Dec 23, 2011 20:05
by RAPHAEL
When I try to do an update I get error 303.

PostPosted: Fri Dec 23, 2011 20:19
by Menche
When I update it does this:
Fetching Packages from 'sfan.sf.funpic.de
'..
Traceback (most recent call last):
File "mm.py", line 90, in <module>
con.connect()
File "/usr/lib/python2.7/httplib.py", line 754, in connect
self.timeout, self.source_address)
File "/usr/lib/python2.7/socket.py", line 553, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.gaierror: [Errno -2] Name or service not known

PostPosted: Fri Dec 23, 2011 20:21
by sfan5
RAPHAEL wrote:When I try to do an update I get error 303.

I don't know how to fix it

PostPosted: Fri Dec 23, 2011 20:27
by dannydark
A 303 is a url redirect status code normally you only get this error when the client thinks the url is supposed to be redirected and the response doesn't contain an alternative url.

PostPosted: Sat Dec 24, 2011 05:24
by RAPHAEL
How would the Pkg file look if the mod had multiple dependencies? Like is there a space between the mods it depends on? A comma no space? A comma then a space? If you can show an example.

PostPosted: Sat Dec 24, 2011 08:32
by sfan5
RAPHAEL wrote:How would the Pkg file look if the mod had multiple dependencies? Like is there a space between the mods it depends on? A comma no space? A comma then a space? If you can show an example.

A comma without space
e.g.:
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
Name: My Mod
Depends:flowers,collisionlib
File:mymod.zip
Version:1.0

PostPosted: Sat Dec 24, 2011 10:36
by sfan5
Update!
0.1.2 Alpha out.
Changelog:
  • Fixed bug when a Repo has more than 1 Package
  • Added Support for tar.gz, zip and tar
  • Auto-Extracting of Mods to your Mod Folder
  • Added Support for Gitorious Repos
PS.: I can host your Mods on my Repo if you want!

PostPosted: Sat Dec 24, 2011 20:08
by RAPHAEL
sfan5 wrote:Update!
0.1.2 Alpha out.
Changelog:
  • Fixed bug when a Repo has more than 1 Package
  • Added Support for tar.gz, zip and tar
  • Auto-Extracting of Mods to your Mod Folder
  • Added Support for Gitorious Repos
PS.: I can host your Mods on my Repo if you want!

I tried setting up my own repo at dtamedia.com for testing before i finished it and it seems the error 303 still exists. Updating your repo gives 303 as well.

PostPosted: Sat Dec 24, 2011 20:26
by sfan5
RAPHAEL wrote:
sfan5 wrote:Update!
0.1.2 Alpha out.
Changelog:
  • Fixed bug when a Repo has more than 1 Package
  • Added Support for tar.gz, zip and tar
  • Auto-Extracting of Mods to your Mod Folder
  • Added Support for Gitorious Repos
PS.: I can host your Mods on my Repo if you want!

I tried setting up my own repo at dtamedia.com for testing before i finished it and it seems the error 303 still exists. Updating your repo gives 303 as well.

Please post any file in .mm, so I can try to fix it!

PostPosted: Sat Dec 24, 2011 20:52
by RAPHAEL
sfan5 wrote:Please post any file in .mm, so I can try to fix it!

In the .mm theres 2 text files. pkgs.txt and repos.txt. pkgs is empty and repos contains a single line of:
sfan.sf.funpic.de

PostPosted: Sat Dec 24, 2011 21:18
by sfan5
RAPHAEL wrote:
sfan5 wrote:Please post any file in .mm, so I can try to fix it!

In the .mm theres 2 text files. pkgs.txt and repos.txt. pkgs is empty and repos contains a single line of:
sfan.sf.funpic.de

I don't know how to fix that, try removing .mm and configurating it again

PostPosted: Sat Dec 24, 2011 23:29
by Menche
It adds your repository fine, but when I try to update afterwards:
ModManager 0.1.2 Alpha
Fetching Packages from 'sfan.sf.funpic.de
'..
Traceback (most recent call last):
File "mm.py", line 177, in <module>
con.connect()
File "/usr/lib/python2.7/httplib.py", line 754, in connect
self.timeout, self.source_address)
File "/usr/lib/python2.7/socket.py", line 553, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.gaierror: [Errno -2] Name or service not known

In ~/.mm there is an empty file called pkgs.txt, and repos.txt with one line that says: sfan.sf.funpic.de

PostPosted: Sun Dec 25, 2011 07:43
by sfan5
Menche wrote:It adds your repository fine, but when I try to update afterwards:
ModManager 0.1.2 Alpha
Fetching Packages from 'sfan.sf.funpic.de
'..
Traceback (most recent call last):
File "mm.py", line 177, in <module>
con.connect()
File "/usr/lib/python2.7/httplib.py", line 754, in connect
self.timeout, self.source_address)
File "/usr/lib/python2.7/socket.py", line 553, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.gaierror: [Errno -2] Name or service not known

In ~/.mm there is an empty file called pkgs.txt, and repos.txt with one line that says: sfan.sf.funpic.de

I don't know how to fix that, try removing .mm and configurating it again.
If that doesn't work post the content of the files in a hexadecimal format

PostPosted: Fri Jan 06, 2012 09:39
by sfan5
Update!
  • Fixed "socket.gaierror: [Errno -2] Name or service not known" Bug
  • Added List of installed Packages
If you got the "socket.gaierror: [Errno -2] Name or service not known" Error, delete your .mm/repos.txt and add your Repos again

PostPosted: Sat Jan 07, 2012 13:41
by sfan5
I added a Form to my Repo for Uploading Mods: http://sfan.sf.funpic.de/minetest/
If you want to upload your Mod, feel free to do that

PostPosted: Sun Jan 15, 2012 18:48
by neko259
Can you make a mod for upgrading or installing mods from the game console?

PostPosted: Sun Jan 15, 2012 19:23
by RAPHAEL
yay! seems to work so far on linux. Only issue now is with your directions. I have to do:
python mm.py install coalmod
for example instead of
./mm.py install coalmod


...now to be able to browse the repo of yours to see whats available lol

PostPosted: Sun Jan 15, 2012 19:32
by sfan5
neko259 wrote:Can you make a mod for upgrading or installing mods from the game console?

That's not easy,but i can try

PostPosted: Sun Jan 15, 2012 19:34
by neko259
os.execute([command])

Execute an operating system shell command. This is like the C system() function. The system dependent status code is returned.

Just execute your python script from lua.