#!/usr/bin/perl -w # Copyright (C) 2016 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 use strict; my $old_template = shift @ARGV; my $new_template = shift @ARGV; my $file = shift @ARGV; # Usage: git grep "(C) " | cut -d':' -f1 | sort -u | xargs -L 1 scripts/updateCopyright.pl old.header new.header # This will remove a verbatim copy of old.header from the file # given as the last argument and then inserts the new.header # instead. It may retain copyright year, copyright holder, author # lines or "this file is part of" information. # All lines of the old.header are compared to the lines in the file. # Exceptions are lines matching "Copyright (C) (\d+) ", "Author: " or # "file is part of" which will must also match both the old.template # as well as the file-line to be considered a match. # If there is no match between old.header and the start of file, then # the file is skipped. ### Set which information to keep from the file here: my $keepYear = 0; my $keepHolder = 1; my $keepContact = 1; my $keepPartOf = 1; my $keepAuthors = 1; ### Do not edit below this line... die "Usage: $0 /path/to/oldtemplate /path/to/newtemplate /path/to/file\n" unless $file; open TEMPLATE, "<$old_template" or die $!; my @oldT =