af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt#!/bin/sh
3b922eeb6294d579edfd720ac162287e6736e07aTinderbox User#
1ca2cf024391992fe14b2df7d3ae0f575d074452Evan Hunt# Copyright (C) 2012, 2016, 2017 Internet Systems Consortium, Inc. ("ISC")
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# file, You can obtain one at http://mozilla.org/MPL/2.0/.
47798e626d8804dab2a003e21b55b633511fc8b1Mark Andrews
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt# Find the list of files that have been touched in the Git repository
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt# during the current calendar year. This is done by walking backwards
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt# through the output of "git whatchanged" until a year other than the
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt# current one is seen. Used by merge_copyrights.
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Huntthisyear=`date +%Y`
8d59536d7c24e137f2bb1796b962bbafd8cac701Evan Huntwhen="`expr $thisyear - 1`-12-31"
8d59536d7c24e137f2bb1796b962bbafd8cac701Evan Huntgit whatchanged --since="$when" --pretty="" | awk '
87a40683bf81a4a18291c093b7da67ca46760607Mark Andrews BEGIN { change=0 }
af9dbf1ccdd53933aaae9300d13ce0965d39b067Evan Hunt NF == 0 { next; }
87a40683bf81a4a18291c093b7da67ca46760607Mark Andrews $(NF-1) ~ /[AM]/ { print "./" $NF; change=1 }
87a40683bf81a4a18291c093b7da67ca46760607Mark Andrews END { if (change) print "./COPYRIGHT" } ' | sort | uniq