diff -Nru ttylog-0.30/ChangeLog ttylog-0.31/ChangeLog --- ttylog-0.30/ChangeLog 2017-12-23 03:35:00.000000000 +0000 +++ ttylog-0.31/ChangeLog 2018-01-15 01:47:14.000000000 +0000 @@ -1,8 +1,30 @@ + +2018-1-14 Robert James Clay 0.31 + + * README.md: Use single quotes around 'kill -HUP nnnn' example. + * README.md, ttylog.c: Add missing '[-s|--stamp]' entry for the Usage line. + * COPYRIGHT, ttylog.c: Add copyright information for Guy Shapiro. + * CMakeLists.txt: Change the minimum required version of CMake to '2.8'. + * CMakeLists.txt: Add settings for two very basic tests to CMakeLists.txt. + * CMakeLists.txt: Move CPack settings to the end of the CMakeLists.txt file. + * ttylog.c: Update copyright information for the 'version' option. + + +2018-1-14 Guy Shapiro + + * ttylog.c: Make the timestamp function optional instead of default. + + 2017-12-22 Robert James Clay 0.30 * COPYRIGHT, ttylog.c: Add copyright information for Donald Gordon. +2017-12-21 Guy Shapiro + + * ttylog.c: exit on unreadable file descriptor + + 2016-9-21 Donald Gordon * ttylog.c: Added a timestamp option for output lines. diff -Nru ttylog-0.30/CMakeLists.txt ttylog-0.31/CMakeLists.txt --- ttylog-0.30/CMakeLists.txt 2017-12-23 03:35:00.000000000 +0000 +++ ttylog-0.31/CMakeLists.txt 2018-01-15 01:47:14.000000000 +0000 @@ -1,9 +1,9 @@ # ########## Project setup ########## PROJECT(ttylog) -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) SET(TTYLOG_VERSION_MAJOR "0") -SET(TTYLOG_VERSION_MINOR "30") +SET(TTYLOG_VERSION_MINOR "31") SET(TTYLOG_VERSION_PATCH "0") SET(TTYLOG_VERSION ${TTYLOG_VERSION_MAJOR}.${TTYLOG_VERSION_MINOR}.${TTYLOG_VERSION_PATCH}) @@ -31,16 +31,6 @@ SET(ttylog_executable_HDRS ) -# ######### Package creation ######### -SET(CPACK_PACKAGE_VERSION_MAJOR "${TTYLOG_VERSION_MAJOR}") -SET(CPACK_PACKAGE_VERSION_MINOR "${TTYLOG_VERSION_MINOR}") -SET(CPACK_PACKAGE_VERSION_PATCH "${TTYLOG_VERSION_PATCH}") -SET(CPACK_PACKAGE_VERSION "${TTYLOG_VERSION}") -SET(CPACK_SOURCE_GENERATOR "TBZ2") -SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}") -SET(CPACK_SOURCE_IGNORE_FILES "/build/;/.git/;/.svn/;") -INCLUDE(CPack) - # actual target: ADD_EXECUTABLE(ttylog ${ttylog_executable_SRCS}) @@ -53,3 +43,20 @@ INSTALL(TARGETS ttylog DESTINATION sbin) # add install man page: INSTALL(FILES ttylog.8 DESTINATION share/man/man8) + +# ######### Test Settings ######### +include(CTest) +add_test (ttylogRuns ttylog) +set_tests_properties (ttylogRuns PROPERTIES PASS_REGULAR_EXPRESSION "no params.") +add_test (ttylogHelp ttylog -h) +set_tests_properties (ttylogHelp PROPERTIES PASS_REGULAR_EXPRESSION "Usage:") + +# ######### Package creation ######### +SET(CPACK_PACKAGE_VERSION_MAJOR "${TTYLOG_VERSION_MAJOR}") +SET(CPACK_PACKAGE_VERSION_MINOR "${TTYLOG_VERSION_MINOR}") +SET(CPACK_PACKAGE_VERSION_PATCH "${TTYLOG_VERSION_PATCH}") +SET(CPACK_PACKAGE_VERSION "${TTYLOG_VERSION}") +SET(CPACK_SOURCE_GENERATOR "TBZ2") +SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}") +SET(CPACK_SOURCE_IGNORE_FILES "/build/;/.git/;/.svn/;") +INCLUDE(CPack) diff -Nru ttylog-0.30/COPYRIGHT ttylog-0.31/COPYRIGHT --- ttylog-0.30/COPYRIGHT 2017-12-23 03:35:00.000000000 +0000 +++ ttylog-0.31/COPYRIGHT 2018-01-15 01:47:14.000000000 +0000 @@ -1,7 +1,8 @@ ttylog - TTY logger Copyright (C) 1999-2002 Tibor Koleszar - Copyright (C) 2008-2017 Robert James Clay + Copyright (C) 2008-2018 Robert James Clay + Copyright (C) 2017-2018 Guy Shapiro Copyright (C) 2016 Donald Gordon Copyright (C) 2016 Alexander (MrMontag) Fust Copyright (C) 2016 Logan Rosen diff -Nru ttylog-0.30/debian/changelog ttylog-0.31/debian/changelog --- ttylog-0.30/debian/changelog 2017-12-25 01:26:13.000000000 +0000 +++ ttylog-0.31/debian/changelog 2018-01-15 22:48:43.000000000 +0000 @@ -1,3 +1,17 @@ +ttylog (0.31-1) unstable; urgency=medium + + * New upstream release. + * Declare compliance with Debian Policy 4.1.3. + * Add a 'debian/upstream/signing-key.asc' file. + * Add a 'get-orig-source' target to the debian/rules file. + * Set version to '4' and add 'pgpsigurlmangle' in debian/watch. + * Changes to debian/copyright: + - Update the copyright years for 'Robert James Clay'. + - Add the copyright information for 'Guy Shapiro' and 'Donald Gordon' to + the 'files:*' stanza. + + -- Robert James Clay Mon, 15 Jan 2018 17:48:43 -0500 + ttylog (0.30-1) unstable; urgency=medium * New upstream release. diff -Nru ttylog-0.30/debian/control ttylog-0.31/debian/control --- ttylog-0.30/debian/control 2017-12-25 01:26:13.000000000 +0000 +++ ttylog-0.31/debian/control 2018-01-15 22:48:43.000000000 +0000 @@ -3,7 +3,7 @@ Priority: optional Maintainer: Robert James Clay Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.16.1~), cmake -Standards-Version: 4.1.2 +Standards-Version: 4.1.3 Vcs-Git: https://git.code.sf.net/p/ttylog/code -b debian Vcs-Browser: https://sourceforge.net/p/ttylog/code/ Homepage: http://ttylog.sourceforge.net diff -Nru ttylog-0.30/debian/copyright ttylog-0.31/debian/copyright --- ttylog-0.30/debian/copyright 2017-12-25 01:26:13.000000000 +0000 +++ ttylog-0.31/debian/copyright 2018-01-15 22:48:43.000000000 +0000 @@ -5,7 +5,9 @@ Files: * Copyright: 1999-2002, Tibor Koleszar - 2008-2016, Robert James Clay + 2008-2018, Robert James Clay + 2017-2018, Guy Shapiro + 2016, Donald Gordon 2016, Logan Rosen 2016, Alexander (MrMontag) Fust License: GPL-2+ @@ -14,7 +16,7 @@ Comment: Copyright and License for the debian directory files. Copyright: 1999-2002, Tibor Koleszar 2006, Andrew Pollock - 2008-2016, Robert James Clay + 2008-2018, Robert James Clay License: GPL-2+ License: GPL-2+ diff -Nru ttylog-0.30/debian/rules ttylog-0.31/debian/rules --- ttylog-0.30/debian/rules 2017-12-25 01:26:13.000000000 +0000 +++ ttylog-0.31/debian/rules 2018-01-15 22:48:43.000000000 +0000 @@ -19,4 +19,7 @@ override_dh_strip: dh_strip --dbgsym-migration='ttylog-dbg (<< 0.28-1~)' -.PHONY: override_dh_strip \ No newline at end of file +get-orig-source: + uscan --force-download --rename --destdir .. + +.PHONY: get-orig-source override_dh_strip diff -Nru ttylog-0.30/debian/TODO ttylog-0.31/debian/TODO --- ttylog-0.30/debian/TODO 2017-12-25 01:26:13.000000000 +0000 +++ ttylog-0.31/debian/TODO 2018-01-15 22:48:43.000000000 +0000 @@ -1,11 +1,12 @@ ttylog debian/TODO ------------------------------------------------------------------------------- - -from build & lintian check in stretch -I: ttylog source: vcs-field-uses-insecure-uri vcs-git git://git.code.sf.net/p/ttylog/code -b debian - - However, apparently Sourceforge still does not support that - - See also ticket #356 "No anonymous https access to git repos" -https://sourceforge.net/p/forge/feature-requests/356/ + - Why is 'override_dh_strip' in the .PHONY target? I don't remember why I + did that... (I think I'm the one that added that; I'll have to check.) ------------------------------------------------------------------------------- + + - Full build & Lintian check under 'buster': +I: ttylog source: testsuite-autopkgtest-missing' + diff -Nru ttylog-0.30/debian/upstream/signing-key.asc ttylog-0.31/debian/upstream/signing-key.asc --- ttylog-0.30/debian/upstream/signing-key.asc 1970-01-01 00:00:00.000000000 +0000 +++ ttylog-0.31/debian/upstream/signing-key.asc 2018-01-15 22:48:43.000000000 +0000 @@ -0,0 +1,63 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBE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owEKiXkTFvgmGYIZoQLw2yN/Wedwem5ogqIVy1tkmCbKgXs +NyhavaaxegU22288aFSydMBquge7AAcxxYPAKxnD2Lisx0cDCTfXD6gxCMUS9/AO +w6xqgCkTNJmHCz/U2XjBkQRsWbOYqP7BvrGORxn3oUahruNLO51jBt2Peymj5tkT +enfgfBZG44cRhhmSSgppJ5+fwXB3lwybaFvLZP5gSjDqBH5nlWsy1HeIjubh+7Xl +s/9EOoHO3nJEH0nkbYp3lka7u5lEHp+vB9lsOegPpL/Blv2qQywaoGhwQHN6IlkZ +nATl2VLAcWTvRtWJp70DurMfQt+jrWvCMOlR6TB8kr6tqNJNjipj36Zzv9CNR/MO +t4ViG5kwUmihhc1Lfc/A9Ly5qbSJQhWM7ZV4JfQVYbGXBA6kUICZlZ3A0iTyijJw +MSCsqOtN1uu/8lIA8eImI63qDPqwzJdtT+qENZjyN7nwdVCTcCuV0uXXjLAFkRCk +Hkkjgfv8D+FugGpvpFsbhRUJXEgr4xQgWKj8ih2Hs4xtieXwKszDgSLS6T6PHt8b +HTDyaUJBlC2iCLzZwvyCUI+HxZ5Qzd/C4rFK4hFEXswp +=dndf +-----END PGP PUBLIC KEY BLOCK----- diff -Nru ttylog-0.30/debian/watch ttylog-0.31/debian/watch --- ttylog-0.30/debian/watch 2017-12-25 01:26:13.000000000 +0000 +++ ttylog-0.31/debian/watch 2018-01-15 22:48:43.000000000 +0000 @@ -1,8 +1,8 @@ # ttylog watch control file for uscan -# Compulsory line, this is a version 3 file -version=3 +# Compulsory line, this is a version 4 file +version=4 # Check at sourceforge for new ttylog versions, # for devscripts >= 2.9 -http://sf.net/ttylog/ttylog-(.*)\.tar\.gz +opts=pgpsigurlmangle=s/$/.asc/ http://sf.net/ttylog/ttylog-(.*)\.tar\.gz diff -Nru ttylog-0.30/README.md ttylog-0.31/README.md --- ttylog-0.30/README.md 2017-12-23 03:35:00.000000000 +0000 +++ ttylog-0.31/README.md 2018-01-15 01:47:14.000000000 +0000 @@ -15,10 +15,10 @@ Usage: ------ -ttylog [-b|--baud] [-d|--device] [-f|--flush] [-t|--timeout] > /path/to/logfile +ttylog [-b|--baud] [-d|--device] [-f|--flush] [-s|--stamp] [-t|--timeout] > /path/to/logfile If you are not using the timeout option, you can stop it running by pressing a -ctrl-c when it's going to the screen or doing "kill -HUP nnnn" if running it in +ctrl-c when it's going to the screen or doing 'kill -HUP nnnn' if running it in the background. Web sites diff -Nru ttylog-0.30/TODO ttylog-0.31/TODO --- ttylog-0.30/TODO 2017-12-23 03:35:00.000000000 +0000 +++ ttylog-0.31/TODO 2018-01-15 01:47:14.000000000 +0000 @@ -3,15 +3,43 @@ --------------------------------------------------------------------------- -- Start adding some kind of testing using CTest. -https://sourceforge.net/p/ttylog/feature-requests/9/ - ---------------------------------------------------------------------------- README.md - - Use single quotes for the 'kill -HUP nnnn' example - Use markdown to make the lists into bulleted lists (Web Sites and Support and Code). - - Put spaces around the "|" char in the Usage line. + - Put spaces around the "|" char in the Usage line? + +--------------------------------------------------------------------------- + - 22 Dec 2017 + +$ make +Scanning dependencies of target ttylog +[ 50%] Building C object CMakeFiles/ttylog.dir/ttylog.c.o +/home/jame/Projects/ttylog/ttylog.git/ttylog.c: In function ‘main’: +/home/jame/Projects/ttylog/ttylog.git/ttylog.c:190:31: warning: ‘baud’ may be used uninitialized in this function [-Wmaybe-uninitialized] + cfsetispeed (&newtio, BAUD_B[baud]); + ~~~~~~^~~~~~ +[100%] Linking C executable ttylog +[100%] Built target ttylog + +- Yet is that actually true? Thought it's being initialized to "-1" at + line 53? + + +-------------------------------------------------------------------------------- + 6/26/2016 +----------- + +- Error reported in at GH regarding errors related to OS X not having the librt +library needed for the '-t' option. + +https://sourceforge.net/p/ttylog/bugs/9/ +https://github.com/rocasa/ttylog/issues/6 + +- looks like a work around would be to bypass the '-t' option altogether when +compiling OS X. Perhaps enclosing the code for the '-t' option with an 'if' +clause that just prints that the '-t' is not available when the librt library +is not available. That way the option is still there but the compile won't +fail on OS X. (It's already set not to link on "APPLE".) --------------------------------------------------------------------------- - https://sourceforge.net/p/ttylog/feature-requests/8/ @@ -21,6 +49,9 @@ https://cmake.org/Wiki/CMakeUserUseRPMTools https://cmake.org/Wiki/CMake:CPackPackageGenerators + + - My only need to add it to the 'list' of generators? + --------------------------------------------------------------------------- https://sourceforge.net/p/ttylog/bugs/7/ @@ -44,11 +75,15 @@ - this is still present with v0.29 - this should error out because of the bad option '--b', when there is - only supposed to be '-b' or '--baud' option, but doesn't. This may be + only supposed to be '-b' or '--baud' option, but doesn't. This may b resolved but changing to use the standard getopt or the arg_parse (Argp) library. /usr/sbin/ttylog --b 2400 -d /dev/ttyS0 +- Other argument for updating it to use getopts; the following should + fail because there is no '-c' option: +root@rjcpc:/home/jame/Projects/ttylog/work# ./ttylog -c 4 -b 2400 -d /dev/ttyUSB0 + http://www.gnu.org/software/libc/manual/html_node/Parsing-Program-Arguments.html http://www.gnu.org/software/libc/manual/html_node/Getopt-Long-Option-Example.html @@ -103,6 +138,15 @@ - Investigate using my GPG key to sign upstream tarball; I already use it to sign the tags in the code repository. ------------------------------------------------------------------------------- + + - this is specific to adding such to a release at github but also notes how to create + the sig to begin with +https://wiki.debian.org/Creating%20signed%20GitHub%20releases + - This is the example given at step 6, which should "give a file called mysoftware-0.4.tar.gz.asc". + Although I think I'd need to include something specifiying the key to use. + +gpg --armor --detach-sign mysoftware-0.4.tar.gz + +------------------------------------------------------------------------------ diff -Nru ttylog-0.30/ttylog.c ttylog-0.31/ttylog.c --- ttylog-0.30/ttylog.c 2017-12-23 03:35:00.000000000 +0000 +++ ttylog-0.31/ttylog.c 2018-01-15 01:47:14.000000000 +0000 @@ -1,6 +1,7 @@ /* ttylog - serial port logger Copyright (C) 1999-2002 Tibor Koleszar - Copyright (C) 2008-2017 Robert James Clay + Copyright (C) 2008-2018 Robert James Clay + Copyright (C) 2017-2018 Guy Shapiro Copyright (C) 2016 Donald Gordon Copyright (C) 2016 Alexander (MrMontag) Fust Copyright (C) 2016 Logan Rosen @@ -49,7 +50,8 @@ { FILE *logfile; fd_set rfds; - int retval, i, j, baud, stamp = -1; + int retval, i, j, baud = -1; + int stamp = 0; timer_t timerid; struct sigevent sevp; sevp.sigev_notify = SIGEV_SIGNAL; @@ -75,7 +77,7 @@ if (!strcmp (argv[i], "-h") || !strcmp (argv[i], "--help")) { printf ("ttylog version %s\n", TTYLOG_VERSION); - printf ("Usage: ttylog [-b|--baud] [-d|--device] [-f|--flush] [-t|--timeout] > /path/to/logfile\n"); + printf ("Usage: ttylog [-b|--baud] [-d|--device] [-f|--flush] [-s|--stamp] [-t|--timeout] > /path/to/logfile\n"); printf (" -h, --help This help\n -v, --version Version number\n -b, --baud Baud rate\n"); printf (" -d, --device Serial device (eg. /dev/ttyS1)\n -f, --flush Flush output\n"); printf (" -s, --stamp\tPrefix each line with datestamp\n"); @@ -87,7 +89,9 @@ if (!strcmp (argv[i], "-v") || !strcmp (argv[i], "--version")) { printf ("ttylog version %s\n", TTYLOG_VERSION); - printf ("Copyright (C) 2016 Robert James Clay \n"); + printf ("Copyright (C) 2018 Robert James Clay \n"); + printf ("Copyright (C) 2018 Guy Shapiro \n"); + printf ("Copyright (C) 2016 Donald Gordon \n"); printf ("Copyright (C) 2016 Logan Rosen \n"); printf ("Copyright (C) 2016 Alexander (MrMontag) Fust \n"); printf ("Copyright (C) 2002 Tibor Koleszar \n"); @@ -209,9 +213,12 @@ FD_ZERO (&rfds); FD_SET (fd, &rfds); retval = select (fd + 1, &rfds, NULL, NULL, NULL); - if (retval) + if (retval > 0) { - fgets (line, 1024, logfile); + if (!fgets (line, 1024, logfile)) + { + if (ferror (logfile)) { break; } + } if (stamp) { time(&rawtime); @@ -225,6 +232,7 @@ if (flush) { fflush(stdout); } } + else if (retval < 0) { break; } } fclose (logfile);