Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
version strings: added second copyright information
We now have two versions of copyright information:
  - Bareos, FSF and Planets (as it was before)
  - Bareos only (for new programs)
  • Loading branch information
pstorz authored and franku committed Jan 31, 2020
1 parent 480aa84 commit 8f3f538
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 32 deletions.
4 changes: 2 additions & 2 deletions core/src/console/console.cc
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2000-2011 Free Software Foundation Europe e.V.
Copyright (C) 2011-2012 Planets Communications B.V.
Copyright (C) 2013-2018 Bareos GmbH & Co. KG
Copyright (C) 2013-2020 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -110,7 +110,7 @@ static int EolCmd(FILE* input, BareosSocket* UA_sock);

static void usage()
{
kBareosVersionStrings.PrintCopyright(stderr, 2000);
kBareosVersionStrings.PrintCopyrightWithFsfAndPlanets(stderr, 2000);
fprintf(
stderr,
_("Usage: bconsole [-s] [-c config_file] [-d debug_level]\n"
Expand Down
4 changes: 2 additions & 2 deletions core/src/dird/dbcheck.cc
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2002-2011 Free Software Foundation Europe e.V.
Copyright (C) 2011-2016 Planets Communications B.V.
Copyright (C) 2013-2019 Bareos GmbH & Co. KG
Copyright (C) 2013-2020 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -126,7 +126,7 @@ const int number_commands =

static void usage()
{
kBareosVersionStrings.PrintCopyright(stderr, 2002);
kBareosVersionStrings.PrintCopyrightWithFsfAndPlanets(stderr, 2002);
fprintf(stderr,
"Usage: bareos-dbcheck [ options ] <working-directory> "
"<bareos-database> <user> <password> [<dbhost>] [<dbport>]\n"
Expand Down
2 changes: 1 addition & 1 deletion core/src/dird/dbcopy/dbcopy.cc
Expand Up @@ -182,7 +182,7 @@ class DbCopy {

void usage() noexcept
{
kBareosVersionStrings.PrintCopyright(stderr, 2000);
kBareosVersionStrings.PrintCopyright(stderr, 2020);

fprintf(stderr,
_("Usage: bareos-dbcopy [options] Source Destination\n"
Expand Down
4 changes: 2 additions & 2 deletions core/src/dird/dird.cc
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2000-2012 Free Software Foundation Europe e.V.
Copyright (C) 2011-2016 Planets Communications B.V.
Copyright (C) 2013-2019 Bareos GmbH & Co. KG
Copyright (C) 2013-2020 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -178,7 +178,7 @@ static bool DirDbLogInsert(JobControlRecord* jcr, utime_t mtime, char* msg)

static void usage()
{
kBareosVersionStrings.PrintCopyright(stderr, 2000);
kBareosVersionStrings.PrintCopyrightWithFsfAndPlanets(stderr, 2000);
fprintf(
stderr,
_("Usage: bareos-dir [options]\n"
Expand Down
4 changes: 2 additions & 2 deletions core/src/filed/filed.cc
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
Copyright (C) 2011-2012 Planets Communications B.V.
Copyright (C) 2013-2019 Bareos GmbH & Co. KG
Copyright (C) 2013-2020 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -55,7 +55,7 @@ static bool foreground = false;

static void usage()
{
kBareosVersionStrings.PrintCopyright(stderr, 2000);
kBareosVersionStrings.PrintCopyrightWithFsfAndPlanets(stderr, 2000);
fprintf(
stderr,
_("Usage: bareos-fd [options]\n"
Expand Down
36 changes: 31 additions & 5 deletions core/src/lib/version.c
Expand Up @@ -62,7 +62,7 @@
"self-compiled: Get official binaries and vendor support on bareos.com"
#endif

#define BAREOS_COPYRIGHT_MESSAGE \
#define BAREOS_COPYRIGHT_MESSAGE_WITH_FSF_AND_PLANETS \
"\n%s" \
"\n" \
"Copyright (C) 2013-%s Bareos GmbH & Co. KG\n" \
Expand All @@ -73,17 +73,41 @@
"\n"


static void FormatCopyright(char* out, size_t len, int FsfYear)
static void FormatCopyrightWithFsfAndPlanets(char* out, size_t len, int FsfYear)
{
snprintf(out, len, BAREOS_COPYRIGHT_MESSAGE,
snprintf(out, len, BAREOS_COPYRIGHT_MESSAGE_WITH_FSF_AND_PLANETS,
kBareosVersionStrings.ServicesMessage, kBareosVersionStrings.Year,
FsfYear, kBareosVersionStrings.Full, kBareosVersionStrings.Date,
HOST_OS, DISTNAME, DISTVER);
}
static void PrintCopyright(FILE* fh, int FsfYear)
static void PrintCopyrightWithFsfAndPlanets(FILE* fh, int FsfYear)
{
fprintf(fh, BAREOS_COPYRIGHT_MESSAGE_WITH_FSF_AND_PLANETS,
kBareosVersionStrings.ServicesMessage, kBareosVersionStrings.Year,
FsfYear, kBareosVersionStrings.Full, kBareosVersionStrings.Date,
HOST_OS, DISTNAME, DISTVER);
}


#define BAREOS_COPYRIGHT_MESSAGE \
"\n%s" \
"\n" \
"Copyright (C) %d-%s Bareos GmbH & Co. KG\n" \
"\n" \
"Version: %s (%s) %s %s %s\n" \
"\n"

static void FormatCopyright(char* out, size_t len, int StartYear)
{
snprintf(out, len, BAREOS_COPYRIGHT_MESSAGE,
kBareosVersionStrings.ServicesMessage, StartYear,
kBareosVersionStrings.Year, kBareosVersionStrings.Full,
kBareosVersionStrings.Date, HOST_OS, DISTNAME, DISTVER);
}
static void PrintCopyright(FILE* fh, int StartYear)
{
fprintf(fh, BAREOS_COPYRIGHT_MESSAGE, kBareosVersionStrings.ServicesMessage,
kBareosVersionStrings.Year, FsfYear, kBareosVersionStrings.Full,
StartYear, kBareosVersionStrings.Year, kBareosVersionStrings.Full,
kBareosVersionStrings.Date, HOST_OS, DISTNAME, DISTVER);
}

Expand All @@ -97,5 +121,7 @@ const struct BareosVersionStrings kBareosVersionStrings = {
.BinaryInfo = BAREOS_BINARY_INFO,
.ServicesMessage = BAREOS_SERVICES_MESSAGE,
.JoblogMessage = BAREOS_JOBLOG_MESSAGE,
.FormatCopyrightWithFsfAndPlanets = FormatCopyrightWithFsfAndPlanets,
.PrintCopyrightWithFsfAndPlanets = PrintCopyrightWithFsfAndPlanets,
.FormatCopyright = FormatCopyright,
.PrintCopyright = PrintCopyright};
8 changes: 5 additions & 3 deletions core/src/lib/version.h
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2000-2013 Free Software Foundation Europe e.V.
Copyright (C) 2010-2017 Planets Communications B.V.
Copyright (C) 2013-2019 Bareos GmbH & Co. KG
Copyright (C) 2013-2020 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -38,8 +38,10 @@ struct BareosVersionStrings {
const char* BinaryInfo;
const char* ServicesMessage;
const char* JoblogMessage;
void (*FormatCopyright)(char* out, size_t len, int FsfYear);
void (*PrintCopyright)(FILE* fh, int FsfYear);
void (*FormatCopyrightWithFsfAndPlanets)(char* out, size_t len, int FsfYear);
void (*PrintCopyrightWithFsfAndPlanets)(FILE* fh, int FsfYear);
void (*FormatCopyright)(char* out, size_t len, int StartYear);
void (*PrintCopyright)(FILE* fh, int StartYear);
};

extern const struct BareosVersionStrings kBareosVersionStrings;
Expand Down
6 changes: 3 additions & 3 deletions core/src/qt-tray-monitor/tray-monitor.cc
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2004-2011 Free Software Foundation Europe e.V.
Copyright (C) 2011-2012 Planets Communications B.V.
Copyright (C) 2013-2016 Bareos GmbH & Co. KG
Copyright (C) 2013-2020 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -45,8 +45,8 @@ static QCoreApplication* app = nullptr;
static void usage()
{
std::vector<char> copyright(1024);
kBareosVersionStrings.FormatCopyright(copyright.data(), copyright.size(),
2004);
kBareosVersionStrings.FormatCopyrightWithFsfAndPlanetsWithFsfAndPlanets(
copyright.data(), copyright.size(), 2004);
QString out =
QString(_("%1"
"Usage: tray-monitor [options]\n"
Expand Down
4 changes: 2 additions & 2 deletions core/src/stored/bcopy.cc
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2002-2012 Free Software Foundation Europe e.V.
Copyright (C) 2011-2012 Planets Communications B.V.
Copyright (C) 2013-2019 Bareos GmbH & Co. KG
Copyright (C) 2013-2020 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -72,7 +72,7 @@ static Session_Label sessrec;

static void usage()
{
kBareosVersionStrings.PrintCopyright(stderr, 2002);
kBareosVersionStrings.PrintCopyrightWithFsfAndPlanets(stderr, 2002);
fprintf(
stderr,
_("Usage: bcopy [-d debug_level] <input-archive> <output-archive>\n"
Expand Down
4 changes: 2 additions & 2 deletions core/src/stored/bextract.cc
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2000-2011 Free Software Foundation Europe e.V.
Copyright (C) 2011-2012 Planets Communications B.V.
Copyright (C) 2013-2019 Bareos GmbH & Co. KG
Copyright (C) 2013-2020 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -88,7 +88,7 @@ static uint64_t fileAddr = 0; /* file write address */

static void usage()
{
kBareosVersionStrings.PrintCopyright(stderr, 2000);
kBareosVersionStrings.PrintCopyrightWithFsfAndPlanets(stderr, 2000);
fprintf(stderr,
_("Usage: bextract <options> <bareos-archive-device-name> "
"<directory-to-store-files>\n"
Expand Down
4 changes: 2 additions & 2 deletions core/src/stored/bls.cc
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2000-2012 Free Software Foundation Europe e.V.
Copyright (C) 2011-2012 Planets Communications B.V.
Copyright (C) 2013-2019 Bareos GmbH & Co. KG
Copyright (C) 2013-2020 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -80,7 +80,7 @@ static BootStrapRecord* bsr = NULL;

static void usage()
{
kBareosVersionStrings.PrintCopyright(stderr, 2000);
kBareosVersionStrings.PrintCopyrightWithFsfAndPlanets(stderr, 2000);
fprintf(
stderr,
_("Usage: bls [options] <device-name>\n"
Expand Down
4 changes: 2 additions & 2 deletions core/src/stored/bscan.cc
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2001-2011 Free Software Foundation Europe e.V.
Copyright (C) 2011-2016 Planets Communications B.V.
Copyright (C) 2013-2019 Bareos GmbH & Co. KG
Copyright (C) 2013-2020 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -137,7 +137,7 @@ static int num_restoreobjects = 0;

static void usage()
{
kBareosVersionStrings.PrintCopyright(stderr, 2001);
kBareosVersionStrings.PrintCopyrightWithFsfAndPlanets(stderr, 2001);
fprintf(
stderr,
_("Usage: bscan [ options ] <device-name>\n"
Expand Down
4 changes: 2 additions & 2 deletions core/src/stored/btape.cc
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2000-2012 Free Software Foundation Europe e.V.
Copyright (C) 2011-2012 Planets Communications B.V.
Copyright (C) 2013-2019 Bareos GmbH & Co. KG
Copyright (C) 2013-2020 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -2902,7 +2902,7 @@ static void HelpCmd()

static void usage()
{
kBareosVersionStrings.PrintCopyright(stderr, 2000);
kBareosVersionStrings.PrintCopyrightWithFsfAndPlanets(stderr, 2000);
fprintf(
stderr,
_("Usage: btape <options> <device_name>\n"
Expand Down
4 changes: 2 additions & 2 deletions core/src/stored/stored.cc
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2000-2012 Free Software Foundation Europe e.V.
Copyright (C) 2011-2012 Planets Communications B.V.
Copyright (C) 2013-2019 Bareos GmbH & Co. KG
Copyright (C) 2013-2020 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -88,7 +88,7 @@ static bool foreground = 0;

static void usage()
{
kBareosVersionStrings.PrintCopyright(stderr, 2000);
kBareosVersionStrings.PrintCopyrightWithFsfAndPlanets(stderr, 2000);
fprintf(
stderr,
_("Usage: bareos-sd [options]\n"
Expand Down

0 comments on commit 8f3f538

Please sign in to comment.