]> granicus.if.org Git - strace/commitdiff
update_copyright_years.sh: workaround for old git versions
authorEugene Syromyatnikov <evgsyr@gmail.com>
Fri, 25 Aug 2017 22:28:45 +0000 (00:28 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 27 Aug 2017 11:06:14 +0000 (11:06 +0000)
Old git versions (like the one shipped in Debian 8) do not support setting
date format with --date, working this around by processing git log output
with date +%Y.

* main/update_copyright_years.sh (process_file) <first_commit_year,
last_commit_year>: Change format to format:%aD, remove --date, supply
output as a -d option argument to date +%Y.

maint/update_copyright_years.sh

index 74442455dd3083fe6d790c2c0eb43af62a80bbaf..b12566af50b9aa583540ba25f9fd713098115100 100755 (executable)
@@ -111,10 +111,10 @@ process_file()
                continue
        fi
 
-       last_commit_year=$(git log -n1 --format=format:%ad \
-               --date=format:%Y -- "$f")
-       first_commit_year=$(git log --reverse --format=format:%ad \
-               --date=format:%Y -- "$f" | head -n 1)
+       last_commit_year=$(date +%Y -d "$(git log -n1 --format=format:%aD \
+               -- "$f")")
+       first_commit_year=$(date +%Y -d "$(git log --reverse --format=format:%aD \
+               -- "$f" | head -n 1)")
        copyright_year=$(printf '%s' "$copyright_year_raw" |
                sort -r -n | head -n 1)
        start_note='from git log'