commit pps-tools for openSUSE:Factory
Hello community, here is the log from the commit of package pps-tools for openSUSE:Factory checked in at 2018-12-27 00:24:12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pps-tools (Old) and /work/SRC/openSUSE:Factory/.pps-tools.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "pps-tools" Thu Dec 27 00:24:12 2018 rev:3 rq:658016 version:0.0.0+git.20181203 Changes: -------- --- /work/SRC/openSUSE:Factory/pps-tools/pps-tools.changes 2016-08-12 15:36:12.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.pps-tools.new.28833/pps-tools.changes 2018-12-27 00:24:13.839916138 +0100 @@ -1,0 +2,15 @@ +Fri Dec 14 10:58:06 UTC 2018 - Martin Pluskal <mpluskal@suse.com> + +- Update to version 0.0.0+git.20181203: + * Makefile: fix installation to empty DESTDIR + * ppsfind: Use /bin/sh, fix possible issues. + * ppswatch: Fix quitting after signal + * Fix linking under -Wl,--as-needed + * Add ppsldisc from LKML patch by Rodolfo Giometti. + * Makefile: Cleanup CFLAGS: remove -I. add -fPIC. + * Removes OFFSETASSERT requirement from ppstest and ppsctl. + * ppsfind: Add licence to the file header. + * Remove debian directory. + * ppswatch: Add useful stats output. + +------------------------------------------------------------------- Old: ---- pps-tools-0.0.0+git.20120407.tar.xz New: ---- pps-tools-0.0.0+git.20181203.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pps-tools.spec ++++++ --- /var/tmp/diff_new_pack.CVAQpV/_old 2018-12-27 00:24:14.235915815 +0100 +++ /var/tmp/diff_new_pack.CVAQpV/_new 2018-12-27 00:24:14.235915815 +0100 @@ -1,7 +1,7 @@ # # spec file for package pps-tools # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,22 +12,20 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # -%define version_unconverted 0.0.0+git.20120407 - +%define version_unconverted 0.0.0+git.20181203 Name: pps-tools -Version: 0.0.0+git.20120407 +Version: 0.0.0+git.20181203 Release: 0 Summary: Userspace tools for the Linux Pulse Per Second subsystem -License: GPL-2.0+ +License: GPL-2.0-or-later Group: Hardware/Other -Url: http://linuxpps.org +URL: http://linuxpps.org Source: %{name}-%{version}.tar.xz BuildRequires: xz -BuildRoot: %{_tmppath}/%{name}-%{version}-build %description Userland tools to test Linux kernel PPS API. See Documentations/pps/pps.txt @@ -51,21 +49,18 @@ make %{?_smp_mflags} %install -install -D -m 0755 ppsctl %{buildroot}%{_bindir}/ppsctl -install -D -m 0755 ppsfind %{buildroot}%{_bindir}/ppsfind -install -D -m 0755 ppstest %{buildroot}%{_bindir}/ppstest -install -D -m 0644 timepps.h %{buildroot}%{_includedir}/sys/timepps.h +%make_install %files -%defattr(-,root,root) -%doc COPYING +%license COPYING %{_bindir}/ppsctl %{_bindir}/ppsfind +%{_bindir}/ppsldisc %{_bindir}/ppstest +%{_bindir}/ppswatch %files devel -%defattr(-,root,root) -%doc COPYING +%license COPYING %{_includedir}/sys/timepps.h %changelog ++++++ _service ++++++ --- /var/tmp/diff_new_pack.CVAQpV/_old 2018-12-27 00:24:14.251915802 +0100 +++ /var/tmp/diff_new_pack.CVAQpV/_new 2018-12-27 00:24:14.251915802 +0100 @@ -1,5 +1,5 @@ <services> - <service mode="localonly" name="tar_scm"> + <service mode="disabled" name="tar_scm"> <param name="url">https://github.com/ago/pps-tools.git</param> <param name="scm">git</param> <param name="exclude">.git</param> @@ -7,9 +7,9 @@ <param name="filename">pps-tools</param> <param name="versionformat">0.0.0+git.%cd</param> </service> - <service mode="localonly" name="recompress"> + <service mode="disabled" name="recompress"> <param name="file">*.tar</param> <param name="compression">xz</param> </service> - <service mode="localonly" name="set_version"/> + <service mode="disabled" name="set_version"/> </services> ++++++ pps-tools-0.0.0+git.20120407.tar.xz -> pps-tools-0.0.0+git.20181203.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pps-tools-0.0.0+git.20120407/Makefile new/pps-tools-0.0.0+git.20181203/Makefile --- old/pps-tools-0.0.0+git.20120407/Makefile 2016-05-05 16:15:29.000000000 +0200 +++ new/pps-tools-0.0.0+git.20181203/Makefile 2018-12-03 15:02:00.000000000 +0100 @@ -1,9 +1,9 @@ -TARGETS = ppstest ppsctl ppswatch +TARGETS = ppstest ppsctl ppswatch ppsldisc CFLAGS += -Wall -O2 -D_GNU_SOURCE -CFLAGS += -I . CFLAGS += -ggdb -CFLAGS += -D__N_PPS=18 +CFLAGS += -fPIC +LDLIBS += -lm # -- Actions section -- @@ -19,8 +19,8 @@ endif install : all - install -m 755 -t $(DESTDIR)/usr/bin ppsfind $(TARGETS) - install -m 644 -t $(DESTDIR)/usr/include/sys timepps.h + install -D -m 755 -t $(DESTDIR)/usr/bin ppsfind $(TARGETS) + install -D -m 644 -t $(DESTDIR)/usr/include/sys timepps.h uninstall : for f in $(TARGETS); do rm $(DESTDIR)/usr/bin/$$f; done diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pps-tools-0.0.0+git.20120407/debian/README new/pps-tools-0.0.0+git.20181203/debian/README --- old/pps-tools-0.0.0+git.20120407/debian/README 2016-05-05 16:15:29.000000000 +0200 +++ new/pps-tools-0.0.0+git.20181203/debian/README 1970-01-01 01:00:00.000000000 +0100 @@ -1,12 +0,0 @@ -The Debian Package pps-tools ----------------------------- - -This package includes the necessary headers for using LinuxPPS PPSAPI -kernel interface in user-space applications and several support tools: - * ppsfind: find pps device by name - * ppstest: test PPSAPI interface - * ppsldisc: setup correct RS232 line discipline - * ppswatch: continuously print PPS timestamps - * ppsctl: manage PPS device - - -- Alexander Gordeev <lasaine@lvk.cs.msu.su> Wed, 12 Aug 2009 14:41:21 +0400 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pps-tools-0.0.0+git.20120407/debian/changelog new/pps-tools-0.0.0+git.20181203/debian/changelog --- old/pps-tools-0.0.0+git.20120407/debian/changelog 2016-05-05 16:15:29.000000000 +0200 +++ new/pps-tools-0.0.0+git.20181203/debian/changelog 1970-01-01 01:00:00.000000000 +0100 @@ -1,5 +0,0 @@ -pps-tools (5.3.6-1) unstable; urgency=low - - * Initial release. - - -- Alexander Gordeev <lasaine@lvk.cs.msu.su> Tue, 13 Apr 2010 15:17:09 +0400 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pps-tools-0.0.0+git.20120407/debian/compat new/pps-tools-0.0.0+git.20181203/debian/compat --- old/pps-tools-0.0.0+git.20120407/debian/compat 2016-05-05 16:15:29.000000000 +0200 +++ new/pps-tools-0.0.0+git.20181203/debian/compat 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pps-tools-0.0.0+git.20120407/debian/control new/pps-tools-0.0.0+git.20181203/debian/control --- old/pps-tools-0.0.0+git.20120407/debian/control 2016-05-05 16:15:29.000000000 +0200 +++ new/pps-tools-0.0.0+git.20181203/debian/control 1970-01-01 01:00:00.000000000 +0100 @@ -1,19 +0,0 @@ -Source: pps-tools -Section: devel -Priority: extra -Maintainer: Alexander Gordeev <lasaine@lvk.cs.msu.su> -Build-Depends: debhelper (>= 5) -Standards-Version: 3.8.0 -Homepage: http://wiki.enneenne.com/index.php/LinuxPPS_support - -Package: pps-tools -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: LinuxPPS support tools and headers - This package includes the necessary headers for using LinuxPPS PPSAPI - kernel interface in user-space applications and several support tools: - * ppsfind: find pps device by name - * ppstest: test PPSAPI interface - * ppsldisc: setup correct RS232 line discipline - * ppswatch: continuously print PPS timestamps - * ppsctl: manage PPS device diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pps-tools-0.0.0+git.20120407/debian/copyright new/pps-tools-0.0.0+git.20181203/debian/copyright --- old/pps-tools-0.0.0+git.20120407/debian/copyright 2016-05-05 16:15:29.000000000 +0200 +++ new/pps-tools-0.0.0+git.20181203/debian/copyright 1970-01-01 01:00:00.000000000 +0100 @@ -1,26 +0,0 @@ -This is pps-tools, written and maintained by Alexander Gordeev <lasaine@lvk.cs.msu.su> -on Wed, 12 Aug 2009 14:41:21 +0400. - -The original source can always be found at: - ftp://ftp.debian.org/dists/unstable/main/source/ - -Copyright Holder: Rodolfo Giometti <giometti@linux.it> - -License: - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this package; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -On Debian systems, the complete text of the GNU General -Public License can be found in `/usr/share/common-licenses/GPL'. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pps-tools-0.0.0+git.20120407/debian/dirs new/pps-tools-0.0.0+git.20181203/debian/dirs --- old/pps-tools-0.0.0+git.20120407/debian/dirs 2016-05-05 16:15:29.000000000 +0200 +++ new/pps-tools-0.0.0+git.20181203/debian/dirs 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -/usr/bin diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pps-tools-0.0.0+git.20120407/debian/rules new/pps-tools-0.0.0+git.20181203/debian/rules --- old/pps-tools-0.0.0+git.20120407/debian/rules 2016-05-05 16:15:29.000000000 +0200 +++ new/pps-tools-0.0.0+git.20181203/debian/rules 1970-01-01 01:00:00.000000000 +0100 @@ -1,71 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - - - - -CFLAGS = -Wall -g - -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -else - CFLAGS += -O2 -endif - -configure: configure-stamp -configure-stamp: - dh_testdir - touch configure-stamp - - -build: build-stamp - -build-stamp: configure-stamp - dh_testdir - $(MAKE) - touch $@ - -clean: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - -$(MAKE) clean - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - $(MAKE) DESTDIR=$(CURDIR)/debian/pps-tools install - - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs - dh_installdocs - dh_installexamples -# dh_install - dh_installman - dh_link - dh_strip - dh_compress - dh_fixperms -# dh_makeshlibs - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pps-tools-0.0.0+git.20120407/ppsctl.c new/pps-tools-0.0.0+git.20181203/ppsctl.c --- old/pps-tools-0.0.0+git.20120407/ppsctl.c 2016-05-05 16:15:29.000000000 +0200 +++ new/pps-tools-0.0.0+git.20181203/ppsctl.c 2018-12-03 15:02:00.000000000 +0100 @@ -69,10 +69,6 @@ fprintf(stderr, "cannot CAPTUREASSERT\n"); return -1; } - if ((*avail_mode & PPS_OFFSETASSERT) == 0) { - fprintf(stderr, "cannot OFFSETASSERT\n"); - return -1; - } return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pps-tools-0.0.0+git.20120407/ppsfind new/pps-tools-0.0.0+git.20181203/ppsfind --- old/pps-tools-0.0.0+git.20120407/ppsfind 2016-05-05 16:15:29.000000000 +0200 +++ new/pps-tools-0.0.0+git.20181203/ppsfind 2018-12-03 15:02:00.000000000 +0100 @@ -1,17 +1,28 @@ #!/bin/sh +# ppsfind -- find pps device by name +# +# Copyright (C) 2005-2007 Rodolfo Giometti <giometti@linux.it> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. SYS="/sys/class/pps/" -if [ $# -lt 1 ] ; then +if [ $# -ne 1 ] ; then echo "usage: ppsfind <name>" >&2 exit 1 fi -for d in $(ls $SYS) ; do - if grep $1 $SYS/$d/name >& /dev/null || \ - grep $1 $SYS/$d/path >& /dev/null ; then - echo "$d: name=$(cat $SYS/$d/name) path=$(cat $SYS/$d/path)" - fi +for dev in $SYS/* ; do + grep -q "$1" "$dev/name" || grep -q "$1" "$dev/path" && \ + echo "$(basename "$dev"): name=$(cat $dev/name) path=$(cat $dev/path)" done exit 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pps-tools-0.0.0+git.20120407/ppsldisc.c new/pps-tools-0.0.0+git.20181203/ppsldisc.c --- old/pps-tools-0.0.0+git.20120407/ppsldisc.c 1970-01-01 01:00:00.000000000 +0100 +++ new/pps-tools-0.0.0+git.20181203/ppsldisc.c 2018-12-03 15:02:00.000000000 +0100 @@ -0,0 +1,60 @@ +/* + * ppsldics.c -- setup PPS line discipline for RS232 + * + * Copyright (C) 2005-2007 Rodolfo Giometti <giometti@linux.it> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + + +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> +#include <errno.h> +#include <sys/ioctl.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <string.h> +#include <linux/tty.h> + +void usage(char *name) +{ + fprintf(stderr, "usage: %s <ttyS>\n", name); + + exit(EXIT_FAILURE); +} + +int main(int argc, char *argv[]) +{ + int fd; + int ldisc = N_PPS; + int ret; + + if (argc < 2) + usage(argv[0]); + + fd = open(argv[1], O_RDWR); + if (fd < 0) { + perror("open"); + exit(EXIT_FAILURE); + } + + ret = ioctl(fd, TIOCSETD, &ldisc); + if (ret < 0) { + perror("ioctl(TIOCSETD)"); + exit(EXIT_FAILURE); + } + + pause(); + + return 0; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pps-tools-0.0.0+git.20120407/ppstest.c new/pps-tools-0.0.0+git.20181203/ppstest.c --- old/pps-tools-0.0.0+git.20120407/ppstest.c 2016-05-05 16:15:29.000000000 +0200 +++ new/pps-tools-0.0.0+git.20181203/ppstest.c 2018-12-03 15:02:00.000000000 +0100 @@ -23,6 +23,8 @@ #include "timepps.h" +static struct timespec offset_assert = {0, 0}; + int find_source(char *path, pps_handle_t *handle, int *avail_mode) { pps_params_t params; @@ -56,21 +58,19 @@ fprintf(stderr, "cannot CAPTUREASSERT\n"); return -1; } - if ((*avail_mode & PPS_OFFSETASSERT) == 0) { - fprintf(stderr, "cannot OFFSETASSERT\n"); - return -1; - } - /* Capture assert timestamps, and compensate for a 675 nsec - * propagation delay */ + /* Capture assert timestamps */ ret = time_pps_getparams(*handle, ¶ms); if (ret < 0) { fprintf(stderr, "cannot get parameters (%m)\n"); return -1; } - params.assert_offset.tv_sec = 0; - params.assert_offset.tv_nsec = 675; - params.mode |= PPS_CAPTUREASSERT | PPS_OFFSETASSERT; + params.mode |= PPS_CAPTUREASSERT; + /* Override any previous offset if possible */ + if ((*avail_mode & PPS_OFFSETASSERT) != 0) { + params.mode |= PPS_OFFSETASSERT; + params.assert_offset = offset_assert; + } ret = time_pps_setparams(*handle, ¶ms); if (ret < 0) { fprintf(stderr, "cannot set parameters (%m)\n"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pps-tools-0.0.0+git.20120407/ppswatch.c new/pps-tools-0.0.0+git.20181203/ppswatch.c --- old/pps-tools-0.0.0+git.20120407/ppswatch.c 2016-05-05 16:15:29.000000000 +0200 +++ new/pps-tools-0.0.0+git.20181203/ppswatch.c 2018-12-03 15:02:00.000000000 +0100 @@ -14,6 +14,7 @@ * GNU General Public License for more details. */ +#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -22,6 +23,7 @@ #include <sys/stat.h> #include <getopt.h> #include <signal.h> +#include <math.h> #include "timepps.h" @@ -35,6 +37,10 @@ static int overflows = 0; static int max_unsync = 0; static int max_divergence = 0; +static double mean = 0.0; +static double M2 = 0.0; + +static volatile bool quit = false; int find_source(char *path, pps_handle_t *handle, int *avail_mode) { @@ -99,6 +105,7 @@ pps_info_t infobuf; int ret; long div; + double delta, delta2; if (avail_mode & PPS_CANWAIT) /* waits for the next event */ ret = time_pps_fetch(handle, PPS_TSFMT_TSPEC, &infobuf, @@ -108,8 +115,8 @@ ret = time_pps_fetch(handle, PPS_TSFMT_TSPEC, &infobuf, &timeout); } - if (ret < 0) { - if (errno == EINTR) { + if (ret < 0 || quit) { + if (errno == EINTR || quit) { return -1; } @@ -132,6 +139,10 @@ total++; div = ts.tv_nsec; + delta = div - mean; + mean += delta / total; + delta2 = div - mean; + M2 += delta * delta2; if (div < 0) div = -div; if (max_divergence < div) @@ -230,10 +241,13 @@ printf("Maximum unsynchronized time: %d\n", max_unsync); } printf("Maximum divergence: %d\n", max_divergence); + printf("Mean value: %g\n", mean); + printf("Standard deviation: %g\n", sqrt(M2 / total)); } static void sighandler_exit(int signum) { print_stats(); + quit = true; } int main(int argc, char *argv[]) @@ -262,7 +276,7 @@ /* loop, printing the most recent timestamp every second or so */ while (1) { ret = fetch_source(handle, avail_mode); - if (ret < 0 && errno == EINTR) { + if ((ret < 0 && errno == EINTR) || quit) { ret = 0; break; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pps-tools-0.0.0+git.20120407/timepps.h new/pps-tools-0.0.0+git.20181203/timepps.h --- old/pps-tools-0.0.0+git.20120407/timepps.h 2016-05-05 16:15:29.000000000 +0200 +++ new/pps-tools-0.0.0+git.20181203/timepps.h 2018-12-03 15:02:00.000000000 +0100 @@ -19,6 +19,7 @@ #define _SYS_TIMEPPS_H_ #include <errno.h> +#include <unistd.h> #include <sys/time.h> #include <sys/ioctl.h> #include <linux/types.h>
participants (1)
-
root