3 # Copyright 2014 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
7 # Android shell script to make the destination directory identical with the
8 # source directory, without doing unnecessary copies. This assumes that the
9 # the destination directory was originally a copy of the source directory, and
10 # has since been modified.
14 echo copying
$source to
$dest
17 # Don't delete symbolic links, since doing so deletes the vital lib link.
20 if [ ! -e "$source/$1" ]
22 echo rm -rf "$dest/$1"
35 if [ -d "$1" ] && [ -e "$dest/$1" ]
37 if [ ! -e "$dest/$1" ]
39 echo cp -a "$1" "$dest/$1"
47 elif [ ! -e "$dest/$1" ] ||
[ "$1" -ot "$dest/$1" ] ||
[ "$1" -nt "$dest/$1" ]
49 # dates are different, so either the destination of the source has changed.
50 echo cp -a "$1" "$dest/$1"