# HG changeset patch # User Chris Cannam # Date 1371730250 -3600 # Node ID b61a51fb42b9d424543f70f2ea38406de6700a31 # Parent 2590a6fb900a11d4b7b62ed94277103ccda49116 Fixes to external helper scripts, including avoiding barfing on project XML diff -r 2590a6fb900a -r b61a51fb42b9 extra/soundsoftware/convert-external-repos.rb --- a/extra/soundsoftware/convert-external-repos.rb Thu Jun 20 13:10:28 2013 +0100 +++ b/extra/soundsoftware/convert-external-repos.rb Thu Jun 20 13:10:50 2013 +0100 @@ -34,7 +34,6 @@ require 'getoptlong' -require 'rdoc/usage' require 'find' require 'etc' @@ -86,7 +85,7 @@ when '--verbose'; $verbose += 1 when '--test'; $test = true when '--version'; puts Version; exit - when '--help'; RDoc::usage + when '--help'; puts "Read source for documentation"; exit when '--quiet'; $quiet = true end end @@ -99,7 +98,7 @@ end if ($redmine_host.empty? or $repos_base.empty? or $command.empty?) - RDoc::usage + puts "Read source for documentation"; exit end unless File.directory?($repos_base) @@ -114,6 +113,7 @@ class Project < ActiveResource::Base self.headers["User-agent"] = "SoundSoftware external repository converter/#{Version}" + self.format = :xml end log("querying Redmine for projects...", :level => 1); @@ -128,6 +128,8 @@ begin # Get all active projects that have the Repository module enabled projects = Project.find(:all, :params => {:key => $api_key}) +rescue ActiveResource::ForbiddenAccess + log("Request was denied by your Redmine server. Make sure that 'WS for repository management' is enabled in application settings and that you provided the correct API key.") rescue => e log("Unable to connect to #{Project.site}: #{e}", :exit => true) end diff -r 2590a6fb900a -r b61a51fb42b9 extra/soundsoftware/update-external-repo.sh --- a/extra/soundsoftware/update-external-repo.sh Thu Jun 20 13:10:28 2013 +0100 +++ b/extra/soundsoftware/update-external-repo.sh Thu Jun 20 13:10:50 2013 +0100 @@ -1,7 +1,7 @@ #!/bin/sh mirrordir="/var/mirror" -hg="/usr/local/bin/hg" +hg="/usr/bin/hg" project="$1" local_repo="$2"