comparison extra/soundsoftware/update-external-repo.sh @ 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 4eb486dbf730
children d3faf348b287
comparison
equal deleted inserted replaced
436:4eb486dbf730 437:102056ec2de9
66 # updates into the existing local mirror 66 # updates into the existing local mirror
67 67
68 successfile="$project_mirror/last_successful_url" 68 successfile="$project_mirror/last_successful_url"
69 if [ -f "$successfile" ]; then 69 if [ -f "$successfile" ]; then
70 last=$(cat "$successfile") 70 last=$(cat "$successfile")
71 if [ x"$last" == x"$remote_repo" ]; then 71 if [ x"$last" = x"$remote_repo" ]; then
72 echo "$$: Remote URL is unchanged from last successful update" 72 echo "$$: Remote URL is unchanged from last successful update"
73 else 73 else
74 echo "$$: Remote URL has changed since last successful update:" 74 echo "$$: Remote URL has changed since last successful update:"
75 echo "$$: Last URL was $last, current is $remote_repo" 75 echo "$$: Last URL was $last, current is $remote_repo"
76 suffix="$$.$(date +%s)" 76 suffix="$$.$(date +%s)"
77 echo "$$: Moving existing repos to $suffix suffix and starting afresh" 77 echo "$$: Moving existing repos to $suffix suffix and starting afresh"
78 mv "$project_repo_mirror" "$project_repo_mirror"."$suffix" 78 mv "$project_repo_mirror" "$project_repo_mirror"."$suffix"
79 mv "$local_repo" "$local_repo"."$suffix" 79 mv "$local_repo" "$local_repo"."$suffix"
80 mv "$successfile" "$successfile"."$suffix" 80 mv "$successfile" "$successfile"."$suffix"
81 touch "$project_mirror/url_changed"
81 fi 82 fi
82 fi 83 fi
83 84
84 if [ -d "$project_repo_mirror" ]; then 85 if [ -d "$project_repo_mirror" ]; then
85 86