Revision 437:102056ec2de9 extra
| extra/soundsoftware/convert-external-repos.rb | ||
|---|---|---|
| 62 | 62 |
$http_pass = '' |
| 63 | 63 |
$test = false |
| 64 | 64 |
|
| 65 |
$mirrordir = '/var/mirror' |
|
| 66 |
|
|
| 65 | 67 |
def log(text, options={})
|
| 66 | 68 |
level = options[:level] || 0 |
| 67 | 69 |
puts text unless $quiet or level > $verbose |
| ... | ... | |
| 168 | 170 |
end |
| 169 | 171 |
|
| 170 | 172 |
system($command, project.identifier, repos_path, external_url) |
| 173 |
|
|
| 174 |
$cache_clearance_file = File.join($mirrordir, project.identifier, 'url_changed') |
|
| 175 |
if File.file?($cache_clearance_file) |
|
| 176 |
log("\tproject repo url has changed, requesting cache clearance")
|
|
| 177 |
if project.post(:repository_cache, :key => $api_key) |
|
| 178 |
File.delete($cache_clearance_file) |
|
| 179 |
end |
|
| 180 |
end |
|
| 171 | 181 |
|
| 172 | 182 |
end |
| 173 | 183 |
|
| extra/soundsoftware/update-external-repo.sh | ||
|---|---|---|
| 68 | 68 |
successfile="$project_mirror/last_successful_url" |
| 69 | 69 |
if [ -f "$successfile" ]; then |
| 70 | 70 |
last=$(cat "$successfile") |
| 71 |
if [ x"$last" == x"$remote_repo" ]; then
|
|
| 71 |
if [ x"$last" = x"$remote_repo" ]; then |
|
| 72 | 72 |
echo "$$: Remote URL is unchanged from last successful update" |
| 73 | 73 |
else |
| 74 | 74 |
echo "$$: Remote URL has changed since last successful update:" |
| ... | ... | |
| 78 | 78 |
mv "$project_repo_mirror" "$project_repo_mirror"."$suffix" |
| 79 | 79 |
mv "$local_repo" "$local_repo"."$suffix" |
| 80 | 80 |
mv "$successfile" "$successfile"."$suffix" |
| 81 |
touch "$project_mirror/url_changed" |
|
| 81 | 82 |
fi |
| 82 | 83 |
fi |
| 83 | 84 |
|
Also available in: Unified diff