Skip to content

Commit

Permalink
Merge pull request #663 from arogge/dev/arogge/master/check-sources
Browse files Browse the repository at this point in the history
Apply other check-sources plugins
  • Loading branch information
arogge committed Nov 17, 2020
2 parents f157919 + a9a073e commit 9c59c64
Show file tree
Hide file tree
Showing 1,450 changed files with 9,753 additions and 10,747 deletions.
23 changes: 14 additions & 9 deletions .clang-format
@@ -1,25 +1,30 @@
BasedOnStyle: Google
Language: Cpp
Standard: Cpp11
BreakBeforeBraces: Custom
BraceWrapping:
AfterFunction: true
AfterEnum: true
ColumnLimit: 80
Cpp11BracedListStyle: true

AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignTrailingComments: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: true
AllowShortFunctionsOnASingleLine: true
AllowShortLambdasOnASingleLine: All
BinPackParameters: false
BreakConstructorInitializers: BeforeComma
BraceWrapping:
AfterFunction: true
AfterEnum: true
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: true
BreakBeforeTernaryOperators: true
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
ColumnLimit: 80
Cpp11BracedListStyle: true
DerivePointerAlignment: false
ForEachMacros: ['foreach_alist', 'foreach_alist_index', 'foreach_alist_rindex', 'foreach_child', 'foreach_dlist', 'foreach_htable', 'foreach_jcr', 'foreach_rblist', 'foreach_res', 'foreach_vol']
IndentPPDirectives: AfterHash
MaxEmptyLinesToKeep: 2
PointerAlignment: Left
SortIncludes: false
ForEachMacros: ['foreach_alist', 'foreach_alist_index', 'foreach_alist_rindex', 'foreach_child', 'foreach_dlist', 'foreach_htable', 'foreach_jcr', 'foreach_rblist', 'foreach_res', 'foreach_vol']
9 changes: 9 additions & 0 deletions .git-blame-ignore-revs
Expand Up @@ -13,3 +13,12 @@ aa367252d4a57e65c0ca728940a63d0029e992c0

# check-sources bulk change for copyrights
95f301603d14bab6d0938c1a21fb1aaaab313d0a

# check-sources bulk change for clang-format
31e3618dff5026edb7cf583d1456197b55177b5a
# check-sources bulk change for cmake-format
0f01df3131a354adcda4ad16759dde57df7ec7a6
# check-sources bulk change for black
e91d96ef5d1abf97c68541a4e2cb74cf40f6ff1f
# check-sources bulk change for whitespace
84a44ca6cc4d3bd4fcbe428c6433722cae251d35
6 changes: 3 additions & 3 deletions .github/workflows/publish-release-to-pypi.yml
Expand Up @@ -9,13 +9,13 @@ jobs:
build-and-publish:
name: "Build python-bareos and publish it to https://pypi.org/"
runs-on: ubuntu-18.04

steps:
- name: "Checkout source"
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: "Checkout tags"
# for get-version.sh, an unshallow git checkout with tags is needed.
run: git fetch --tag
Expand All @@ -24,7 +24,7 @@ jobs:
uses: actions/setup-python@v1
with:
python-version: 3.7

- name: "Build python package"
run: |
pip install --user wheel
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-to-test-pypi.yml
Expand Up @@ -18,13 +18,13 @@ jobs:
build-and-publish:
name: "Build python-bareos and publish it to https://test.pypi.org/"
runs-on: ubuntu-18.04

steps:
- name: "Checkout source"
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: "Checkout tags"
# for get-version.sh, an unshallow git checkout with tags is needed.
run: git fetch --tag
Expand All @@ -33,7 +33,7 @@ jobs:
uses: actions/setup-python@v1
with:
python-version: 3.7

- name: "Build python package"
run: |
pip install --user wheel
Expand Down
2 changes: 1 addition & 1 deletion .quality-gates.yml
@@ -1,7 +1,7 @@
---
# quality gates to configure Jenkins build pipeline
coverage:
lines:
lines:
healthy: 24
unhealthy: 23
unstable: 24
Expand Down
1 change: 0 additions & 1 deletion AUTHORS
Expand Up @@ -195,4 +195,3 @@ Wolfgang Denk
Yuri Timofeev
Yves Orton
Zilvinas Krapavickas

9 changes: 4 additions & 5 deletions CTestConfig.cmake
Expand Up @@ -17,13 +17,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.

