From b22b3235ff986c2378933c5aaa132f99224f5965 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Mon, 1 Oct 2018 12:41:34 +0200 Subject: [PATCH] Set current year in generator templates (#8396) (#8414) (cherry picked from commit e1ca577566e9f6d2d53d74bfef0254993767d24b) --- CHANGELOG-developer.asciidoc | 1 + generator/beat/{beat}/LICENSE.txt | 2 +- generator/beat/{beat}/NOTICE.txt | 2 +- generator/metricbeat/{beat}/LICENSE.txt | 2 +- generator/metricbeat/{beat}/NOTICE.txt | 2 +- script/generate.py | 6 ++++-- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG-developer.asciidoc b/CHANGELOG-developer.asciidoc index 4a068834624..a407e265a4b 100644 --- a/CHANGELOG-developer.asciidoc +++ b/CHANGELOG-developer.asciidoc @@ -47,3 +47,4 @@ The list below covers the major changes between 6.3.0 and master only. - New function `AddTagsWithKey` is added, so `common.MapStr` can be enriched with tags with an arbitrary key. {pull}7991[7991] - Libbeat provides a new function `cmd.GenRootCmdWithSettings` that should be preferred over deprecated functions `cmd.GenRootCmd`, `cmd.GenRootCmdWithRunFlags`, and `cmd.GenRootCmdWithIndexPrefixWithRunFlags`. {pull}7850[7850] +- Set current year in generator templates. {pull}8396[8396] diff --git a/generator/beat/{beat}/LICENSE.txt b/generator/beat/{beat}/LICENSE.txt index a6c296d81a6..3e5c88efac8 100644 --- a/generator/beat/{beat}/LICENSE.txt +++ b/generator/beat/{beat}/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2017 {full_name} +Copyright (c) {year} {full_name} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/generator/beat/{beat}/NOTICE.txt b/generator/beat/{beat}/NOTICE.txt index 3898d85d3ba..b10d905153e 100644 --- a/generator/beat/{beat}/NOTICE.txt +++ b/generator/beat/{beat}/NOTICE.txt @@ -1,5 +1,5 @@ {beat} -Copyright 2017 {full_name} +Copyright {year} {full_name} This product includes software developed by The Apache Software Foundation (http://www.apache.org/). diff --git a/generator/metricbeat/{beat}/LICENSE.txt b/generator/metricbeat/{beat}/LICENSE.txt index a6c296d81a6..3e5c88efac8 100644 --- a/generator/metricbeat/{beat}/LICENSE.txt +++ b/generator/metricbeat/{beat}/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2017 {full_name} +Copyright (c) {year} {full_name} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/generator/metricbeat/{beat}/NOTICE.txt b/generator/metricbeat/{beat}/NOTICE.txt index 3898d85d3ba..b10d905153e 100644 --- a/generator/metricbeat/{beat}/NOTICE.txt +++ b/generator/metricbeat/{beat}/NOTICE.txt @@ -1,5 +1,5 @@ {beat} -Copyright 2017 {full_name} +Copyright {year} {full_name} This product includes software developed by The Apache Software Foundation (http://www.apache.org/). diff --git a/script/generate.py b/script/generate.py index 2d9342ce220..9ffaf778a18 100644 --- a/script/generate.py +++ b/script/generate.py @@ -1,5 +1,6 @@ -import os import argparse +import datetime +import os # Creates a new beat or metricbeat based on the given parameters @@ -97,7 +98,8 @@ def replace_variables(content): .replace("{beat}", beat) \ .replace("{Beat}", beat.capitalize()) \ .replace("{beat_path}", beat_path) \ - .replace("{full_name}", full_name) + .replace("{full_name}", full_name) \ + .replace("{year}", str(datetime.datetime.now().year)) def get_parser():