• gm_svn: SVN update from within GMod
    83 replies, posted
[release] :science: [highlight]This is experimental[/highlight] [B]What:[/B] Give you svn.update([path [, revision]]) from the LuaSVN module. Pretty much allows for updates to svn'd addons from within gmod (ie. wire). [b]LuaSVN:[/b] [url]http://www.lua.inf.puc-rio.br/~sergio/luasvn/index.html[/url] [b]Info:[/b] I was just fucking around in VS2008 today and somehow make this :S [b]Source and binaries:[/b] [url]http://hephnet.org/ftpusers/tad2020/gmod/download.php?id=1[/url] [b]Readme:[/b] Inatall: 1) copy all the DLLs in .\bin to (steam install folder)\steamapps\(your name)\garrysmod\bin 2) copy .\Release\gm_svn.dll to (steam install folder)\steamapps\(your name)\garrysmod\garrysmod\lua\includes\modules 3) start gmod and load a map 4) run "lua_run require("svn") MsgN("Updated wire to: "..svn.update("garrysmod/addons/wire"))" from the console 5) should print out "Updated wire to: ####" if it works. -1 means failure. svn.update ([path [, revision]]) is the only function from luasvn exported into gmod. All dependacy are included. Built in VS2008. I used subversion 1.6.3 for Apache 2.2.x libs and bins from here: [url]http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100[/url] libs: [url]http://subversion.tigris.org/files/documents/15/46151/svn-win32-1.6.3_dev.zip[/url] bins: [url]http://subversion.tigris.org/files/documents/15/46144/svn-win32-1.6.3.zip[/url] [b]Todo:[/b] Combine with wire_updatecheck and make an auto update script. [/release]
what prevents people from adding new svn's remotely?
[QUOTE=Bang Train;16110357]what prevents people from adding new svn's remotely?[/QUOTE] The only subversion function left in is 'update', all the others are not complied in to the interface. svn.update should be safe since they can't make new checkouts and cant make them manually in ./data cause they can only write .txt files there and not the needed './.svn/entries' file. Its also marked as experimental :v:
Wouldn't this still require you to restart?
[QUOTE=-TB-;16113069]Wouldn't this still require you to restart?[/QUOTE] Only a map reload. Gmod/SRCDS only require a restart when new addons are installed. This would be very useful for dedicated servers. [editline]11:11PM[/editline] I forgot luaconf.h in includes. You'll need to grab that from the lua source to compile this.
Any chance of being able to use this without the game pausing? :P
[QUOTE=n00berific;16115420]Any chance of being able to use this without the game pausing? :P[/QUOTE] [url]http://www.facepunch.com/showthread.php?t=730018[/url] Not sure if it actually reloads the addons, though.
[QUOTE=Nevec;16115546][url]http://www.facepunch.com/showthread.php?t=730018[/url] Not sure if it actually reloads the addons, though.[/QUOTE] I think Azu hasn't finished it, hope it will be done somewhen.. I whish this would work with custom urls, like [code]svn.update("phx3","https://phoenix-storms.svn.sourceforge.net/svnroot/phoenix-storms") -- /addons should be the home folder anyway[/code]
Awesome, testing this now. [editline]12:39PM[/editline] Somehow i am getting this module not found error, and yes i have it in that folder : [code] error loading module 'svn' from file 'd:\program files\steam\steamapps\*username*\garrysmod\garrysmod\lua\includes\modules\gm_svn.dll': The specified module could not be found. [/code]
This is what I ever wanted! :D
Add an ingame progress bar for all the clients,so we know when the svn has been updated/downloaded :v:
[QUOTE=kevkev;16116729]Awesome, testing this now. [editline]12:39PM[/editline] Somehow i am getting this module not found error, and yes i have it in that folder : [code] error loading module 'svn' from file 'd:\program files\steam\steamapps\*username*\garrysmod\garrysmod\lua\includes\modules\gm_svn.dll': The specified module could not be found. [/code][/QUOTE] You may have put the binaries in the wrong folder i.e. garrysmod/garrysmod/bin instead of garrysmod/bin.
Oh damn this is good shit
[QUOTE=The-Stone;16115772]I think Azu hasn't finished it, hope it will be done somewhen.. I whish this would work with custom urls, like [code]svn.update("phx3","https://phoenix-storms.svn.sourceforge.net/svnroot/phoenix-storms") -- /addons should be the home folder anyway[/code][/QUOTE] You don't need to give a url to update an existing check out. [editline]12:46PM[/editline] [QUOTE=n00berific;16115420]Any chance of being able to use this without the game pausing? :P[/QUOTE] No. The function call is blocking and I have no clue how to make it a call back instead. [editline]12:49PM[/editline] [QUOTE=Jvs;16121039]Add an ingame progress bar for all the clients,so we know when the svn has been updated/downloaded :v:[/QUOTE] Subversion update function does not and can not give any progress to the update. This is a limitation of the system. Even if it did, the call it blocking. What can be done is a pop up window that states the update is running.
[QUOTE=Nevec;16115546][url]http://www.facepunch.com/showthread.php?t=730018[/url] Not sure if it actually reloads the addons, though.[/QUOTE] [url]http://gmodmodules.googlecode.com/svn/trunk/secretheaders/secret.txt[/url] It works fine, I just didn't finish the other stuff, like downloading and extracting addons. But in this particular case, you've already installed the addon, gm_svn just updates it.
Add Checkout and Commit and I will make beautiful love with your babies for all eternity
[QUOTE=leach139;16128853]Add Checkout and Commit and I will make beautiful love with your babies for all eternity[/QUOTE] Uncomment those function in luasvn.c and recompile. I'm not doing it cause that's a dangerous thing to have in gmod.
This is pretty cool, nice job.
Thanks so much for this! No need to raise a support ticket every time wire is out of date any more :dance: [editline]10:35PM[/editline] SHIT! It crashed my server with [code]lua_run require("svn") MsgN("Updated wire to: "..svn.update("garrysmod/addons/wire"))[/code]
[QUOTE=CombineGuru;16270424]Thanks so much for this! No need to raise a support ticket every time wire is out of date any more :dance: [editline]10:35PM[/editline] SHIT! It crashed my server with [code]lua_run require("svn") MsgN("Updated wire to: "..svn.update("garrysmod/addons/wire"))[/code][/QUOTE] Did it crash or did it freeze temporarily? since the freezing is because the server is focusing on the update.
I cant seem to get this to work. I have placed all the apropriate files in their correct places and restarted a few times. the server keeps saying: 07/30/2009 - 19:42:45: Lua Error: error loading module 'svn' from file 'c:\userfiles\ahref\gameservers\tc61302148213624808587058\orangebox\garrysmod\lua\includes\modules\gm_svn.dll': <TAB>The specified module could not be found. it is definitely there though
You didn't put the other DLLs in the correct place. Where did you put them?
I use a Win-XP 64 bit and I have the Dlls in the correct place, but if i try to run this it doesn't work and says: "%1 is an invalid win 32 application." or some thing. :( The Console command I used to try to run: [CODE]lua_run require("svn") MsgN("Updated wire to: "..svn.update("garrysmod/addons/wire"))[/CODE] Console dump: [CODE] ] lua_run require("svn") MsgN("Updated wire to: "..svn.update("garrysmod/addons/wire")) > require("svn") MsgN("Updated wire to: "..svn.update("garrysmod/addons/wire"))... error loading module 'svn' from file 'c:\program files (x86)\steam\steamapps\(my name)\garrysmod\garrysmod\lua\includes\modules\gm_svn.dll': %1 is an invalid win 32-application. [/CODE]
Just tested on my 64bit 7, same problem as above.
[QUOTE=tad2020;16396163]You didn't put the other DLLs in the correct place. Where did you put them?[/QUOTE] Sorry for the large photos. Tad let me know once youve seen them and ill edit them out\; A filter is applied to this so it only shows files with svn in their name.
Emphasis added: [QUOTE=tad2020;16110253] 1) copy all the DLLs in .\bin to (steam install folder)\steamapps\(your name)\[highlight][U]garrysmod\bin[/U][/highlight] [/QUOTE] orangebox/bin should be the correct place for SRCDS, but I have not tested. On x64, you may need to recompile it. I don't have an x64 environment for building or testing.
[QUOTE=tad2020;16460102]On x64, you may need to recompile it. I don't have an x64 environment for building or testing.[/QUOTE] Well, the source engine is compiled in 32 bit so if this was compiled in 64 bit it wouldn't even try to load the assembly. (My visual studio has switched over to 64 bit many times on accident; so I've seen this before :/ ) Also, I think you're missing a dll from the package. I had the same issue on my server and found out it was missing something. (I forgot the name of the file)
After this error I've redownload, reinstalled at the right place and tested it again but it doesn't work. :(
[QUOTE=echo1001;16460738]Also, I think you're missing a dll from the package. I had the same issue on my server and found out it was missing something. (I forgot the name of the file)[/QUOTE] I don't think I am. I used this package my self on my other computer first to make sure I had everything. You might need the VS2008 runtimes.
I think you were missing [url=http://ungamers.googlecode.com/svn/trunk/orangebox/bin/libsasl.dll]libsasl.dll[/url]. I had an error with it on both my dedicated server and a local test server I ran.
Sorry, you need to Log In to post a reply to this thread.