#!/usr/bin/perl -w ############################################################################ # # Copyright (C) 2016 The Qt Company Ltd. # Contact: https://www.qt.io/licensing/ # # This file is part of Qt Creator. # # Commercial License Usage # Licensees holding valid commercial Qt licenses may use this file in # accordance with the commercial license agreement provided with the # Software or, alternatively, in accordance with the terms contained in # a written agreement between you and The Qt Company. For licensing terms # and conditions see https://www.qt.io/terms-conditions. For further # information use the contact form at https://www.qt.io/contact-us. # # GNU General Public License Usage # Alternatively, this file may be used under the terms of the GNU # General Public License version 3 as published by the Free Software # Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT # included in the packaging of this file. Please review the following # information to ensure the GNU General Public License requirements will # be met: https://www.gnu.org/licenses/gpl-3.0.html. # ############################################################################ 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 =