commit cf83610e79951c0676212dca49d7144bf5df0f21 Author: Nicolas Vigier boklm@torproject.org Date: Sun Oct 12 15:03:43 2014 +0200
update_responses: create symlinks when extracting mars
Find the addsymlink instructions in the updatev3.manifest file and create corresponding symbolic links.
If no updatev3.manifest file is present, we do it with the updatev2.manifest file if it is present. --- tools/update-responses/update_responses | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/tools/update-responses/update_responses b/tools/update-responses/update_responses index 3590227..55ebfb9 100755 --- a/tools/update-responses/update_responses +++ b/tools/update-responses/update_responses @@ -105,6 +105,15 @@ sub extract_mar { || exit_error "Error decompressing $File::Find::name"; }; find($bunzip_file, $dest_dir); + my $manifest = -f 'updatev3.manifest' ? 'updatev3.manifest' + : 'updatev2.manifest'; + my @lines = read_file($manifest) if -f $manifest; + foreach my $line (@lines) { + if ($line =~ m/^addsymlink "(.+)" "(.+)"$/) { + exit_error "$mar_file: Could not create symlink $1 -> $2" + unless symlink $2, $1; + } + } chdir $old_cwd; }
tbb-commits@lists.torproject.org