diff options
author | Kenny Root <kroot@google.com> | 2013-01-16 10:49:50 -0800 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2013-01-16 10:52:28 -0800 |
commit | d118b0f3e3c105283a189c6ee32be39de0ae414a (patch) | |
tree | 13b199967f9d35a731f3ff0a55fd7cfffd8f3c66 /import_bouncycastle.sh | |
parent | 73f666df90385dc2d5c524fbb25c61054836ed82 (diff) | |
download | android_external_bouncycastle-d118b0f3e3c105283a189c6ee32be39de0ae414a.tar.gz android_external_bouncycastle-d118b0f3e3c105283a189c6ee32be39de0ae414a.tar.bz2 android_external_bouncycastle-d118b0f3e3c105283a189c6ee32be39de0ae414a.zip |
Fix patch generation timestamps
Change-Id: Ibb096f239e0e4a6c0dda05e249786432babfcc8a
Diffstat (limited to 'import_bouncycastle.sh')
-rwxr-xr-x | import_bouncycastle.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/import_bouncycastle.sh b/import_bouncycastle.sh index 6d76099..5cbd504 100755 --- a/import_bouncycastle.sh +++ b/import_bouncycastle.sh @@ -155,6 +155,21 @@ function regenerate() { generatepatch $patch $bouncycastle_dir $bouncycastle_dir_orig } +function update_timestamps() { + declare -r git_dir="$1" + declare -r target_dir="$2" + + echo -n "Restoring timestamps for ${target_dir}... " + + find "$git_dir" -type f -print0 | while IFS= read -r -d $'\0' file; do + file_rev="$(git rev-list -n 1 HEAD "$file")" + file_time="$(git show --pretty=format:%ai --abbrev-commit "$file_rev" | head -n 1)" + touch -d "$file_time" "${target_dir}${file#$git_dir}" + done + + echo "done." +} + function generate() { declare -r patch=$1 declare -r bouncycastle_source=$2 @@ -172,6 +187,7 @@ function generate() { echo "Restoring $i" rm -r $bouncycastle_dir/$i cp -rf $bouncycastle_out_dir/src/main/java/$i $bouncycastle_dir/$i + update_timestamps $bouncycastle_out_dir/src/main/java/$i $bouncycastle_dir/$i done generatepatch $patch $bouncycastle_dir $bouncycastle_dir_orig |