]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#10,!3] Copyright years are now autogenerated.
authorTomek Mrugalski <tomasz@isc.org>
Tue, 29 Oct 2019 17:33:17 +0000 (18:33 +0100)
committerTomek Mrugalski <tomasz@isc.org>
Tue, 29 Oct 2019 17:58:12 +0000 (18:58 +0100)
doc/docgen/kea_docgen.cc

index 3a9044e834cb5a1d5e97e32462df8068e17bdcdd..0ca6f4cc46d8aa1f95a283e065f0a8e1d8af4ebe 100644 (file)
@@ -10,6 +10,7 @@
 #include <vector>
 #include <map>
 #include <set>
+#include <ctime>
 
 #include <exceptions/exceptions.h>
 #include <cc/data.h>
@@ -157,7 +158,16 @@ public:
     /// @param f stream to write copyrights to
     void generateCopyright(stringstream& f) {
         f << "<!--" << endl;
-        f << " - Copyright (C) 2018 Internet Systems Consortium, Inc. (\"ISC\")" << endl;
+
+        std::time_t t = time(0);
+        std::tm* now = std::localtime(&t);
+
+        if (now->tm_year + 1900 == 2018) {
+            f << " - Copyright (C) 2018 Internet Systems Consortium, Inc. (\"ISC\")" << endl;
+        } else {
+            // Whoaa! the future is now!
+            f << " - Copyright (C) 2018-" << (now->tm_year + 1900) << " Internet Systems Consortium, Inc. (\"ISC\")" << endl;
+        }
         f << " -" << endl;
         f << " - This Source Code Form is subject to the terms of the Mozilla Public" << endl;
         f << " - License, v. 2.0. If a copy of the MPL was not distributed with this" << endl;