X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=util%2Fopenssl-update-copyright;h=14f8d206e0431951fa38bd5f5997f9cea7f98db1;hp=98d1365625961b84a8a58bede8268a561fc0d418;hb=48f66f811568e3623095c118616e031d6bc4e0d6;hpb=b26d696c95244055eed634129cd8316a1b298577 diff --git a/util/openssl-update-copyright b/util/openssl-update-copyright index 98d1365625..14f8d206e0 100755 --- a/util/openssl-update-copyright +++ b/util/openssl-update-copyright @@ -1,8 +1,8 @@ -#!/bin/bash +#!/usr/bin/env bash # # Copyright 2018 The OpenSSL Project Authors. All Rights Reserved. # -# Licensed under the OpenSSL license (the "License"). You may not use +# Licensed under the Apache License 2.0 (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy # in the file LICENSE in the source distribution or at # https://www.openssl.org/source/license.html @@ -12,12 +12,17 @@ myname="$(basename $0)" this_year="$(date '+%Y')" some_year="[12][0-9][0-9][0-9]" +year_range="(${some_year})(-${some_year})?" copyright_owner="The OpenSSL Project" +copyright="Copyright .*${year_range} .*${copyright_owner}" -search="Copyright \(([cC]) \)\?\(${some_year}\)\(-${some_year}\)\? ${copyright_owner}" -replace="Copyright \1\2-${this_year} ${copyright_owner}" - +# sed_script: +# for all lines that contain ${copyright} : { +# replace years yyyy-zzzz (or year yyyy) by yyyy-${this_year} +# replace repeated years yyyy-yyyy by yyyy +# } +sed_script="/${copyright}/{ s/${year_range}/\1-${this_year}/ ; s/(${some_year})-\1/\1/ }" function usage() { cat >&2 <&2 fi