File: get-file-authors-and-dates.sh

package info (click to toggle)
kadu 4.1-1.1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 54,532 kB
  • sloc: cpp: 128,331; sh: 988; awk: 105; makefile: 75
file content (13 lines) | stat: -rwxr-xr-x 425 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env bash

BASEDIR=${0%/*}
FILE=$1

echo "Updating copyright data for $FILE"

AWK_EXTRACT=$BASEDIR/get-file-authors-and-dates.awk
AWK_INSERT=$BASEDIR/replace-copyright-block.awk

AUTHORS=`git --no-pager log --date=short --pretty=format:"%ad%x09%an (%ae)" $FILE | cut -c1,2,3,4,11- | sort | uniq | awk -f $AWK_EXTRACT`
gawk --assign AUTHORS="$AUTHORS" -f $AWK_INSERT $FILE > $FILE.copyright
mv $FILE.copyright $FILE