Skip to content

Commit

Permalink
Merge branch 'master' into dev/pstorz/master/fedora-buildchain
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz committed Sep 15, 2020
2 parents acc600d + ef704fb commit 51d629d
Show file tree
Hide file tree
Showing 52 changed files with 527 additions and 102 deletions.
15 changes: 10 additions & 5 deletions .gitignore
Expand Up @@ -28,25 +28,29 @@ autoconf/config.log
debian/*.log
debian/bareos-bconsole.install
debian/bareos-bconsole.postinst
debian/bareos-common.install
debian/bareos-common.postinst
debian/bareos-common.preinst
debian/bareos-database-common.config
debian/bareos-database-common.install
debian/bareos-database-common.postinst
debian/bareos-database-mysql.install
debian/bareos-database-postgresql.dirs
debian/bareos-director.install
debian/bareos-database-postgresql.install
debian/bareos-database-sqlite3.install
debian/bareos-database-tools.install
debian/bareos-devel.install
debian/bareos-director-python-plugin.install
debian/bareos-director.bareos-dir.init
debian/bareos-common.install
debian/bareos-director.install
debian/bareos-director.postinst
debian/bareos-director.preinst
debian/bareos-director.service
debian/bareos-filedaemon-ceph-plugin.install
debian/bareos-filedaemon-glusterfs-plugin.install
debian/bareos-filedaemon-ldap-python-plugin.install
debian/bareos-filedaemon-libcloud-python-plugin.install
debian/bareos-filedaemon-percona-xtrabackup-python-plugin.install
debian/bareos-filedaemon-python-plugin.install
debian/bareos-filedaemon.bareos-fd.init
debian/bareos-filedaemon.install
Expand All @@ -69,9 +73,10 @@ debian/bareos-tools.install
debian/bareos-traymonitor.install
debian/bareos-traymonitor.postinst
debian/univention-bareos.postinst
debian/bareos-database-postgresql.install
debian/bareos-database-tools.install
debian/bareos-filedaemon-percona-xtrabackup-python-plugin.install

# generated sample-configuration
core/src/plugins/filed/python/ldap/python-ldap-conf.d/bareos-dir.d/fileset/plugin-ldap.conf.example
core/src/plugins/filed/python/ovirt/python-ovirt-conf.d/bareos-dir.d/fileset/plugin-ovirt.conf.example

# etags and cscope db
tags
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -173,6 +173,7 @@ Simone Caronni
Stefan Reddig
Stefan Warten
Stephan Duehr
Stev Dubau
Sébastien Marchal
Thomas Duemesnil
Thomas Glatthor
Expand Down
122 changes: 74 additions & 48 deletions core/cmake/BareosFindAllLibraries.cmake
Expand Up @@ -22,84 +22,103 @@ if(${SYSTEMD_FOUND})
set(HAVE_SYSTEMD 1)
endif()

if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(HAVE_PYTHON 1)
set(Python2_FOUND 1)
set(Python2_EXT_SUFFIX ".dll")

set(Python3_FOUND 1)
set(Python3_EXT_SUFFIX ".pyd")

# Python Plugins currently cannot be built for Solaris
elseif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
set(HAVE_PYTHON 0)
set(Python2_FOUND 0)
set(Python3_FOUND 0)

else()
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
message(STATUS "CMake too old for FindPython2/3, using FindPythonInterp")
set(Python2_FOUND FALSE)
set(Python3_FOUND FALSE)
set( Python_ADDITIONAL_VERSIONS 2.6 2.7)
set(Python_ADDITIONAL_VERSIONS 2.6 2.7)
find_package(PythonInterp)
find_package(PythonLibs)
message(STATUS "Found PYTHON_VERSION_MAJOR" ${PYTHON_VERSION_MAJOR})
if (PYTHON_VERSION_MAJOR EQUAL 2)
if(PYTHON_VERSION_MAJOR EQUAL 2)
set(Python2_FOUND ${PYTHONLIBS_FOUND})
set(Python2_LIBRARIES ${PYTHON_LIBRARIES})
set(Python2_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
set(Python2_EXECUTABLE ${PYTHON_EXECUTABLE})

elseif (PYTHON_VERSION_MAJOR EQUAL 3)
elseif(PYTHON_VERSION_MAJOR EQUAL 3)
set(Python3_FOUND ${PYTHONLIBS_FOUND})
set(Python3_LIBRARIES ${PYTHON_LIBRARIES})
set(Python3_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
endif()

set( Python_ADDITIONAL_VERSIONS 3.6 3.7 3.8 3.9)
set(Python_ADDITIONAL_VERSIONS 3.6 3.7 3.8 3.9)
find_package(PythonInterp)
find_package(PythonLibs)
message(STATUS "Found PYTHON_VERSION_MAJOR" ${PYTHON_VERSION_MAJOR})

if (PYTHON_VERSION_MAJOR EQUAL 2)
if(PYTHON_VERSION_MAJOR EQUAL 2)
set(Python2_FOUND ${PYTHONLIBS_FOUND})
set(Python2_LIBRARIES ${PYTHON_LIBRARIES})
set(Python2_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
set(Python2_EXECUTABLE ${PYTHON_EXECUTABLE})
elseif (PYTHON_VERSION_MAJOR EQUAL 3)
elseif(PYTHON_VERSION_MAJOR EQUAL 3)
set(Python3_FOUND ${PYTHONLIBS_FOUND})
set(Python3_LIBRARIES ${PYTHON_LIBRARIES})
set(Python3_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
endif()

else()
find_package (Python2 COMPONENTS Interpreter Development)
find_package (Python3 COMPONENTS Interpreter Development)
find_package(Python2 COMPONENTS Interpreter Development)
find_package(Python3 COMPONENTS Interpreter Development)
endif()

if(${Python2_FOUND} OR ${Python3_FOUND})
set(HAVE_PYTHON 1)
endif()

if(${Python2_FOUND})
set(PYTHON_EXECUTABLE ${Python2_EXECUTABLE} PARENT_SCOPE)
set(Python2_EXECUTABLE ${Python2_EXECUTABLE} PARENT_SCOPE)
execute_process(
COMMAND ${Python2_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/get_python_compile_settings.py
OUTPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/py2settings.cmake
)
include(${CMAKE_CURRENT_SOURCE_DIR}/py2settings.cmake)
set(PYTHON_EXECUTABLE
${Python2_EXECUTABLE}
PARENT_SCOPE
)
set(Python2_EXECUTABLE
${Python2_EXECUTABLE}
PARENT_SCOPE
)
execute_process(
COMMAND ${Python2_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/cmake/get_python_compile_settings.py
OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/py2settings.cmake
)
include(${CMAKE_CURRENT_BINARY_DIR}/py2settings.cmake)
endif()

if(${Python3_FOUND})
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE} PARENT_SCOPE)
set(Python3_EXECUTABLE ${Python3_EXECUTABLE} PARENT_SCOPE)
execute_process(
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/get_python_compile_settings.py
OUTPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/py3settings.cmake
)
include(${CMAKE_CURRENT_SOURCE_DIR}/py3settings.cmake)
set(PYTHON_EXECUTABLE
${Python3_EXECUTABLE}
PARENT_SCOPE
)
set(Python3_EXECUTABLE
${Python3_EXECUTABLE}
PARENT_SCOPE
)
execute_process(
COMMAND ${Python3_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/cmake/get_python_compile_settings.py
OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/py3settings.cmake
)
include(${CMAKE_CURRENT_BINARY_DIR}/py3settings.cmake)
endif()

else() # windows
set(HAVE_PYTHON 1)
set(Python2_FOUND 1)
set(Python2_EXT_SUFFIX ".dll")

set(Python3_FOUND 1)
set(Python3_EXT_SUFFIX ".pyd")
endif()


if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
include(FindPostgreSQL)
endif()
Expand All @@ -121,14 +140,18 @@ endif()
include(BareosFindLibraryAndHeaders)

bareosfindlibraryandheaders(
"vixDiskLib" "vixDiskLib.h" "/usr/lib/vmware-vix-disklib-distrib;/usr/lib/vmware-vix-disklib"
"vixDiskLib" "vixDiskLib.h"
"/usr/lib/vmware-vix-disklib-distrib;/usr/lib/vmware-vix-disklib"
)

# check for structmember physicalSectorSize in struct VixDiskLibCreateParams
if(VIXDISKLIB_FOUND)
include(CheckStructHasMember)
CHECK_STRUCT_HAS_MEMBER("VixDiskLibCreateParams" physicalSectorSize
${VIXDISKLIB_INCLUDE_DIRS}/vixDiskLib.h VIXDISKLIBCREATEPARAMS_HAS_PHYSICALSECTORSIZE)
check_struct_has_member(
"VixDiskLibCreateParams" physicalSectorSize
${VIXDISKLIB_INCLUDE_DIRS}/vixDiskLib.h
VIXDISKLIBCREATEPARAMS_HAS_PHYSICALSECTORSIZE
)
endif()

if(VIXDISKLIB_FOUND)
Expand All @@ -139,21 +162,23 @@ if(VIXDISKLIB_FOUND)
OR (NOT DEFINED vmware_folder)
)
string(
CONCAT
MSG
"VMware Vix Disklib was found. To enable the vmware plugin test, "
"please provide the required information:"
"example:"
" -Dvmware_user=Administrator@vsphere.local "
" -Dvmware_password=\"@one2threeBareos\" "
" -Dvmware_vm_name=testvm1 "
" -Dvmware_datacenter=mydc1 "
" -Dvmware_folder=\"/webservers\" "
" -Dvmware_server=139.178.73.195"
CONCAT MSG
"VMware Vix Disklib was found. To enable the vmware plugin test, "
"please provide the required information:"
"example:"
" -Dvmware_user=Administrator@vsphere.local "
" -Dvmware_password=\"@one2threeBareos\" "
" -Dvmware_vm_name=testvm1 "
" -Dvmware_datacenter=mydc1 "
" -Dvmware_folder=\"/webservers\" "
" -Dvmware_server=139.178.73.195"
)
message(WARNING ${MSG})
else()
set(enable_vmware_test 1 PARENT_SCOPE)
set(enable_vmware_test
1
PARENT_SCOPE
)
endif()
elseif(
(DEFINED vmware_server)
Expand All @@ -163,7 +188,8 @@ elseif(
OR (DEFINED vmware_folder)
)
message(
FATAL_ERROR "vmware options were set but VMware Vix Disklib was not found. Cannot run vmware tests."
FATAL_ERROR
"vmware options were set but VMware Vix Disklib was not found. Cannot run vmware tests."
)
endif()

Expand Down
2 changes: 1 addition & 1 deletion core/cmake/BareosGenerateDebianInfo.cmake
Expand Up @@ -54,7 +54,7 @@ if(GENERATE_DEBIAN_CONTROL)
file(READ ${CMAKE_SOURCE_DIR}/debian/control.bareos-webui DEBIAN_CONTROL_BAREOS_WEBUI)

if (VIXDISKLIB_FOUND)
file(READ ./debian/control.vmware
file(READ ${CMAKE_SOURCE_DIR}/debian/control.vmware
DEBIAN_CONTROL_VMWARE)
endif()

Expand Down
6 changes: 3 additions & 3 deletions core/src/console/console_conf.cc
Expand Up @@ -83,11 +83,11 @@ static ResourceItem dir_items[] = {
};

static ResourceTable resources[] = {
{ "Console", cons_items, R_CONSOLE, sizeof(ConsoleResource),
{ "Console", "Consoles", cons_items, R_CONSOLE, sizeof(ConsoleResource),
[] (){ res_cons = new ConsoleResource(); }, reinterpret_cast<BareosResource**>(&res_cons) },
{ "Director", dir_items, R_DIRECTOR, sizeof(DirectorResource),
{ "Director", "Directors", dir_items, R_DIRECTOR, sizeof(DirectorResource),
[] (){ res_dir = new DirectorResource(); }, reinterpret_cast<BareosResource**>(&res_dir) },
{nullptr, nullptr, 0, 0, nullptr, nullptr}
{nullptr, nullptr, nullptr, 0, 0, nullptr, nullptr}
};

/* clang-format on */
Expand Down
38 changes: 20 additions & 18 deletions core/src/dird/dird_conf.cc
Expand Up @@ -542,37 +542,37 @@ static ResourceItem counter_items[] = {
* name handler value code flags default_value
*/
static ResourceTable resources[] = {
{ "Director", dir_items, R_DIRECTOR, sizeof(DirectorResource),
{ "Director", "Directors", dir_items, R_DIRECTOR, sizeof(DirectorResource),
[] (){ res_dir = new DirectorResource(); }, reinterpret_cast<BareosResource**>(&res_dir) },
{ "Client", cli_items, R_CLIENT, sizeof(ClientResource),
{ "Client", "Clients", cli_items, R_CLIENT, sizeof(ClientResource),
[] (){ res_client = new ClientResource(); }, reinterpret_cast<BareosResource**>(&res_client) },
{ "JobDefs", job_items, R_JOBDEFS, sizeof(JobResource),
{ "JobDefs", "JobDefs", job_items, R_JOBDEFS, sizeof(JobResource),
[] (){ res_job = new JobResource(); }, reinterpret_cast<BareosResource**>(&res_job) },
{ "Job", job_items, R_JOB, sizeof(JobResource),
{ "Job", "Jobs", job_items, R_JOB, sizeof(JobResource),
[] (){ res_job = new JobResource(); }, reinterpret_cast<BareosResource**>(&res_job) },
{ "Storage", store_items, R_STORAGE, sizeof(StorageResource),
{ "Storage", "Storages", store_items, R_STORAGE, sizeof(StorageResource),
[] (){ res_store = new StorageResource(); }, reinterpret_cast<BareosResource**>(&res_store) },
{ "Catalog", cat_items, R_CATALOG, sizeof(CatalogResource),
{ "Catalog", "Catalogs", cat_items, R_CATALOG, sizeof(CatalogResource),
[] (){ res_cat = new CatalogResource(); }, reinterpret_cast<BareosResource**>(&res_cat) },
{ "Schedule", sch_items, R_SCHEDULE, sizeof(ScheduleResource),
{ "Schedule", "Schedules", sch_items, R_SCHEDULE, sizeof(ScheduleResource),
[] (){ res_sch = new ScheduleResource(); }, reinterpret_cast<BareosResource**>(&res_sch) },
{ "FileSet", fs_items, R_FILESET, sizeof(FilesetResource),
{ "FileSet", "FileSets", fs_items, R_FILESET, sizeof(FilesetResource),
[] (){ res_fs = new FilesetResource(); }, reinterpret_cast<BareosResource**>(&res_fs) },
{ "Pool", pool_items, R_POOL, sizeof(PoolResource),
{ "Pool", "Pools", pool_items, R_POOL, sizeof(PoolResource),
[] (){ res_pool = new PoolResource(); }, reinterpret_cast<BareosResource**>(&res_pool) },
{ "Messages", msgs_items, R_MSGS, sizeof(MessagesResource),
{ "Messages", "Messages", msgs_items, R_MSGS, sizeof(MessagesResource),
[] (){ res_msgs = new MessagesResource(); }, reinterpret_cast<BareosResource**>(&res_msgs) },
{ "Counter", counter_items, R_COUNTER, sizeof(CounterResource),
{ "Counter", "Counters", counter_items, R_COUNTER, sizeof(CounterResource),
[] (){ res_counter = new CounterResource(); }, reinterpret_cast<BareosResource**>(&res_counter) },
{ "Profile", profile_items, R_PROFILE, sizeof(ProfileResource),
{ "Profile", "Profiles", profile_items, R_PROFILE, sizeof(ProfileResource),
[] (){ res_profile = new ProfileResource(); }, reinterpret_cast<BareosResource**>(&res_profile) },
{ "Console", con_items, R_CONSOLE, sizeof(ConsoleResource),
{ "Console", "Consoles", con_items, R_CONSOLE, sizeof(ConsoleResource),
[] (){ res_con = new ConsoleResource(); }, reinterpret_cast<BareosResource**>(&res_con) },
{ "Device", NULL, R_DEVICE, sizeof(DeviceResource),/* info obtained from SD */
{ "Device", "Devices", NULL, R_DEVICE, sizeof(DeviceResource),/* info obtained from SD */
[] (){ res_dev = new DeviceResource(); }, reinterpret_cast<BareosResource**>(&res_dev) },
{ "User", user_items, R_USER, sizeof(UserResource),
{ "User", "Users", user_items, R_USER, sizeof(UserResource),
[] (){ res_user = new UserResource(); }, reinterpret_cast<BareosResource**>(&res_user) },
{nullptr, nullptr, 0, 0, nullptr, nullptr}
{ nullptr, nullptr, nullptr, 0, 0, nullptr, nullptr }
};

/**
Expand Down Expand Up @@ -2134,7 +2134,7 @@ bool FilesetResource::PrintConfig(

Dmsg0(200, "FilesetResource::PrintConfig\n");

send.ResourceTypeStart("FileSet");
send.ResourceTypeStart("FileSets");
send.ResourceStart(this->resource_name_);
send.KeyQuotedString("Name", this->resource_name_);

Expand Down Expand Up @@ -3856,7 +3856,9 @@ static void DumpResource(int type,
OutputFormatterResource(output_formatter);

if (!res) {
sendit(sock, _("No %s resource defined\n"), my_config->ResToStr(type));
PoolMem msg;
msg.bsprintf(_("No %s resource defined\n"), my_config->ResToStr(type));
output_formatter->message(MSG_TYPE_INFO, msg);
return;
}

Expand Down
4 changes: 3 additions & 1 deletion core/src/dird/ua_output.cc
Expand Up @@ -1224,7 +1224,9 @@ static bool ParseListBackupsCmd(UaContext* ua,
return false;
}

selection.bsprintf("AND Job.Type='B' AND Client.Name='%s' ",
/* allow jobtypes 'B' for Backup and 'A' or 'a' for archive (update job
* doesn't enforce a valid jobtype, so people have 'a' in their catalogs */
selection.bsprintf("AND Job.Type IN('B', 'A', 'a') AND Client.Name='%s' ",
ua->argv[client]);

/*
Expand Down
10 changes: 5 additions & 5 deletions core/src/filed/filed_conf.cc
Expand Up @@ -162,15 +162,15 @@ static ResourceItem dir_items[] = {
#include "lib/messages_resource_items.h"

static ResourceTable resources[] = {
{"Director", dir_items, R_DIRECTOR, sizeof(DirectorResource),
{"Director", "Directors", dir_items, R_DIRECTOR, sizeof(DirectorResource),
[]() { res_dir = new DirectorResource(); }, reinterpret_cast<BareosResource**>(&res_dir)},
{"FileDaemon", cli_items, R_CLIENT, sizeof(ClientResource),
{"FileDaemon", "FileDaemons", cli_items, R_CLIENT, sizeof(ClientResource),
[]() { res_client = new ClientResource(); }, reinterpret_cast<BareosResource**>(&res_client)},
{"Client", cli_items, R_CLIENT, sizeof(ClientResource),
{"Client", "Clients", cli_items, R_CLIENT, sizeof(ClientResource),
[]() { res_client = new ClientResource(); }, reinterpret_cast<BareosResource**>(&res_client)}, /* alias for filedaemon */
{"Messages", msgs_items, R_MSGS, sizeof(MessagesResource),
{"Messages", "Messages", msgs_items, R_MSGS, sizeof(MessagesResource),
[]() { res_msgs = new MessagesResource(); }, reinterpret_cast<BareosResource**>(&res_msgs)},
{nullptr, nullptr, 0, 0, nullptr, nullptr}
{nullptr, nullptr, nullptr, 0, 0, nullptr, nullptr}
};

/* clang-format on */
Expand Down

0 comments on commit 51d629d

Please sign in to comment.