pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/misc/tmux tmux: Add support for pane_current_path vari...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/62526b18ca22
branches:  trunk
changeset: 315692:62526b18ca22
user:      leot <leot%pkgsrc.org@localhost>
date:      Wed Nov 28 14:45:19 2018 +0000

description:
tmux: Add support for pane_current_path variable in NetBSD

Implement osdep_get_cwd() by using mount_procfs(8) in order to add
support for pane_current_path variable in NetBSD.

Bump PKGREVISION

diffstat:

 misc/tmux/Makefile                     |   3 +-
 misc/tmux/distinfo                     |   3 +-
 misc/tmux/patches/patch-osdep-netbsd.c |  43 ++++++++++++++++++++++++++++++++++
 3 files changed, 47 insertions(+), 2 deletions(-)

diffs (73 lines):

diff -r efeac529ab32 -r 62526b18ca22 misc/tmux/Makefile
--- a/misc/tmux/Makefile        Wed Nov 28 14:43:23 2018 +0000
+++ b/misc/tmux/Makefile        Wed Nov 28 14:45:19 2018 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.46 2018/10/21 21:22:47 leot Exp $
+# $NetBSD: Makefile,v 1.47 2018/11/28 14:45:19 leot Exp $
 
 DISTNAME=      tmux-2.8
+PKGREVISION=   1
 CATEGORIES=    misc
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=tmux/}
 GITHUB_RELEASE=        ${PKGVERSION_NOREV}
diff -r efeac529ab32 -r 62526b18ca22 misc/tmux/distinfo
--- a/misc/tmux/distinfo        Wed Nov 28 14:43:23 2018 +0000
+++ b/misc/tmux/distinfo        Wed Nov 28 14:45:19 2018 +0000
@@ -1,8 +1,9 @@
-$NetBSD: distinfo,v 1.37 2018/10/21 21:22:47 leot Exp $
+$NetBSD: distinfo,v 1.38 2018/11/28 14:45:19 leot Exp $
 
 SHA1 (tmux-2.8.tar.gz) = 6a469769a242c95dc8aec443b436d4f8f279f517
 RMD160 (tmux-2.8.tar.gz) = 13f097f02b2d3f489fb00af5b3f702cb2eae523f
 SHA512 (tmux-2.8.tar.gz) = e382aec122a10624953432b3c869b21d69390bc2e7d459440a46950802e39503eafb398178f8085191261925e4f0872bb99b19e0403e7beb56d3ceecc4c86b09
 Size (tmux-2.8.tar.gz) = 491195 bytes
 SHA1 (patch-Makefile.in) = dc8a351b06bf2f9f96b3dc4d944a174ef3c8d9db
+SHA1 (patch-osdep-netbsd.c) = 81d0bf9275c0c12d4f0f2adc07136e3d8948137d
 SHA1 (patch-tty-term.c) = 20bf235e61e6650bec3e7e94ea79859898039eba
diff -r efeac529ab32 -r 62526b18ca22 misc/tmux/patches/patch-osdep-netbsd.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/tmux/patches/patch-osdep-netbsd.c    Wed Nov 28 14:45:19 2018 +0000
@@ -0,0 +1,43 @@
+$NetBSD: patch-osdep-netbsd.c,v 1.1 2018/11/28 14:45:19 leot Exp $
+
+Implement osdep_get_cwd() via mount_procfs(8) (inspired by osdep-sunos.c).
+
+--- osdep-netbsd.c.orig        2016-01-21 00:00:28.000000000 +0000
++++ osdep-netbsd.c
+@@ -23,10 +23,13 @@
+ 
+ #include <errno.h>
+ #include <event.h>
++#include <limits.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+ 
++#include "tmux.h"
++
+ #define is_runnable(p) \
+         ((p)->p_stat == LSRUN || (p)->p_stat == SIDL)
+ #define is_stopped(p) \
+@@ -127,6 +130,22 @@ error:
+ char *
+ osdep_get_cwd(int fd)
+ {
++      static char     target[PATH_MAX + 1];
++      char            *path;
++      pid_t           pgrp;
++      ssize_t         n;
++
++      if ((pgrp = tcgetpgrp(fd)) == -1)
++              return (NULL);
++
++      xasprintf(&path, "/proc/%lld/cwd", (long long) pgrp);
++      n = readlink(path, target, sizeof(target) - 1);
++      free(path);
++      if (n > 0) {
++              target[n] = '\0';
++              return (target);
++      }
++
+       return (NULL);
+ }
+ 



Home | Main Index | Thread Index | Old Index