Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Some more lintian fixes (#1242)
Browse files Browse the repository at this point in the history
Some more lintian fixes
  • Loading branch information
lbonn authored Jun 25, 2019
2 parents c9826b1 + 7a43daa commit b706c2f
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 50 deletions.
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,10 @@ endif(BUILD_SOTA_TOOLS)

set(CPACK_DEBIAN_AKTUALIZR_PACKAGE_NAME "aktualizr")
set(CPACK_DEBIAN_AKTUALIZR_FILE_NAME "aktualizr.deb") # only available for CMake >= 3.6.0
set(CPACK_COMPONENT_AKTUALIZR_DESCRIPTION "UPTANE-compliant embedded software update client")
set(CPACK_COMPONENT_AKTUALIZR_DESCRIPTION "UPTANE-compliant embedded software update client\n Aktualizr communicates with OTA-Connect,\n reports device information, fetch and install package updates")
set(CPACK_DEBIAN_AKTUALIZR_PACKAGE_DEPENDS "lshw")
set(CPACK_DEBIAN_AKTUALIZR_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_AKTUALIZR_PACKAGE_CONTROL_EXTRA "${PROJECT_SOURCE_DIR}/config/systemd/debian-control/preinst;${PROJECT_SOURCE_DIR}/config/systemd/debian-control/postinst;${PROJECT_SOURCE_DIR}/config/systemd/debian-control/prerm;")
set(CPACK_DEBIAN_AKTUALIZR_PACKAGE_CONTROL_EXTRA "${PROJECT_SOURCE_DIR}/config/systemd/debian-control/postinst;${PROJECT_SOURCE_DIR}/config/systemd/debian-control/prerm;${PROJECT_SOURCE_DIR}/config/systemd/debian-control/postrm;")
include(CPack)
include(CPackComponent)

Expand Down Expand Up @@ -395,7 +395,6 @@ if(BUILD_WITH_CODE_COVERAGE)
set(COVERAGE_LCOV_EXCLUDES '/usr/include/*' ${CMAKE_BINARY_DIR}'*' ${CMAKE_SOURCE_DIR}'/third_party/*' ${CMAKE_SOURCE_DIR}'/tests/*' '*_test.cc')
include(CodeCoverage)
set(COVERAGE_COMPILER_FLAGS "--coverage -fprofile-arcs -ftest-coverage" CACHE INTERNAL "")
list(APPEND TEST_LIBS gcov)
endif(BUILD_WITH_CODE_COVERAGE)

include(CTest)
Expand Down
18 changes: 3 additions & 15 deletions config/systemd/debian-control/postinst
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
#!/bin/bash

shell_pid=$(ps -o ppid= -p $PPID)
shell_pid=${shell_pid#" "}

initiator_pid="$(ps -o ppid= -p $shell_pid)"
initiator_pid=${initiator_pid#" "}

initiator_cmdline="$(tr -d '\0' </proc/$initiator_pid/cmdline)"

# Start aktualizr only if we install this package not from itself.
if [[ "$initiator_cmdline" != /usr/bin/aktualizr* ]]; then
systemctl enable aktualizr || true
systemctl start aktualizr || true
else
touch "/tmp/aktualizr_reboot_flag"
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
deb-systemd-helper unmask 'aktualizr.service' >/dev/null || true
deb-systemd-helper update-state 'aktualizr.service' >/dev/null || true
fi


20 changes: 20 additions & 0 deletions config/systemd/debian-control/postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

set -e

if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload > /dev/null || true
fi

if [ "$1" = "remove" ]; then
if [ -x "/usr/bin/deb-systemd-helper" ]; then
deb-systemd-helper mask 'aktualizr.service' >/dev/null || true
fi
fi

if [ "$1" = "purge" ]; then
if [ -x "/usr/bin/deb-systemd-helper" ]; then
deb-systemd-helper purge 'aktualizr.service' >/dev/null || true
deb-systemd-helper unmask 'aktualizr.service' >/dev/null || true
fi
fi
14 changes: 0 additions & 14 deletions config/systemd/debian-control/preinst

This file was deleted.

17 changes: 5 additions & 12 deletions config/systemd/debian-control/prerm
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
#!/bin/bash

shell_pid=$(ps -o ppid= -p $PPID)
shell_pid=${shell_pid#" "}
set -e

initiator_pid="$(ps -o ppid= -p $shell_pid)"
initiator_pid=${initiator_pid#" "}

initiator_cmdline="$(tr -d '\0' </proc/$initiator_pid/cmdline)"

# Stop aktualizr only if we install this package not from itself.
if [[ "$initiator_cmdline" != /usr/bin/aktualizr* ]]; then
systemctl stop aktualizr || true
systemctl disable aktualizr || true
if [ "$1" = "remove" ]; then
if [ -x "/usr/bin/deb-systemd-helper" ]; then
deb-systemd-helper stop 'aktualizr.service' >/dev/null || true
fi
fi

7 changes: 1 addition & 6 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ add_subdirectory(uptane_repo_generation)

include_directories("${PROJECT_SOURCE_DIR}/src/libaktualizr/third_party/jsoncpp")

# use the same libraries as the normal target but add our test utility library, gtest, gmock and gcov
set(TEST_LIBS
${AKTUALIZR_EXTERNAL_LIBS}
testutilities
gtest gmock)

add_dependencies(build_tests aktualizr)
if(BUILD_SOTA_TOOLS)
add_dependencies(build_tests garage-push)
Expand Down Expand Up @@ -59,6 +53,7 @@ set(TEST_SOURCES httpfake.h test_utils.cc test_utils.h uptane_vector_tests.cc)
include(CMakeParseArguments)

add_library(testutilities test_utils.cc)
list(APPEND TEST_LIBS testutilities)

add_library(ostree_mock SHARED ostree_mock.c)
aktualizr_source_file_checks(ostree_mock.c)
Expand Down

0 comments on commit b706c2f

Please sign in to comment.