Hello community, here is the log from the commit of package brickd for openSUSE:Factory checked in at 2020-01-07 23:52:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/brickd (Old) and /work/SRC/openSUSE:Factory/.brickd.new.6675 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "brickd" Tue Jan 7 23:52:45 2020 rev:2 rq:761279 version:2.4.1 Changes: -------- --- /work/SRC/openSUSE:Factory/brickd/brickd.changes 2019-10-21 12:27:57.263930341 +0200 +++ /work/SRC/openSUSE:Factory/.brickd.new.6675/brickd.changes 2020-01-07 23:53:11.616026332 +0100 @@ -1,0 +2,15 @@ +Sun Jan 5 10:26:41 UTC 2020 - Frank Kunz <mailingli...@kunz-im-inter.net> + +- Update to new upstream version 2.4.1: +- Rename bundled libusb to avoid potential collision with system libusb on macOS +- Add missing network dependency to systemd service on Linux +- Make sleep time between SPI reads for HAT (Zero) Brick configurable +- Add experimental support for HAT (Zero) Brick (SPI connected Bricklets) on + Windows 10 IoT Core, disabled by default due to missing HAT detection +- Notarize Brick Daemon app to make it ready for macOS 10.15 +- remove integrated upstream patches + 0001-Makefile-Support-DESTDIR-variable.patch + 0001-use-RPM_OPT_FLAGS-in-rpm-package-builds.patch + 0001-systemd-unit-files-are-always-in-prefix-lib-systemd.patch + +------------------------------------------------------------------- Old: ---- 0001-Makefile-Support-DESTDIR-variable.patch 0001-systemd-unit-files-are-always-in-prefix-lib-systemd.patch 0001-use-RPM_OPT_FLAGS-in-rpm-package-builds.patch brickd-2.4.0.tar.gz v2.4.0.tar.gz New: ---- brickd-2.4.1.tar.gz v2.4.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ brickd.spec ++++++ --- /var/tmp/diff_new_pack.qHu3ba/_old 2020-01-07 23:53:12.828026961 +0100 +++ /var/tmp/diff_new_pack.qHu3ba/_new 2020-01-07 23:53:12.828026961 +0100 @@ -1,6 +1,7 @@ # # spec file for package brickd # +# Copyright (c) 2020 SUSE LLC # Copyright (c) 2019 Frank Kunz # # All modifications and additions to the file contributed by third parties @@ -12,21 +13,19 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + Name: brickd -Version: 2.4.0 +Version: 2.4.1 Release: 0 Summary: Tinkerforce Brick Daemon License: GPL-2.0-only Group: System/Daemons -Url: http://www.tinkerforge.com -Source0: https://github.com/Tinkerforge/brickd/archive/v2.4.0.tar.gz -Source1: https://github.com/Tinkerforge/daemonlib/archive/brickd-2.4.0.tar.gz -# backport from upstream -Patch0: 0001-Makefile-Support-DESTDIR-variable.patch -# PATCH-FIX-OPENSUSE -Patch1: 0001-use-RPM_OPT_FLAGS-in-rpm-package-builds.patch -Patch2: 0001-systemd-unit-files-are-always-in-prefix-lib-systemd.patch +URL: http://www.tinkerforge.com +Source0: https://github.com/Tinkerforge/brickd/archive/v%{version}.tar.gz +Source1: https://github.com/Tinkerforge/daemonlib/archive/brickd-%{version}.tar.gz BuildRequires: pkgconfig(libusb) BuildRequires: pkgconfig(systemd) Suggests: logrotate @@ -38,9 +37,6 @@ %prep %setup -q -a 1 -n %{name}-%{version} -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 mv daemonlib-%{name}-%{version} src/daemonlib %build ++++++ brickd-2.4.0.tar.gz -> brickd-2.4.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/daemonlib-brickd-2.4.0/packet.c new/daemonlib-brickd-2.4.1/packet.c --- old/daemonlib-brickd-2.4.0/packet.c 2019-07-02 13:44:58.000000000 +0200 +++ new/daemonlib-brickd-2.4.1/packet.c 2019-12-11 15:17:08.000000000 +0100 @@ -311,7 +311,7 @@ int i; trace->trace_id = packet->trace_id; - trace->timestamp = microseconds(); + trace->timestamp = microtime(); trace->header = packet->header; trace->filename = filename; trace->line = line; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/daemonlib-brickd-2.4.0/ringbuffer.c new/daemonlib-brickd-2.4.1/ringbuffer.c --- old/daemonlib-brickd-2.4.0/ringbuffer.c 2019-07-02 13:44:58.000000000 +0200 +++ new/daemonlib-brickd-2.4.1/ringbuffer.c 2019-12-11 15:17:08.000000000 +0100 @@ -1,7 +1,7 @@ /* * daemonlib * Copyright (C) 2018 Olaf Lüke <o...@tinkerforge.com> - * Copyright (C) 2018 Matthias Bolte <matth...@tinkerforge.com> + * Copyright (C) 2018-2019 Matthias Bolte <matth...@tinkerforge.com> * * ringbuffer.c: Simple uint8 ringbuffer implementation * @@ -114,7 +114,8 @@ end += rb->size; } - printf("Ringbuffer (start %d, end %d, size %d, low %d, overflows %d): [\n\r", rb->start, rb->end, rb->size, rb->low_watermark, rb->overflows); + printf("Ringbuffer (start %u, end %u, size %u, low %u, overflows %u): [\n", + rb->start, rb->end, rb->size, rb->low_watermark, rb->overflows); for(i = 0; i < end; i++) { if((i % 16) == 0) { @@ -124,9 +125,9 @@ printf("%x, ", rb->buffer[(rb->start + i) % rb->size]); if((i % 16) == 15) { - printf("\n\r"); + printf("\n"); } } - printf("]\n\r"); + printf("]\n"); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/daemonlib-brickd-2.4.0/timer_uwp.c new/daemonlib-brickd-2.4.1/timer_uwp.c --- old/daemonlib-brickd-2.4.0/timer_uwp.c 2019-07-02 13:44:58.000000000 +0200 +++ new/daemonlib-brickd-2.4.1/timer_uwp.c 2019-12-11 15:17:08.000000000 +0100 @@ -1,6 +1,6 @@ /* * daemonlib - * Copyright (C) 2016-2018 Matthias Bolte <matth...@tinkerforge.com> + * Copyright (C) 2016-2019 Matthias Bolte <matth...@tinkerforge.com> * * timer_uwp.c: Universal Windows Platform timer implementation * @@ -56,8 +56,8 @@ Timer *timer = opaque; int rc; uint32_t configuration_id = timer->configuration_id; - uint64_t delay = 0; // in milliseconds - uint64_t interval = 0; // in milliseconds + DWORD delay = 0; // in milliseconds + DWORD interval = 0; // in milliseconds DWORD timeout = INFINITE; // in milliseconds while (timer->running) { @@ -96,7 +96,7 @@ } else if (timer->delay < 1000) { delay = 1; } else { - delay = (timer->delay + 500) / 1000; + delay = (DWORD)((timer->delay + 500) / 1000); } if (timer->interval == 0) { @@ -104,7 +104,7 @@ } else if (timer->interval < 1000) { interval = 1; } else { - interval = (timer->interval + 500) / 1000; + interval = (DWORD)((timer->interval + 500) / 1000); } timeout = delay; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/daemonlib-brickd-2.4.0/utils.c new/daemonlib-brickd-2.4.1/utils.c --- old/daemonlib-brickd-2.4.0/utils.c 2019-07-02 13:44:58.000000000 +0200 +++ new/daemonlib-brickd-2.4.1/utils.c 2019-12-11 15:17:08.000000000 +0100 @@ -40,6 +40,10 @@ #ifdef __ANDROID__ #include <arpa/inet.h> #endif +#ifdef __APPLE__ + #include <mach/mach_time.h> + #include <sys/select.h> +#endif #include "utils.h" @@ -473,22 +477,54 @@ ((uint32_t)bytes[0] << 0); } -void millisleep(uint32_t milliseconds) { -#ifdef _WIN32 - Sleep(milliseconds); -#else - // FIXME: (u)sleep can be interrupted, might have to deal with that - if (milliseconds >= 1000) { - sleep(milliseconds / 1000); +void microsleep(uint32_t duration) { +#ifdef __linux__ + struct timespec ts; + struct timespec tsr; + + ts.tv_sec = duration / 1000000; + ts.tv_nsec = (duration % 1000000) * 1000; - milliseconds %= 1000; + while (clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, &tsr) < 0 && errno == EINTR) { + memcpy(&ts, &tsr, sizeof(ts)); + } +#elif defined _WIN32 + uint64_t end; + + // there is no real sleep function with microsecond resolution on Windows. + // at least on the Windows 10 laptop this was tested on the Sleep function + // has an average jitter of about +5ms. this is no good for short sleep + // durations. therefore, busy wait for sleep durations of 10ms and below. + // this is wasteful but provides reasonable microsecond sleep resolution. + if (duration > 10000) { + Sleep(duration / 1000); + } else if (duration > 0) { + end = microtime() + duration; + + while (end > microtime()) { + Sleep(0); + } + } else { + Sleep(0); } +#else // POSIX + struct timespec ts; + struct timespec tsr; + + ts.tv_sec = duration / 1000000; + ts.tv_nsec = (duration % 1000000) * 1000; - usleep(milliseconds * 1000); + while (nanosleep(&ts, &tsr) < 0 && errno == EINTR) { + memcpy(&ts, &tsr, sizeof(ts)); + } #endif } -uint64_t microseconds(void) { +void millisleep(uint32_t duration) { + microsleep(duration * 1000); +} + +uint64_t microtime(void) { // monotonic #ifdef __linux__ struct timespec ts; @@ -497,22 +533,49 @@ #else if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0) { #endif - return 0; - } else { - return ts.tv_sec * 1000000 + ts.tv_nsec / 1000; + abort(); // clock_gettime cannot fail under normal circumstances } -#else - struct timeval tv; - // FIXME: use a monotonic source such as QueryPerformanceCounter() or mach_absolute_time() - if (gettimeofday(&tv, NULL) < 0) { - return 0; - } else { - return tv.tv_sec * 1000000 + tv.tv_usec; + return ts.tv_sec * 1000000 + ts.tv_nsec / 1000; +#elif defined _WIN32 + // https://docs.microsoft.com/de-de/windows/win32/sysinfo/acquiring-high-resolution-time-stamps + static bool initialized = false; + static LARGE_INTEGER frequency; + LARGE_INTEGER counter; + + if (!initialized) { + initialized = true; + + QueryPerformanceFrequency(&frequency); // cannot fail since Windows XP, stable across cores + } + + QueryPerformanceCounter(&counter); // cannot fail since Windows XP + + return (uint64_t)counter.QuadPart * 1000000 / frequency.QuadPart; +#elif defined __APPLE__ + // https://developer.apple.com/library/archive/qa/qa1398/_index.html + static mach_timebase_info_data_t mtibd; + + if (mtibd.denom == 0) { + mach_timebase_info(&mtibd); } + + return (mach_absolute_time() / 1000) * mtibd.numer / mtibd.denom; +#else // POSIX + struct timespec ts; + + if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0) { + abort(); // clock_gettime cannot fail under normal circumstances + } + + return ts.tv_sec * 1000000 + ts.tv_nsec / 1000; #endif } +uint64_t millitime(void) { // monotonic + return microtime() / 1000; +} + #if !defined _GNU_SOURCE && !defined __APPLE__ && !__ANDROID__ #include <ctype.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/daemonlib-brickd-2.4.0/utils.h new/daemonlib-brickd-2.4.1/utils.h --- old/daemonlib-brickd-2.4.0/utils.h 2019-07-02 13:44:58.000000000 +0200 +++ new/daemonlib-brickd-2.4.1/utils.h 2019-12-11 15:17:08.000000000 +0100 @@ -1,6 +1,6 @@ /* * daemonlib - * Copyright (C) 2012-2015, 2017-2018 Matthias Bolte <matth...@tinkerforge.com> + * Copyright (C) 2012-2015, 2017-2019 Matthias Bolte <matth...@tinkerforge.com> * Copyright (C) 2014 Olaf Lüke <o...@tinkerforge.com> * * utils.h: Utility functions @@ -52,9 +52,11 @@ uint32_t uint32_from_le(uint32_t value); -void millisleep(uint32_t milliseconds); +void microsleep(uint32_t duration); +void millisleep(uint32_t duration); -uint64_t microseconds(void); +uint64_t microtime(void); +uint64_t millitime(void); #if !defined _GNU_SOURCE && !defined __APPLE__ && !defined __ANDROID__ char *strcasestr(char *haystack, char *needle); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/daemonlib-brickd-2.4.0/writer.c new/daemonlib-brickd-2.4.1/writer.c --- old/daemonlib-brickd-2.4.0/writer.c 2019-07-02 13:44:58.000000000 +0200 +++ new/daemonlib-brickd-2.4.1/writer.c 2019-12-11 15:17:08.000000000 +0100 @@ -95,14 +95,14 @@ char packet_signature[PACKET_MAX_SIGNATURE_LENGTH]; uint32_t packets_to_drop; - log_packet_debug("%s is not ready to receive, pushing %s to write backlog (count: %d +1)", + log_packet_debug("%s is not ready to receive, pushing %s to write backlog (count: %d + 1)", writer->recipient_signature(recipient_signature, true, writer->opaque), writer->packet_type, writer->backlog.count); if (writer->backlog.count >= MAX_QUEUED_WRITES) { packets_to_drop = writer->backlog.count - MAX_QUEUED_WRITES + 1; - log_warn("Write backlog for %s is full, dropping %u queued %s(s), %u +%u dropped in total", + log_warn("Write backlog for %s is full, dropping %u queued %s(s), %u + %u dropped in total", writer->recipient_signature(recipient_signature, false, writer->opaque), packets_to_drop, writer->packet_type, writer->dropped_packets, packets_to_drop); ++++++ v2.4.0.tar.gz -> v2.4.1.tar.gz ++++++ /work/SRC/openSUSE:Factory/brickd/v2.4.0.tar.gz /work/SRC/openSUSE:Factory/.brickd.new.6675/v2.4.1.tar.gz differ: char 12, line 1