# This file should be placed in the root directory of your project.
# Then modify the CMakeLists.txt file in the root directory of your
# project to incorporate the testing dashboard.
# This file should be placed in the root directory of your project. Then modify
# the CMakeLists.txt file in the root directory of your project to incorporate
# the testing dashboard.
#
# # The following are required to submit to the CDash dashboard:
# ENABLE_TESTING()
# INCLUDE(CTest)
# ENABLE_TESTING() INCLUDE(CTest)

set(CTEST_PROJECT_NAME "Bareos")
set(CTEST_NIGHTLY_START_TIME "23:00:00 CET")
Expand Down
9 changes: 4 additions & 5 deletions README.md
Expand Up @@ -8,15 +8,15 @@

[Bareos (Backup Archiving Recovery Open Sourced)](https://www.bareos.org/) is a reliable, cross-network open source software for backup, archiving and recovery of data for all well-established operating systems. Features of Bareos include amongst others:

- True open source software; no open-core or other restrictions; License AGPLv3
- True open source software; no open-core or other restrictions; License AGPLv3
- network based
- backends include Ceph, Gluster, S3
- multiple clients and storages possible; Active / passive clients possible
- Backup Clients ('Bareos-FD') available on Linux, Windows, MacOS, Solaris, HP-UX, AIX, BSD
- Backup Clients ('Bareos-FD') available on Linux, Windows, MacOS, Solaris, HP-UX, AIX, BSD
- Python plugin interface
- SAN-Backups using NDMP (with DAR/DDAR); NDMP tape support
- SAN-Backups using NDMP (with DAR/DDAR); NDMP tape support
- Always Incremental Backup scheme
- VMWare Plugin
- VMWare Plugin
- Encryption
- Scriptable CLI
- web based graphical interface (webui)
Expand Down Expand Up @@ -53,4 +53,3 @@ The Bareos project offers two mailing lists: bareos-users and bareos-devel.
### Packages

* [http://download.bareos.org](http://download.bareos.org)

1 change: 0 additions & 1 deletion SPONSORS.md
Expand Up @@ -3,4 +3,3 @@ Several companies helped to improve the Bareos project by funding parts of the d
See https://www.bareos.com/en/co-funding.html for information about funded development.

See https://www.bareos.com/en/sponsors.html for information about Bareos sponsors.

8 changes: 4 additions & 4 deletions cmake/BareosCheckAcl.cmake
Expand Up @@ -23,12 +23,12 @@ find_program(GETFACL_PROG getfacl)
set(SETFACL_WORKS NO)
if(SETFACL_PROG AND GETFACL_PROG)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/acl-test-file.txt" "Just a testfile")
exec_program(${SETFACL_PROG}
${CMAKE_CURRENT_BINARY_DIR}
exec_program(
${SETFACL_PROG} ${CMAKE_CURRENT_BINARY_DIR}
ARGS "-m user:0:rw- acl-test-file.txt"
RETURN_VALUE SETFACL_RETURN)
RETURN_VALUE SETFACL_RETURN
)
if(SETFACL_RETURN EQUAL 0)
set(SETFACL_WORKS YES)
endif()
endif()

12 changes: 7 additions & 5 deletions cmake/BareosCheckXattr.cmake
Expand Up @@ -22,13 +22,15 @@ find_program(GETFATTR_PROG getfattr)

set(SETFATTR_WORKS NO)
if(SETFATTR_PROG AND GETFATTR_PROG)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/xattr-test-file.txt" "Just a testfile")
exec_program(${SETFATTR_PROG}
${CMAKE_CURRENT_BINARY_DIR}
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/xattr-test-file.txt"
"Just a testfile"
)
exec_program(
${SETFATTR_PROG} ${CMAKE_CURRENT_BINARY_DIR}
ARGS "--name=user.cmake-check --value=xattr-value xattr-test-file.txt"
RETURN_VALUE SETFATTR_RETURN)
RETURN_VALUE SETFATTR_RETURN
)
if(SETFATTR_RETURN EQUAL 0)
set(SETFATTR_WORKS YES)
endif()
endif()

54 changes: 13 additions & 41 deletions cmake/BareosVersionFromGit.cmake
Expand Up @@ -19,11 +19,7 @@

if(Git_FOUND)
execute_process(
COMMAND
${GIT_EXECUTABLE}
log
-1
--pretty=format:%ct
COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:%ct
RESULT_VARIABLE GIT_COMMIT_TIMESTAMP_RESULT
OUTPUT_VARIABLE GIT_COMMIT_TIMESTAMP
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
Expand All @@ -33,28 +29,16 @@ endif()

if(GIT_COMMIT_TIMESTAMP_RESULT EQUAL 0)
execute_process(
COMMAND
${GIT_EXECUTABLE}
describe
--tags
--exact-match
--match
"Release/*"
--dirty=.dirty
COMMAND ${GIT_EXECUTABLE} describe --tags --exact-match --match "Release/*"
--dirty=.dirty
RESULT_VARIABLE GIT_DESCRIBE_RELEASE_RESULT
OUTPUT_VARIABLE GIT_DESCRIBE_OUTPUT
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT GIT_DESCRIBE_RELEASE_RESULT EQUAL 0)
execute_process(
COMMAND
${GIT_EXECUTABLE}
describe
--tags
--match
"WIP/*"
--dirty=.dirty
COMMAND ${GIT_EXECUTABLE} describe --tags --match "WIP/*" --dirty=.dirty
RESULT_VARIABLE GIT_DESCRIBE_WIP_RESULT
OUTPUT_VARIABLE GIT_DESCRIBE_OUTPUT
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
Expand All @@ -64,38 +48,26 @@ if(GIT_COMMIT_TIMESTAMP_RESULT EQUAL 0)
endif()

if(NOT GIT_DESCRIBE_OUTPUT STREQUAL "")
set(
GIT_DESCRIBE_REGEX_LONG
"^([^/]+)/([^-]+)-(([^-]+)?)-?([0-9]+)-g([0-9a-f]+(.dirty)?)[ \n]*"
set(GIT_DESCRIBE_REGEX_LONG
"^([^/]+)/([^-]+)-(([^-]+)?)-?([0-9]+)-g([0-9a-f]+(.dirty)?)[ \n]*"
)
set(GIT_DESCRIBE_REPLACE_LONG "\\2~\\3\\5.\\6")
set(GIT_DESCRIBE_REGEX_SHORT "^([^/]+)/([0-9.]+)((-[^-]+)?)((.dirty)?)[ \n]*")
set(GIT_DESCRIBE_REPLACE_SHORT "\\2\\3\\5")

string(
REGEX
MATCH
"${GIT_DESCRIBE_REGEX_LONG}"
GIT_DESCRIBE_REGEX_LONG_MATCH
"${GIT_DESCRIBE_OUTPUT}"
string(REGEX MATCH "${GIT_DESCRIBE_REGEX_LONG}" GIT_DESCRIBE_REGEX_LONG_MATCH
"${GIT_DESCRIBE_OUTPUT}"
)
if(GIT_DESCRIBE_REGEX_LONG_MATCH STREQUAL "")
string(
REGEX
REPLACE
"${GIT_DESCRIBE_REGEX_SHORT}"
"${GIT_DESCRIBE_REPLACE_SHORT}"
GIT_DESCRIBE_VERSION
"${GIT_DESCRIBE_OUTPUT}"
REPLACE "${GIT_DESCRIBE_REGEX_SHORT}" "${GIT_DESCRIBE_REPLACE_SHORT}"
GIT_DESCRIBE_VERSION "${GIT_DESCRIBE_OUTPUT}"
)
else()
string(
REGEX
REPLACE
"${GIT_DESCRIBE_REGEX_LONG}"
"${GIT_DESCRIBE_REPLACE_LONG}"
GIT_DESCRIBE_VERSION
"${GIT_DESCRIBE_OUTPUT}"
string(REGEX
REPLACE "${GIT_DESCRIBE_REGEX_LONG}" "${GIT_DESCRIBE_REPLACE_LONG}"
GIT_DESCRIBE_VERSION "${GIT_DESCRIBE_OUTPUT}"
)
endif()
endif()
27 changes: 14 additions & 13 deletions cmake/uninstall.cmake 100755 → 100644
Expand Up @@ -21,24 +21,25 @@
set(MANIFEST "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")

if(NOT EXISTS ${MANIFEST})
message(FATAL_ERROR "Cannot find install manifest: '${MANIFEST}'")
message(FATAL_ERROR "Cannot find install manifest: '${MANIFEST}'")
endif()

file(STRINGS ${MANIFEST} files)
foreach(file ${files})
if(EXISTS ${file})
message(STATUS "Removing file: '${file}'")
if(EXISTS ${file})
message(STATUS "Removing file: '${file}'")

exec_program(
${CMAKE_COMMAND} ARGS "-E remove ${file}"
OUTPUT_VARIABLE stdout
RETURN_VALUE result
)
exec_program(
${CMAKE_COMMAND} ARGS
"-E remove ${file}"
OUTPUT_VARIABLE stdout
RETURN_VALUE result
)

if(NOT "${result}" STREQUAL 0)
message(FATAL_ERROR "Failed to remove file: '${file}'.")
endif()
else()
MESSAGE(STATUS "File '${file}' does not exist.")
if(NOT "${result}" STREQUAL 0)
message(FATAL_ERROR "Failed to remove file: '${file}'.")
endif()
else()
message(STATUS "File '${file}' does not exist.")
endif()
endforeach(file)
9 changes: 4 additions & 5 deletions core/CTestConfig.cmake
Expand Up @@ -17,13 +17,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.

# This file should be placed in the root directory of your project.
# Then modify the CMakeLists.txt file in the root directory of your
# project to incorporate the testing dashboard.
# This file should be placed in the root directory of your project. Then modify
# the CMakeLists.txt file in the root directory of your project to incorporate
# the testing dashboard.
#
# # The following are required to submit to the CDash dashboard:
# ENABLE_TESTING()
# INCLUDE(CTest)
# ENABLE_TESTING() INCLUDE(CTest)

set(CTEST_PROJECT_NAME "Bareos")
set(CTEST_NIGHTLY_START_TIME "23:00:00 CET")
Expand Down
4 changes: 1 addition & 3 deletions core/README.configsubdirectories
Expand Up @@ -40,7 +40,7 @@ When updating from bareos < 16.2, most of these changes are not relevant, as the
* $CONFIGDIR/$COMPONENT.d/$RESOURCE/$NAME.conf.example
* For example, the bareos-webui comes with two config resources for the bareos-director:
* $CONFIGDIR/bareos-director.d/profile/webui.conf
* $CONFIGDIR/bareos-director.d/console/user1.conf.example
* $CONFIGDIR/bareos-director.d/console/user1.conf.example
* modified resource names:
* $HOSTNAME-dir => bareos-dir
* $HOSTNAME-sd => bareos-sd
Expand Down Expand Up @@ -77,5 +77,3 @@ How to use configsubdirectories
* The easy way is:
* mkdir $CONFIGDIR/$COMPONENT.d/migrate && mv $CONFIGDIR/$COMPONENT.conf $CONFIGDIR/$COMPONENT.d/migrate
* Resources defined in both, the new configuration directory scheme and the old configuration file must be removed from one of the places, best from the old configuration file, after verifying that the settings are identical with the new settings.


10 changes: 6 additions & 4 deletions core/cmake/BareosCheckFunctions.cmake
Expand Up @@ -30,12 +30,14 @@ check_function_exists(extattr_get_file HAVE_EXTATTR_GET_FILE)
check_function_exists(extattr_get_link HAVE_EXTATTR_GET_LINK)
check_function_exists(extattr_list_file HAVE_EXTATTR_LIST_FILE)
check_function_exists(extattr_list_link HAVE_EXTATTR_LIST_LINK)
check_function_exists(extattr_namespace_to_string
HAVE_EXTATTR_NAMESPACE_TO_STRING)
check_function_exists(
extattr_namespace_to_string HAVE_EXTATTR_NAMESPACE_TO_STRING
)
check_function_exists(extattr_set_file HAVE_EXTATTR_SET_FILE)
check_function_exists(extattr_set_link HAVE_EXTATTR_SET_LINK)
check_function_exists(extattr_string_to_namespace
HAVE_EXTATTR_STRING_TO_NAMESPACE)
check_function_exists(
extattr_string_to_namespace HAVE_EXTATTR_STRING_TO_NAMESPACE
)
check_function_exists(fchownat HAVE_FCHOWNAT)
check_function_exists(fdatasync HAVE_FDATASYNC)
check_function_exists(fseeko HAVE_FSEEKO)
Expand Down

0 comments on commit 9c59c64

Please sign in to comment.