diff --git a/.gitignore b/.gitignore index 8d0feaf..1a7d378 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,5 @@ /gpsd-3.23.1.tar.gz /gpsd-3.24.tar.gz /gpsd-3.25.tar.gz +/gpsd-3.26.1.tar.gz /scons-4.6.0.tar.gz diff --git a/gpsd-busywait.patch b/gpsd-busywait.patch deleted file mode 100644 index 784cfd3..0000000 --- a/gpsd-busywait.patch +++ /dev/null @@ -1,84 +0,0 @@ -commit e5ba7aa2af74fd22ebbd5c4a6624edcf983863de -Author: Michal Schmidt -Date: Fri Aug 4 16:53:01 2023 +0200 - - gps/gps.py.in: no busy-waiting when reading from gpsd socket - - ubxtool keeps one CPU 100% busy while it waits for data to read from the - gpsd socket. Running it under strace showed that it calls select() with - zero timeout in a loop: - - ... - 11:02:34.049629 pselect6(4, [3], [], [], {tv_sec=0, tv_nsec=0}, NULL) = 0 (Timeout) - 11:02:34.049649 pselect6(4, [3], [], [], {tv_sec=0, tv_nsec=0}, NULL) = 0 (Timeout) - 11:02:34.049670 pselect6(4, [3], [], [], {tv_sec=0, tv_nsec=0}, NULL) = 0 (Timeout) - ... - - The busy waiting can be eliminated by passing the actual timeout value - to select(). In the reading loop in gps.py, the remaining time can be - easily calculated and passed as the argument to the self.ser.waiting() - function (which is basically a select() wrapper). - - Fixing this problem exposed a bug in how the received bytes are decoded. - decode_func may not consume all input at once. Consumable input may be - left in self.out until decode_func returns zero, indicating that it - could not process any more input. So decode_func must be called in a - loop each time a buffer is received from the socket. The busy waiting - was hiding this issue, because decode_func was being called all the - time. - - The "elif self.input_is_device:" branch probably needs similar - treatment, but I am testing only the gpsd usecase. - -diff --git a/gps/gps.py.in b/gps/gps.py.in -index 623a750a0..14d7707ab 100644 ---- a/gps/gps.py.in -+++ b/gps/gps.py.in -@@ -384,10 +384,11 @@ class gps_io(object): - if self.gpsd_host is not None: - # gpsd input - start = monotonic() -- while (monotonic() - start) < input_wait: -+ remaining_time = input_wait -+ while remaining_time > 0: - # First priority is to be sure the input buffer is read. - # This is to prevent input buffer overuns -- if 0 < self.ser.waiting(): -+ if 0 < self.ser.waiting(remaining_time): - # We have serial input waiting, get it - # No timeout possible - # RTCM3 JSON can be over 4.4k long, so go big -@@ -397,17 +398,22 @@ class gps_io(object): - raw_fd.write(polybytes(new_out)) - self.out += new_out - -- consumed = decode_func(self.out) -- # TODO: the decoder shall return a some current -- # statement_identifier # to fill last_statement_identifier -- last_statement_identifier = None -- # -- self.out = self.out[consumed:] -- if ((expect_statement_identifier and -- (expect_statement_identifier == -- last_statement_identifier))): -- # Got what we were waiting for. Done? -- ret_code = 0 -+ while True: -+ consumed = decode_func(self.out) -+ if consumed == 0: -+ break -+ # TODO: the decoder shall return a some current -+ # statement_identifier # to fill last_statement_identifier -+ last_statement_identifier = None -+ # -+ self.out = self.out[consumed:] -+ if ((expect_statement_identifier and -+ (expect_statement_identifier == -+ last_statement_identifier))): -+ # Got what we were waiting for. Done? -+ ret_code = 0 -+ -+ remaining_time = start + input_wait - monotonic() - - elif self.input_is_device: - # input is a serial device diff --git a/gpsd-ipv6.patch b/gpsd-ipv6.patch deleted file mode 100644 index ade8abb..0000000 --- a/gpsd-ipv6.patch +++ /dev/null @@ -1,356 +0,0 @@ -commit 5c080c35fc3d981172a5e4af34d0d92854a5433a -Author: Miroslav Lichvar -Date: Tue Jul 25 11:01:14 2023 +0200 - - libgps/netlib.c: Rework enabling non-block and make binding configurable. - - Instead of accepting SOCK_NONBLOCK as flags in netlib_connectsock1() - specify if the non-blocking mode should be enabled after or before - connect(). - - Also add a boolean parameter to the function to select between connect() - and bind() instead of hardcoding it for TCP vs UDP, which will allow - connecting to UDP ports in gps2udp. - -diff --git a/gpsd/libgpsd_core.c b/gpsd/libgpsd_core.c -index 47ee5d57e..341e8b80c 100644 ---- a/gpsd/libgpsd_core.c -+++ b/gpsd/libgpsd_core.c -@@ -561,7 +561,6 @@ int gpsd_open(struct gps_device_t *session) - char server[GPS_PATH_MAX], *host, *port, *device; - socket_t dsock; - char addrbuf[50]; // INET6_ADDRSTRLEN -- int sock_opt; - - session->sourcetype = SOURCE_TCP; - (void)strlcpy(server, session->gpsdata.dev.path + 6, sizeof(server)); -@@ -576,15 +575,9 @@ int gpsd_open(struct gps_device_t *session) - GPSD_LOG(LOG_PROG, &session->context->errout, - "CORE: opening TCP feed at %s, port %s.\n", host, - port); --#if defined(SOCK_NONBLOCK) -- sock_opt = SOCK_NONBLOCK; --#else -- // macOS has no SOCK_NONBLOCK -- sock_opt = 0; --#endif - // open non-blocking - dsock = netlib_connectsock1(AF_UNSPEC, host, port, "tcp", -- sock_opt, addrbuf, sizeof(addrbuf)); -+ 1, false, addrbuf, sizeof(addrbuf)); - if (0 > dsock) { - GPSD_LOG(LOG_ERROR, &session->context->errout, - "CORE: TCP %s IP %s, open error %s(%d).\n", -@@ -614,7 +607,8 @@ int gpsd_open(struct gps_device_t *session) - GPSD_LOG(LOG_PROG, &session->context->errout, - "CORE: opening UDP feed at %s, port %s.\n", host, - port); -- if (0 > (dsock = netlib_connectsock(AF_UNSPEC, host, port, "udp"))) { -+ if (0 > (dsock = netlib_connectsock1(AF_UNSPEC, host, port, "udp", -+ 0, true, NULL, 0))) { - GPSD_LOG(LOG_ERROR, &session->context->errout, - "CORE: UDP device open error %s(%d).\n", - netlib_errstr(dsock), dsock); -diff --git a/gpsd/net_ntrip.c b/gpsd/net_ntrip.c -index 8241995ae..d89bdc1f9 100644 ---- a/gpsd/net_ntrip.c -+++ b/gpsd/net_ntrip.c -@@ -856,7 +856,8 @@ static int ntrip_reconnect(struct gps_device_t *device) - device->gpsdata.dev.path); - dsock = netlib_connectsock1(AF_UNSPEC, device->ntrip.stream.host, - device->ntrip.stream.port, -- "tcp", SOCK_NONBLOCK, addrbuf, sizeof(addrbuf)); -+ "tcp", 1, false, -+ addrbuf, sizeof(addrbuf)); - device->gpsdata.gps_fd = dsock; - // nonblocking means we have the fd, but the connection is not - // finished yet. Connection may fail, later. -diff --git a/include/gpsd.h b/include/gpsd.h -index 0f6b731eb..2f3260c1e 100644 ---- a/include/gpsd.h -+++ b/include/gpsd.h -@@ -1002,7 +1002,7 @@ extern void gpsd_clear_data(struct gps_device_t *); - extern socket_t netlib_connectsock(int, const char *, const char *, - const char *); - extern socket_t netlib_connectsock1(int, const char *, const char *, -- const char *, int, -+ const char *, int, bool, - char *, size_t); - // end FIXME - extern socket_t netlib_localsocket(const char *, int); -diff --git a/libgps/netlib.c b/libgps/netlib.c -index e4e763025..5f553fe10 100644 ---- a/libgps/netlib.c -+++ b/libgps/netlib.c -@@ -55,8 +55,10 @@ - * host - host to connect to - * service -- aka port - * protocol -- * flags -- can be SOCK_NONBLOCK for non-blocking connect -- * Note: macOS does not have SOCK_NONBLOCK -+ * nonblock -- 1 sets the socket as non-blocking before connect() if -+ * SOCK_NONBLOCK is supported, -+ * >1 sets the socket as non-blocking after connect() -+ * bind_me -- call bind() on the socket instead of connect() - * addrbuf -- 50 char buf to put string of IP address conencting - * INET6_ADDRSTRLEN - * addrbuf_sz -- sizeof(adddrbuf) -@@ -70,16 +72,15 @@ - * less than zero on error (NL_*) - */ - socket_t netlib_connectsock1(int af, const char *host, const char *service, -- const char *protocol, int flags, -+ const char *protocol, int nonblock, bool bind_me, - char *addrbuf, size_t addrbuf_sz) - { - struct protoent *ppe; - struct addrinfo hints; - struct addrinfo *result = NULL; - struct addrinfo *rp; -- int ret, type, proto, one; -+ int ret, flags, type, proto, one; - socket_t s; -- bool bind_me; - - if (NULL != addrbuf) { - addrbuf[0] = '\0'; -@@ -97,9 +98,6 @@ socket_t netlib_connectsock1(int af, const char *host, const char *service, - return NL_NOPROTO; - } - -- /* we probably ought to pass this in as an explicit flag argument */ -- bind_me = (SOCK_DGRAM == type); -- - memset(&hints, 0, sizeof(struct addrinfo)); - hints.ai_family = af; - hints.ai_socktype = type; -@@ -107,6 +105,15 @@ socket_t netlib_connectsock1(int af, const char *host, const char *service, - if (bind_me) { - hints.ai_flags = AI_PASSIVE; - } -+#if defined(SOCK_NONBLOCK) -+ flags = nonblock == 1 ? SOCK_NONBLOCK : 0; -+#else -+ // macOS has no SOCK_NONBLOCK -+ flags = 0; -+ if (nonblock == 1) -+ nonblock = 2; -+#endif -+ - // FIXME: need a way to bypass these DNS calls if host is an IP. - if ((ret = getaddrinfo(host, service, &hints, &result))) { - // result is unchanged on error, so we need to have set it to NULL -@@ -219,13 +226,15 @@ socket_t netlib_connectsock1(int af, const char *host, const char *service, - sizeof(one)); - } - -- // set socket to noblocking -+ if (nonblock > 1) { -+ // set socket to noblocking - #ifdef HAVE_FCNTL -- (void)fcntl(s, F_SETFL, fcntl(s, F_GETFL) | O_NONBLOCK); -+ (void)fcntl(s, F_SETFL, fcntl(s, F_GETFL) | O_NONBLOCK); - #elif defined(HAVE_WINSOCK2_H) -- u_long one1 = 1; -- (void)ioctlsocket(s, FIONBIO, &one1); -+ u_long one1 = 1; -+ (void)ioctlsocket(s, FIONBIO, &one1); - #endif -+ } - return s; - } - -@@ -235,7 +244,7 @@ socket_t netlib_connectsock1(int af, const char *host, const char *service, - socket_t netlib_connectsock(int af, const char *host, const char *service, - const char *protocol) - { -- return netlib_connectsock1(af, host, service, protocol, 0, NULL, 0); -+ return netlib_connectsock1(af, host, service, protocol, 2, false, NULL, 0); - } - - // Convert NL_* error code to a string - -commit fd6682a6ffd0a5d4d640839422274b582ba38e72 -Author: Miroslav Lichvar -Date: Tue Jul 25 11:08:19 2023 +0200 - - clients/gps2udp.c: Switch to netlib_connectsock1(). - - Use netlib_connectsock1() to avoid using obsolete gethostbyname() and - support IPv6. - -diff --git a/clients/gps2udp.c b/clients/gps2udp.c -index 2d9c6033d..541054d8f 100644 ---- a/clients/gps2udp.c -+++ b/clients/gps2udp.c -@@ -21,7 +21,6 @@ - #ifdef HAVE_GETOPT_LONG - #include // for getopt_long() - #endif --#include /* for gethostbyname() */ - #include - #include - #include -@@ -50,7 +49,6 @@ static struct gps_data_t gpsdata; - - /* UDP socket variables */ - #define MAX_UDP_DEST 5 --static struct sockaddr_in remote[MAX_UDP_DEST]; - static int sock[MAX_UDP_DEST]; - static int udpchannel; - -@@ -128,12 +126,10 @@ static int send_udp(char *nmeastring, size_t ind) - - // send message on udp channel - for (channel=0; channel < udpchannel; channel ++) { -- ssize_t status = sendto(sock[channel], -- buffer, -- ind, -- 0, -- (struct sockaddr *)&remote[channel], -- (int)sizeof(remote)); -+ ssize_t status = send(sock[channel], -+ buffer, -+ ind, -+ 0); - if (status < (ssize_t)ind) { - (void)fprintf(stderr, "gps2udp: failed to send [%s] \n", - buffer); -@@ -152,9 +148,6 @@ static int open_udp(char **hostport) - for (channel = 0; channel < udpchannel; channel++) { - char *hostname = NULL; - char *portname = NULL; -- char *endptr = NULL; -- int portnum; -- struct hostent *hp; - - if (NULL == hostport[channel]) { - // pacify coverity -@@ -171,32 +164,13 @@ static int open_udp(char **hostport) - return -1; - } - -- errno = 0; -- portnum = (int)strtol(portname, &endptr, 10); -- if (1 > portnum || 65535 < portnum || '\0' != *endptr || 0 != errno) { -- (void)fprintf(stderr, "gps2udp: syntax is [-u hostname:port] " -- "[%s] is not a valid port number\n", portname); -- return -1; -- } -- -- sock[channel]= socket(AF_INET, SOCK_DGRAM, 0); -+ sock[channel] = netlib_connectsock1(AF_UNSPEC, hostname, portname, "udp", -+ 0, false, NULL, 0); - if (0 > sock[channel]) { -- (void)fprintf(stderr, "gps2udp: error creating UDP socket\n"); -+ (void)fprintf(stderr, "gps2udp: error creating UDP socket: %s\n", -+ netlib_errstr(sock[channel])); - return -1; - } -- -- remote[channel].sin_family = (sa_family_t)AF_INET; -- hp = gethostbyname(hostname); -- if (NULL == hp) { -- (void)fprintf(stderr, -- "gps2udp: syntax is [-u hostname:port] [%s]" -- " is not a valid hostname\n", -- hostname); -- return -1; -- } -- -- memcpy( &remote[channel].sin_addr, hp->h_addr_list[0], hp->h_length); -- remote[channel].sin_port = htons((in_port_t)portnum); - } - return 0; - } - -commit 749be8acce27f16d74ba727f4819f3e49602882a -Author: Miroslav Lichvar -Date: Tue Jul 25 11:10:39 2023 +0200 - - clients/lcdgps.c: Switch to netlib_connectsock1(). - - Use netlib_connectsock1() to avoid using obsolete gethostbyname() and - support IPv6. - -diff --git a/clients/lcdgps.c b/clients/lcdgps.c -index 7d0ee6bc8..b311882b0 100644 ---- a/clients/lcdgps.c -+++ b/clients/lcdgps.c -@@ -21,11 +21,12 @@ - */ - - #define LCDDHOST "localhost" --#define LCDDPORT 13666 -+#define LCDDPORT "13666" - - #define CLIMB 3 - - #include "../include/gpsd_config.h" /* must be before all includes */ -+#include "../include/gpsd.h" - - #include - #include -@@ -33,7 +34,6 @@ - #include // for getopt_long() - #endif - #include --#include /* for gethostbyname() */ - #include - #include - #include -@@ -259,9 +259,6 @@ static void usage( char *prog) - - int main(int argc, char *argv[]) - { -- int rc; -- struct sockaddr_in localAddr, servAddr; -- struct hostent *h; - const char *optstring = "?hl:su:V"; - int n; - #ifdef HAVE_GETOPT_LONG -@@ -390,41 +387,10 @@ int main(int argc, char *argv[]) - } - - /* Connect to LCDd */ -- h = gethostbyname(LCDDHOST); -- if (h==NULL) { -- printf("%s: unknown host '%s'\n",argv[0],LCDDHOST); -- exit(EXIT_FAILURE); -- } -- -- servAddr.sin_family = h->h_addrtype; -- memcpy((char *) &servAddr.sin_addr.s_addr, h->h_addr_list[0], h->h_length); -- servAddr.sin_port = htons(LCDDPORT); -- -- /* create socket */ -- sd = socket(AF_INET, SOCK_STREAM, 0); -- if (BAD_SOCKET(sd)) { -- perror("cannot open socket "); -- exit(EXIT_FAILURE); -- } -- -- /* bind any port number */ -- localAddr.sin_family = AF_INET; -- localAddr.sin_addr.s_addr = htonl(INADDR_ANY); -- localAddr.sin_port = htons(0); -- -- /* coverity[uninit_use_in_call] */ -- rc = bind(sd, (struct sockaddr *) &localAddr, sizeof(localAddr)); -- if (rc == -1) { -- printf("%s: cannot bind port TCP %d\n",argv[0],LCDDPORT); -- perror("error "); -- exit(EXIT_FAILURE); -- } -+ sd = netlib_connectsock1(AF_UNSPEC, LCDDHOST, LCDDPORT, "tcp", 0, false, NULL, 0); -+ if (0 > sd) { - -- /* connect to server */ -- /* coverity[uninit_use_in_call] */ -- rc = connect(sd, (struct sockaddr *) &servAddr, sizeof(servAddr)); -- if (rc == -1) { -- perror("cannot connect "); -+ (void)fprintf(stderr, "lcdgps: cannot connect: %s\n", netlib_errstr(sd)); - exit(EXIT_FAILURE); - } - diff --git a/gpsd-scanfixes.patch b/gpsd-scanfixes.patch deleted file mode 100644 index 67cca18..0000000 --- a/gpsd-scanfixes.patch +++ /dev/null @@ -1,188 +0,0 @@ -commit 651d505d2b075b9bd87729d2d5d155c29c03fbc1 -Author: Miroslav Lichvar -Date: Mon Jul 31 15:46:16 2023 +0200 - - devtools/tablegen.py: Fix typo in structname. - -diff --git a/devtools/tablegen.py b/devtools/tablegen.py -index 7851fceca..3feb64b9e 100755 ---- a/devtools/tablegen.py -+++ b/devtools/tablegen.py -@@ -129,7 +129,7 @@ def make_driver_code(wfp): - continue - offset = offsets[i].split('-')[0] - if arrayname: -- target = "%s.%s[i].%s" % (structnme, arrayname, name) -+ target = "%s.%s[i].%s" % (structname, arrayname, name) - offset = "a + " + offset - else: - target = "%s.%s" % (structname, name) - -commit db2a00f7ee4e66ee57ff66e84cec664444c26d8f -Author: Miroslav Lichvar -Date: Mon Jul 31 15:47:10 2023 +0200 - - gpsd/net_dgpsip.c: Fix socket check. - -diff --git a/gpsd/net_dgpsip.c b/gpsd/net_dgpsip.c -index d6e123b67..8e218ba41 100644 ---- a/gpsd/net_dgpsip.c -+++ b/gpsd/net_dgpsip.c -@@ -42,7 +42,7 @@ socket_t dgpsip_open(struct gps_device_t *device, const char *dgpsserver) - } - - dsock = netlib_connectsock(AF_UNSPEC, dgpsserver, dgpsport, "tcp"); -- if (0 <= dsock) { -+ if (0 > dsock) { - GPSD_LOG(LOG_ERROR, &device->context->errout, - "DGPS: can't connect to DGPS server %s, netlib error %s(%d).\n", - dgpsserver, netlib_errstr(dsock), dsock); - -commit 60bc3595dbb74f8904037ad64b2a0820c408996b -Author: Miroslav Lichvar -Date: Mon Jul 31 15:50:32 2023 +0200 - - clients/gpsdebuginfo: Fix issues reported by shellcheck. - -diff --git a/clients/gpsdebuginfo b/clients/gpsdebuginfo -index fa970dad9..38a1540b2 100755 ---- a/clients/gpsdebuginfo -+++ b/clients/gpsdebuginfo -@@ -7,7 +7,7 @@ exec 2>&1 - - # print what we do - set -x --if [ 0 != $(id -u) ]; then -+if [ 0 != "$(id -u)" ]; then - echo "Please run as root" - exit 1 - fi -@@ -63,9 +63,9 @@ ls -l /dev/pps* /dev/tty[ASTU]* /dev/gps* - if command -v lsusb; then - lsusb - fi --echo PYTHONPATH $PYTHONPATH -+echo PYTHONPATH "$PYTHONPATH" - if command -v gpscat; then -- head -n 1 `command -v gpscat` -+ head -n 1 "$(command -v gpscat)" - fi - if command -v python; then - python -V - -commit e12265d591f07a50d6de54af83ae6246326460ef -Author: Miroslav Lichvar -Date: Mon Jul 31 15:50:58 2023 +0200 - - gpsinit: Fix issues reported by shellcheck. - -diff --git a/gpsinit b/gpsinit -index 5c14f3374..8fc6c92ec 100755 ---- a/gpsinit -+++ b/gpsinit -@@ -6,26 +6,23 @@ - # SPDX-License-Identifier: BSD-2-clause - # - --speed=38400 - net=0 - - version() - { -- echo `basename $0`" : Version v0.21"; -+ echo "$(basename "$0") : Version v0.21"; - } - - usage() - { - version; echo; -- echo "usage :" `basename $0` "[-n ] [-s ] []"; -- echo " :" `basename $0` "-V"; -- echo " :" `basename $0` "-h"; -+ echo "usage : $(basename "$0") [-n ] []"; -+ echo " : $(basename "$0") -V"; -+ echo " : $(basename "$0") -h"; - echo " Options include:"; - echo " -? = Print this help message and exit."; - echo " -h = Print this help message and exit."; - echo " -n = CAN network number, 0 if not given."; -- echo " -s = Speed of the slcan hardware port, 38400 if not given."; -- echo " = Needed for some slcan modules only."; - echo " -V = Print version of this script and exit."; - echo " can_module_name = One out of plx_pci, esd_usb2, usb_8dev, vcan, slcan, beaglebone."; - echo " interface_name = The interface, the SLCAN module is connected to, i.e. /dev/ttyS0 or /dev/ttyUSB0."; -@@ -34,19 +31,19 @@ usage() - } - - # -v for version is deprecated 2020 --while getopts :n:s:vh opt -+while getopts :n:s:vVh opt - do - case ${opt} in - h) usage; exit 0;; - n) net=${OPTARG};; -- s) speed=${OPTARG};; -+ s) ;; # unused - \?) usage; exit 1;; - v) version; exit 0;; - V) version; exit 0;; - esac - done - --shift $((${OPTIND} - 1)) -+shift $((OPTIND - 1)) - - candevice=$1 - -@@ -54,38 +51,38 @@ case ${candevice} in - plx_pci) - # For the SJA1000 based PCI or PCI-Express CAN interface - modprobe plx_pci; -- ip link set can${net} type can tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1; -- ip link set can${net} up;; -+ ip link set "can${net}" type can tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1; -+ ip link set "can${net}" up;; - esd_usb2) - # For an esd usb/2 CAN interface - modprobe esd_usb2; -- ip link set can${net} type can tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1; -- ip link set can${net} up;; -+ ip link set "can${net}" type can tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1; -+ ip link set "can${net}" up;; - usb_8dev) - # For an 8devices usb2can CAN interface - modprobe usb_8dev; -- ip link set can${net} type can tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1; -- ip link set can${net} up;; -+ ip link set "can${net}" type can tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1; -+ ip link set "can${net}" up;; - vcan) - # With this setup, CAN frames can be injected into vcan0 by a test - modprobe vcan; - ip link add type vcan; -- ip link set vcan${net} up;; -+ ip link set "vcan${net}" up;; - slcan) - # For a serial line CAN device - # No support for devices, that need a setup of the baudrate yet - device=${2:-/dev/ttyUSB0}; - modprobe slcan; -- slcan_attach -f -s5 -o ${device}; -- slcand `basename ${device}`; -- ip link set slcan${net} up;; -+ slcan_attach -f -s5 -o "${device}"; -+ slcand "$(basename "${device}")"; -+ ip link set "slcan${net}" up;; - beaglebone) - # For CAN interface on a BeagleBone - # The d_can driver is part of the kernel -- ip link set can${net} type can bitrate 250000 sjw 1; -- ip link set can${net} up;; -+ ip link set "can${net}" type can bitrate 250000 sjw 1; -+ ip link set "can${net}" up;; - *) -- echo `basename ${0}` ": invalid CAN interface ${1} net${net} device ${2:-(none)}" -+ echo "$(basename "$0") : invalid CAN interface ${1} net${net} device ${2:-(none)}" - echo; - usage; - exit 1 diff --git a/gpsd-sconsflags.patch b/gpsd-sconsflags.patch deleted file mode 100644 index 5c6b25f..0000000 --- a/gpsd-sconsflags.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -up gpsd-3.25/SConscript.sconsflags gpsd-3.25/SConscript ---- gpsd-3.25/SConscript.sconsflags 2024-04-22 15:14:25.672775265 +0200 -+++ gpsd-3.25/SConscript 2024-04-22 15:18:33.935960954 +0200 -@@ -619,12 +619,15 @@ for i in ["ARFLAGS", - "SHLINKFLAGS", - ]: - if i in os.environ: -- env.MergeFlags(Split(os.getenv(i))) -+ t = i -+ if t == "LDFLAGS": -+ t = "LINKFLAGS" -+ env.MergeFlags({t: Split(os.getenv(i))}) - - --# Keep scan-build options in the environment -+# Keep scan-build and rpm options in the environment - for key, value in os.environ.items(): -- if key.startswith('CCC_'): -+ if key.startswith('CCC_') or key.startswith('RPM_'): - env.Append(ENV={key: value}) - - # Placeholder so we can kluge together something like VPATH builds. diff --git a/gpsd.spec b/gpsd.spec index 55297e6..826435d 100644 --- a/gpsd.spec +++ b/gpsd.spec @@ -13,7 +13,7 @@ %global note2 https://access.redhat.com/support/policy/gpsd-support for more details. Name: gpsd -Version: 3.25 +Version: 3.26.1 Release: 17%{?dist} Epoch: 1 Summary: Service daemon for mediating access to a GPS @@ -25,15 +25,6 @@ Source0: https://download-mirror.savannah.gnu.org/releases/gpsd/%{name}-% Source1: https://github.com/SCons/scons/archive/%{scons_ver}/scons-%{scons_ver}.tar.gz Source11: gpsd.sysconfig -# add missing IPv6 support -Patch1: gpsd-ipv6.patch -# fix some issues reported by coverity and shellcheck -Patch2: gpsd-scanfixes.patch -# fix busy wait when reading from gpsd socket -Patch3: gpsd-busywait.patch -# don't ignore unrecognized options in CFLAGS/LDFLAGS -Patch4: gpsd-sconsflags.patch - BuildRequires: gcc BuildRequires: dbus-devel BuildRequires: ncurses-devel @@ -147,10 +138,6 @@ This package contains X clients using gpsd. %prep %setup -q -a 1 -%patch -P 1 -p1 -b .ipv6 -%patch -P 2 -p1 -b .scanfixes -%patch -P 3 -p1 -b .busywait -%patch -P 4 -p1 -b .sconsflags # add note to man pages about limited support sed -i ':a;$!{N;ba};s|\(\.SH "[^"]*"\)|.SH "NOTE"\n%{note1}\n%{note2}\n\1|3' \ @@ -285,7 +272,7 @@ rm -rf %{buildroot}%{_docdir}/gpsd %if %{with_libs} %files libs -%{_libdir}/libgps.so.30* +%{_libdir}/libgps.so.31* %files devel %doc TODO HACKING @@ -300,7 +287,7 @@ rm -rf %{buildroot}%{_docdir}/gpsd %if %{with_qt} %files qt -%{_libdir}/libQgpsmm.so.30* +%{_libdir}/libQgpsmm.so.31* %files qt-devel %{_libdir}/libQgpsmm.so @@ -322,6 +309,7 @@ rm -rf %{buildroot}%{_docdir}/gpsd %{_bindir}/gpscsv %{_bindir}/gpsdebuginfo %{_bindir}/gpsdecode +%{_bindir}/gpslogntp %{_bindir}/gpspipe %{_bindir}/gpsplot %{_bindir}/gpsprof @@ -339,6 +327,7 @@ rm -rf %{buildroot}%{_docdir}/gpsd %{_mandir}/man1/gpscsv.1* %{_mandir}/man1/gpsdebuginfo.1* %{_mandir}/man1/gpsdecode.1* +%{_mandir}/man1/gpslogntp.1* %{_mandir}/man1/gpspipe.1* %{_mandir}/man1/gpsplot.1* %{_mandir}/man1/gpsprof.1* diff --git a/sources b/sources index 81531cf..7b463cc 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (gpsd-3.25.tar.gz) = 0684cbd30defa1a328898589e1d61b2431462a774aff56c588bd00c1fbd92ac94cf6fc1f2b981debac78c34ab09fa24f48ed6334f3ecd09e6b8f5faa92ae1085 +SHA512 (gpsd-3.26.1.tar.gz) = f0d7af38a87ee5dc651b7f07ac365bff56baafcfb1e1feb8410a786549c23f898efc22ba6619a81bdd4f44653ec0d89af2b1ced92e24b4c545e51839b68db7d8 SHA512 (scons-4.6.0.tar.gz) = d7dd30bbc94ec014b12b37a106aa536dd5c8b16e9f1605b68cad6721cf6e3959add1f75a42693fd8499734ca19eb76f648800d7cc8081fe334282841cd406954