Skip to content

Commit cbb96ce

Browse files
author
Martin Kruliš
authored
Fixing bugs and build scripts.
1 parent 4cedbbb commit cbb96ce

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

.travis.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
sudo: required
2-
dist: xenial
2+
dist: focal
33
language: cpp
44

55
before_install:
66
# Install bats testing suite
7-
- sudo add-apt-repository ppa:duggan/bats --yes
8-
- sudo apt-get update -qq
9-
- sudo apt-get install -qq bats
7+
- sudo apt-get install -y bats
108
# Install ZeroMQ
119
- sudo apt-get install -y libzmq3-dev libzmq5
1210
# Install Boost
1311
- sudo apt-get install -y libboost-all-dev
1412
# Install yaml-cpp
15-
- sudo apt-get install -y libyaml-cpp0.5v5 libyaml-cpp-dev
13+
- sudo apt-get install -y libyaml-cpp-dev
1614
# Install libcURL
1715
- sudo apt-get install -y libcurl4-gnutls-dev
1816
# Install libarchive (to avoid compiling it)

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,6 @@ if(UNIX)
301301
set(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64")
302302
set(CPACK_RPM_PACKAGE_RELEASE "1")
303303
set(CPACK_RPM_PACKAGE_DESCRIPTION "Backend part of ReCodEx programmer testing solution.")
304-
#set(CPACK_RPM_PACKAGE_REQUIRES "boost-filesystem >= 1.53.0, boost-program-options >= 1.53.0, yaml-cpp >= 0.5.1, zeromq >= 4.0.5, libstdc++ >= 4.8.5, libcurl >= 7.29.0, libarchive >= 3.1.2")
305-
#set(CPACK_RPM_PACKAGE_AUTOREQ " no")
306304
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/install/postinst")
307305
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Petr Stefan <[email protected]>")
308306
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Worker specific requirements are written in this section. It covers only basic
4242
requirements, additional runtimes or tools may be needed depending on type of
4343
use. The package names are for CentOS if not specified otherwise.
4444

45+
- Boost 1.66 development libs (`boost-devel` package)
4546
- ZeroMQ in version at least 4.0, packages `zeromq` and `zeromq-devel`
4647
(`libzmq3-dev` on Debian)
4748
- YAML-CPP library, `yaml-cpp` and `yaml-cpp-devel` (`libyaml-cpp0.5v5` and

judges/recodex_token_judge/comparator.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,10 @@ template <typename CHAR = char, typename OFFSET = std::uint32_t, typename RESULT
274274
*/
275275
template <typename T> static void mapRemoveEmpty(std::map<T, int> &m)
276276
{
277-
for (auto it = m.begin(); it != m.end(); ++it) {
278-
if (it->second == 0) { m.erase(it); }
277+
std::map<T, int> old;
278+
old.swap(m);
279+
for (auto it = old.begin(); it != old.end(); ++it) {
280+
if (it->second != 0) { m[it->first] = it->second; }
279281
}
280282
}
281283

recodex-worker.spec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
%define name recodex-worker
22
%define short_name worker
33
%define version 1.6.4
4-
%define unmangled_version 0c3af00f74b5f088e68a7f1b79e130bef0105646
5-
%define release 1
4+
%define unmangled_version 597144f5dc757fc18446f3fc4a58f064f3ac4ba6
5+
%define release 4
66

77
%define spdlog_name spdlog
88
%define spdlog_version 0.13.0
@@ -17,7 +17,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
1717
Prefix: %{_prefix}
1818
Vendor: Petr Stefan <UNKNOWN>
1919
Url: https://github.com/ReCodEx/worker
20-
BuildRequires: systemd gcc-c++ cmake zeromq-devel cppzmq-devel yaml-cpp-devel libcurl-devel libarchive-devel
20+
BuildRequires: systemd gcc-c++ cmake zeromq-devel cppzmq-devel yaml-cpp-devel libcurl-devel libarchive-devel boost-devel
2121
Requires: systemd isolate
2222

2323
#Source0: %{name}-%{unmangled_version}.tar.gz
@@ -27,7 +27,7 @@ Source1: https://github.com/gabime/%{spdlog_name}/archive/v%{spdlog_version}.tar
2727
%global debug_package %{nil}
2828

2929
%description
30-
Backend part of ReCodEx programmer testing solution.
30+
Worker is a backend component of ReCodEx code examiner, an educational application for evaluating programming assignments.
3131

3232
%prep
3333
%setup -n %{short_name}-%{unmangled_version}

0 commit comments

Comments
 (0)