• SVN Update Notifications
    26 replies, posted
This is a small menu plugin that searches your addon folder for addons that use SVN and checks if they need to be updated. If an addon needs to be updated, a notification pops up telling you to do so. [b]Screenshot[/b] [img]http://images.overvprojects.nl/SVN_update_checker(2).png[/img] [b]Installation[/b] Paste this into a .lua file in [i]garrysmod/garrysmod/lua/menu_plugins[/i]. Create the directory if it doesn't exist yet. [lua]local addons = file.FindDir( "addons/*", true ) local path, properties, current, latest, name for _, addon in ipairs( addons ) do path = "addons/" .. addon .. "/.svn/entries" if ( file.Exists( path, true ) ) then properties = string.Explode( "\n", file.Read( path, true ) ) current = tonumber( properties[4] ) http.Get( "http://83.84.23.31/dev/get.php?url=" .. properties[5], "", function( contents ) latest = tonumber( string.match( contents, "Revision ([0-9]+)" ) ) if ( current and latest and current < latest ) then name = KeyValuesToTable( file.Read( "addons/" .. addon .. "/info.txt", true ) )["name"] notification.AddLegacy( ( name or addon ) .. " needs to be updated!", NOTIFY_UNDO, 60 ) end end ) end end[/lua] [sp]The proxy is needed because http.Get doesn't support SSL, which is what SVN requires for the web interface.[/sp] Enjoy!
Why the spoiler tags for something that isn't really a spoiler?
Very nice. You got my download. [editline]12th March 2011[/editline] Or copy-paste, I dunno what you guys might call it.
Nice.
Thats pretty cool overv I hate always having to check if my svns are upto date.
Overv you beast you... Always creating useless shit, Nah im joking :P Im definitely going to use this!
LOL [url]http://83.84.23.31/dev/get.php?url=[/url] thx
[QUOTE=Zombie man70;28574353]LOL [url]http://83.84.23.31/dev/get.php?url=[/url] thx[/QUOTE] Haha nice try, asshole
-snip I shouldn't post when I'm tired-
Click it, then you'll understand.
[lua]local addons = file.FindDir( "addons/*", true ) local path, properties, current, latest, name for _, addon in ipairs( addons ) do path = "addons/" .. addon .. "/.svn/entries" if ( file.Exists( path, true ) ) then properties = string.Explode( "\n", file.Read( path, true ) ) current = tonumber( properties[4] ) http.Get( "http://www.gmodsvns.net/svn/get_revision.php?url=" .. properties[5], "", function( contents ) latest = tonumber( string.match( contents, "Revision ([0-9]+)" ) ) if ( current and latest and current < latest ) then name = KeyValuesToTable( file.Read( "addons/" .. addon .. "/info.txt", true ) )["name"] notification.AddLegacy( ( name or addon ) .. " needs to be updated!", NOTIFY_UNDO, 60 ) end end ) end end[/lua] Feel free to use the link in mine as well if the above one for some reason doesn't work because some ISP's block you from browsing to an IP.
[QUOTE=Buggzie;28578616][Feel free to use the link in mine as well if the above one for some reason doesn't work because some ISP's block you from browsing to an IP.[/QUOTE] It would be easier to just use my domain. [url]http://ip.overvprojects.nl/[/url]
Is it possible to do this but on the server? Server check the availability of addons, and told if something is outdated or addon not found.
This sure is smart. No need to attemp to update my SVNs all the time. Using this now.
Thanks, didn't realise you had released this yet lol! Very useful.
[QUOTE=Buggzie;28578616] Feel free to use the link in mine as well if the above one for some reason doesn't work because some ISP's block you from browsing to an IP.[/QUOTE] ISPs blocking IPs? Do you have any idea how DNS (or the internet at all) works?
[QUOTE=^seth;28645721]ISPs blocking IPs? Do you have any idea how DNS (or the internet at all) works?[/QUOTE] Yes I do and it IS possible that ISP's block [url]http://IPADDRESS[/url] HERE. Not IP addresses globally.
[QUOTE=Buggzie;28649627]Yes I do and it IS possible that ISP's block [url]http://IPADDRESS[/url] HERE. Not IP addresses globally.[/QUOTE] I don't think that's even possible. It's translated to the server's IP on your computer and that's what your browser connects with.
I guess you run the SSL proxy on your home connection? (*.dynamic.ziggo.nl) It's offline for some reason. Best would be if http.get had SSL.
Whoops damn iPhone touch, I meant to agree.
It is possible to block domains like that My school blocks them with reason "DOMAIN IS AN IP" if i try to goto one.
[QUOTE=^seth;28651084]I don't think that's even possible. It's translated to the server's IP on your computer and that's what your browser connects with.[/QUOTE] It is very possible, I could imagine some schools and filtered sites to do it. But for an residential ISP? I severely doubt an ISP would block that.
Does it work for addons that you've exported from another folder?
[QUOTE=samduude;28722289]Does it work for addons that you've exported from another folder?[/QUOTE] No, it has to have the SVN data in the addons folder.
[QUOTE=mr.wolf;28723020]No, it has to have the SVN data in the addons folder.[/QUOTE] Which you actually shouldn't have due to speed reasons. Less files = faster file-system indexing and especially searching.
[QUOTE=aVoN;28723437]Which you actually shouldn't have due to speed reasons. Less files = faster file-system indexing and especially searching.[/QUOTE] True, but unless SVN changes to a different format, it's the only way to keep SVN checkouts up to date without manually checking the latest revision and doing a full export. In most cases you aren't going to be searching SVN checkouts very much, and the speed loss is worth the update ability.
[QUOTE=mr.wolf;28724229]True, but unless SVN changes to a different format, it's the only way to keep SVN checkouts up to date without manually checking the latest revision and doing a full export. In most cases you aren't going to be searching SVN checkouts very much, and the speed loss is worth the update ability.[/QUOTE] Sadly I have to agree. If they had just used one binary-file as database for all sub-folders.
Sorry, you need to Log In to post a reply to this thread.