git: 95958ea716ec - main - sysutils/hatop: Update to 0.8.1
Rainer Hurling
rhurlin at FreeBSD.org
Tue Apr 27 16:18:59 UTC 2021
The branch main has been updated by rhurlin:
URL: https://cgit.FreeBSD.org/ports/commit/?id=95958ea716ecccb626ea6731e46ce88e0b866737
commit 95958ea716ecccb626ea6731e46ce88e0b866737
Author: Rainer Hurling <rhurlin at FreeBSD.org>
AuthorDate: 2021-04-27 16:15:16 +0000
Commit: Rainer Hurling <rhurlin at FreeBSD.org>
CommitDate: 2021-04-27 16:15:16 +0000
sysutils/hatop: Update to 0.8.1
Changelog: https://github.com/jhunt/hatop/releases/tag/v0.8.1
PR: 255353
Submitted by: mikeg at bsd-box.net (maintainer)
---
sysutils/hatop/Makefile | 15 ++-
sysutils/hatop/distinfo | 6 +-
sysutils/hatop/files/patch-bin_hatop | 222 -----------------------------------
sysutils/hatop/pkg-descr | 2 +-
4 files changed, 11 insertions(+), 234 deletions(-)
diff --git a/sysutils/hatop/Makefile b/sysutils/hatop/Makefile
index 6ed664931b47..4de7eba3ed31 100644
--- a/sysutils/hatop/Makefile
+++ b/sysutils/hatop/Makefile
@@ -1,8 +1,7 @@
# Created by: Jim Riggs <ports at christianserving.org>
PORTNAME= hatop
-PORTVERSION= 0.7.7
-PORTREVISION= 5
+PORTVERSION= 0.8.1
DISTVERSIONPREFIX= v
CATEGORIES= sysutils net
@@ -14,16 +13,16 @@ LICENSE= GPLv3+
RUN_DEPENDS= ${LOCALBASE}/sbin/haproxy:net/haproxy
USES= python shebangfix
-SHEBANG_FILES= bin/hatop
-NO_BUILD= yes
-NO_ARCH= yes
-
USE_GITHUB= yes
-GH_ACCOUNT= feurix
+GH_ACCOUNT= jhunt
GH_PROJECT= hatop
+SHEBANG_FILES= bin/hatop
+NO_ARCH= yes
+NO_BUILD= yes
+
PLIST_FILES= bin/hatop man/man1/hatop.1.gz
-PORTDOCS= HACKING KEYBINDS README
+PORTDOCS= HACKING KEYBINDS README.rst
OPTIONS_DEFINE= DOCS
diff --git a/sysutils/hatop/distinfo b/sysutils/hatop/distinfo
index 1d62627dec68..b772d356dc07 100644
--- a/sysutils/hatop/distinfo
+++ b/sysutils/hatop/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1476457506
-SHA256 (feurix-hatop-v0.7.7_GH0.tar.gz) = 497a28e484940bf2f6dd5919041d5d03025325a59e8f95f376f573db616ca35d
-SIZE (feurix-hatop-v0.7.7_GH0.tar.gz) = 134216
+TIMESTAMP = 1619215373
+SHA256 (jhunt-hatop-v0.8.1_GH0.tar.gz) = 9f65a73a229282d9eaaebea93775878bb227d5168f506d99e71b9914fd86f886
+SIZE (jhunt-hatop-v0.8.1_GH0.tar.gz) = 136760
diff --git a/sysutils/hatop/files/patch-bin_hatop b/sysutils/hatop/files/patch-bin_hatop
deleted file mode 100644
index 9cabff44f240..000000000000
--- a/sysutils/hatop/files/patch-bin_hatop
+++ /dev/null
@@ -1,222 +0,0 @@
---- bin/hatop.orig 2019-12-09 21:46:21 UTC
-+++ bin/hatop
-@@ -404,7 +404,7 @@ class Socket:
- data = self._socket.recv(HAPROXY_CLI_BUFSIZE)
- if not data:
- raise SocketError('error while waiting for prompt')
-- return data
-+ return data.decode()
-
- def connect(self):
- # Initialize socket connection
-@@ -414,16 +414,16 @@ class Socket:
- # Enter the interactive socket mode. This requires HAProxy 1.4+ and
- # allows us to error out early if connected to an older version.
- try:
-- self.send('prompt')
-+ self.send(b'prompt')
- self.wait()
-- self.send('set timeout cli %d' % HAPROXY_CLI_TIMEOUT)
-+ self.send(b'set timeout cli %d' % HAPROXY_CLI_TIMEOUT)
- self.wait()
- except SocketError:
- raise SocketError('error while initializing interactive mode')
-
- def close(self):
- try:
-- self.send('quit')
-+ self.send(b'quit')
- except:
- pass
- try:
-@@ -432,7 +432,7 @@ class Socket:
- pass
-
- def send(self, cmdline):
-- self._socket.sendall('%s\n' % cmdline)
-+ self._socket.sendall(b'%s\n' % cmdline)
-
- def wait(self):
- # Wait for the prompt and discard data.
-@@ -495,7 +495,7 @@ class SocketData:
- raise ValueError('invalid proxy filter: %s' % filter)
-
- # Convert proxy filters into more efficient stat filters
-- self.socket.send('show stat')
-+ self.socket.send(b'show stat')
- pxstat, pxcount, svcount = parse_stat(self.socket.recv())
-
- proxy_iid_map = {} # {pxname: iid, ...}
-@@ -514,11 +514,11 @@ class SocketData:
- raise RuntimeError('proxy not found: %s' % pxname)
-
- # Register filters
-- for iid in proxy_iid_map.itervalues():
-+ for iid in proxy_iid_map.values():
- self._filters.add((iid, -1, -1))
-
- def update_info(self):
-- self.socket.send('show info')
-+ self.socket.send(b'show info')
- iterable = self.socket.recv()
- self.info = parse_info(iterable)
-
-@@ -535,7 +535,7 @@ class SocketData:
-
- if self._filters:
- for filter in self._filters:
-- self.socket.send('show stat %d %d %d' % filter)
-+ self.socket.send(b'show stat %d %d %d' % filter)
- filter_stat, filter_pxcount, filter_svcount = \
- parse_stat(self.socket.recv())
-
-@@ -546,7 +546,7 @@ class SocketData:
- self.svcount += filter_svcount
- self.stat.update(filter_stat)
- else:
-- self.socket.send('show stat')
-+ self.socket.send(b'show stat')
- self.stat, self.pxcount, self.svcount = \
- parse_stat(self.socket.recv())
-
-@@ -716,7 +716,7 @@ class ScreenCLI:
- self.ibuf = list(self.ihist[-1])
- self.mvend()
-
-- def next(self):
-+ def __next__(self):
- if len(self.ihist) == 0:
- return
- self.ihist.rotate(-1)
-@@ -854,7 +854,7 @@ class ScreenCLI:
- def execute_cmdline(self, cmdline):
- self.obuf.append('* %s' % time.ctime())
- self.obuf.append('> %s' % cmdline)
-- self.screen.data.socket.send(cmdline)
-+ self.screen.data.socket.send(cmdline.encode())
- self.obuf.extend(self.screen.data.socket.recv())
- self.update_screenlines()
-
-@@ -1087,7 +1087,7 @@ class Screen:
- self.data.update_info()
- try:
- self.data.update_stat()
-- except RuntimeWarning, x:
-+ except RuntimeWarning as x:
- self.exceptions.append(x)
-
- def update_bars(self):
-@@ -1438,19 +1438,19 @@ class StatusBar:
- # ------------------------------------------------------------------------- #
-
- def human_seconds(numeric):
-- for minval, prefix in sorted(PREFIX_TIME.items(), reverse=True):
-+ for minval, prefix in sorted(list(PREFIX_TIME.items()), reverse=True):
- if (numeric/minval):
- return '%d%s' % (numeric/minval, prefix)
- return '%ds' % numeric
-
- def human_metric(numeric):
-- for minval, prefix in sorted(PREFIX_METRIC.items(), reverse=True):
-+ for minval, prefix in sorted(list(PREFIX_METRIC.items()), reverse=True):
- if (numeric/minval):
- return '%d%s' % (numeric/minval, prefix)
- return str(numeric)
-
- def human_binary(numeric):
-- for minval, prefix in sorted(PREFIX_BINARY.items(), reverse=True):
-+ for minval, prefix in sorted(list(PREFIX_BINARY.items()), reverse=True):
- if (numeric/minval):
- return '%.2f%s' % (float(numeric)/float(minval), prefix)
- return '%dB' % numeric
-@@ -1683,20 +1683,20 @@ def parse_info(iterable):
- line = line.strip()
- if not line:
- continue
-- for key, regexp in HAPROXY_INFO_RE.iteritems():
-+ for key, regexp in HAPROXY_INFO_RE.items():
- match = regexp.match(line)
- if match:
- info[key] = match.group('value')
- break
-
-- for key in HAPROXY_INFO_RE.iterkeys():
-+ for key in HAPROXY_INFO_RE.keys():
- if not key in info:
- raise RuntimeError('missing "%s" in info data' % key)
-
- return info
-
- def get_idx(field):
-- return filter(lambda x: x[1][1] == field, HAPROXY_STAT_CSV)[0][0]
-+ return [x for x in HAPROXY_STAT_CSV if x[1][1] == field][0][0]
-
- def get_width(width, xmax, ncols, idx):
- # distribute excess space evenly from left to right
-@@ -1709,7 +1709,7 @@ def get_width(width, xmax, ncols, idx):
- if idx < (xdiff - (xdiff / ncols) * ncols):
- width += 1 # compensate rounding
- width = width + xdiff / ncols
-- return width
-+ return int(width)
-
- def get_cell(width, align, value):
- s = str(value)
-@@ -1732,7 +1732,7 @@ def get_head(mode):
- def get_screenlines(stat):
- screenlines = []
-
-- for iid, svstats in stat.iteritems():
-+ for iid, svstats in stat.items():
- lines = []
-
- try:
-@@ -1774,11 +1774,11 @@ def get_screenline(mode, stat):
- value = stat[column.name]
-
- for filter in column.filters['always']:
-- value = filter(value)
-+ value = list(filter(value))
-
- if len(str(value)) > column.width:
- for filter in column.filters['ondemand']:
-- value = filter(value)
-+ value = list(filter(value))
-
- value = str(value)
- value = trim(value, column.width)
-@@ -2099,7 +2099,7 @@ def mainloop(screen, interval):
- elif c == curses.KEY_UP:
- screen.cli.prev()
- elif c == curses.KEY_DOWN:
-- screen.cli.next()
-+ next(screen.cli)
-
- # output history
- elif c == curses.KEY_PPAGE:
-@@ -2202,21 +2202,21 @@ if __name__ == '__main__':
- break
- except KeyboardInterrupt:
- break
-- except CursesError, e:
-+ except CursesError as e:
- screen.reset()
- log('curses error: %s, restarting...' % e)
- time.sleep(1)
- screen.recover()
-
-- except ValueError, e:
-+ except ValueError as e:
- screen.reset()
- log('value error: %s' % e)
- sys.exit(1)
-- except RuntimeError, e:
-+ except RuntimeError as e:
- screen.reset()
- log('runtime error: %s' % e)
- sys.exit(1)
-- except SocketError, e:
-+ except SocketError as e:
- screen.reset()
- log('socket error: %s' % e)
- sys.exit(2)
diff --git a/sysutils/hatop/pkg-descr b/sysutils/hatop/pkg-descr
index 48baa58f50d7..446763e4b93d 100644
--- a/sysutils/hatop/pkg-descr
+++ b/sysutils/hatop/pkg-descr
@@ -9,4 +9,4 @@ instance (change server weight, put servers into maintenance mode,
etc.) directly out of hatop (using keybinds or the CLI) and monitor the
results immediately.
-WWW: http://feurix.org/projects/hatop/
+WWW: https://github.com/jhunt/hatop
More information about the dev-commits-ports-all
mailing list