Mercurial > hg > soundsoftware-site
diff extra/soundsoftware/convert-external-repos.rb @ 437:102056ec2de9 bug_169
Introduce a method on the sys controller to clear a repository cache; use a file in the mirror dir to notify the Ruby external repo script that it needs to call it
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Mon, 06 Jun 2011 13:31:44 +0100 |
parents | 7658d21a1493 |
children | b61a51fb42b9 |
line wrap: on
line diff
--- a/extra/soundsoftware/convert-external-repos.rb Mon Jun 06 12:53:06 2011 +0100 +++ b/extra/soundsoftware/convert-external-repos.rb Mon Jun 06 13:31:44 2011 +0100 @@ -62,6 +62,8 @@ $http_pass = '' $test = false +$mirrordir = '/var/mirror' + def log(text, options={}) level = options[:level] || 0 puts text unless $quiet or level > $verbose @@ -168,6 +170,14 @@ end system($command, project.identifier, repos_path, external_url) + + $cache_clearance_file = File.join($mirrordir, project.identifier, 'url_changed') + if File.file?($cache_clearance_file) + log("\tproject repo url has changed, requesting cache clearance") + if project.post(:repository_cache, :key => $api_key) + File.delete($cache_clearance_file) + end + end end