]>
git.ipfire.org Git - thirdparty/openssl.git/blob - util/perl/OpenSSL/copyright.pm
2 # Copyright 2021-2022 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the Apache License 2.0 (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
12 package OpenSSL
::copyright
;
17 return $ENV{'OSSL_COPYRIGHT_YEAR'} if defined $ENV{'OSSL_COPYRIGHT_YEAR'};
19 # Get the current year. We use that as the default because the other
20 # common case is that someone unpacked a tarfile and the file dates
21 # are't properly set on extract.
22 my $YEAR = [localtime()]->[5] + 1900;
24 # See if git's available
26 "git log -1 --date=short --format=format:%cd $file 2>/dev/null|"
30 $LINE =~ s/^([0-9]*)-.*/$1/;
31 $YEAR = $LINE if $LINE;