Просмотр исходного кода

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
Brad King 10 лет назад
Родитель
Сommit
030ec94780
1 измененных файлов с 18 добавлено и 1 удалено
  1. 18 1
      Utilities/Scripts/update-third-party.bash

+ 18 - 1
Utilities/Scripts/update-third-party.bash

@@ -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