2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 22:15:23 +00:00

[#3732] Migrate tools/print-generated-files.sh away from autotools

This commit is contained in:
Andrei Pavel
2025-04-04 11:08:18 +03:00
parent 3133dc2b58
commit 4a9fcdb2f5
4 changed files with 178 additions and 173 deletions

30
tools/amend-gitattributes.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/sh
# Copyright (C) 2025 Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Exit with error if commands exit with non-zero and if undefined variables are
# used.
set -eu
root_path=$(cd "$(dirname "${0}")/.." && pwd)
cd "${root_path}"
# Write to .gitattributes.
find . -type f -name '.gitattributes' -exec rm -f {} \;
for i in $(./tools/print-generated-files.sh); do
# We need to be lenient because we call this script in premium too. Files might not exist.
if test ! -f "${i}"; then
continue
fi
# Align to 32 characters.
dir=$(dirname "${i}")
name="/$(basename "${i}")"
length=$(( 32 - ${#name} ))
printf "%s%${length}s -diff merge=ours\\n" "${name}" ' ' >> "${dir}/.gitattributes"
done