Merge topic 'update-third-party'

97149ff8 update-third-party: read attributes from the worktree
a35f4be6 update-third-party: Add license notice
afac3d10 update-third-party: remove empty directories as well
This commit is contained in:
Brad King 2016-03-10 09:16:20 -05:00 committed by CMake Topic Stage
commit 030ec94780
1 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,19 @@
#=============================================================================
# Copyright 2015-2016 Kitware, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
########################################################################
# Script for updating third party packages.
#
@ -32,7 +48,7 @@
# Utility functions
########################################################################
git_archive () {
git archive --prefix="$name-reduced/" HEAD -- $paths | \
git archive --worktree-attributes --prefix="$name-reduced/" HEAD -- $paths | \
tar -C "$extractdir" -x
}
@ -85,6 +101,7 @@ if [ -n "$basehash" ]; then
# Clear out the working tree
pushd "$extractdir"
git ls-files | xargs rm -v
find . -type d -empty -delete
popd
else
# Create a repo to hold this package's history