pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/devel/kpty kpty: Fixes for non-openpty bitrotted code.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/334ffe447f20
branches:  trunk
changeset: 378942:334ffe447f20
user:      jperkin <jperkin%pkgsrc.org@localhost>
date:      Mon May 09 19:44:16 2022 +0000

description:
kpty: Fixes for non-openpty bitrotted code.

diffstat:

 devel/kpty/Makefile                      |  12 ++++-
 devel/kpty/PLIST                         |   3 +-
 devel/kpty/distinfo                      |   5 +-
 devel/kpty/patches/patch-src_kgrantpty.c |  15 ++++++
 devel/kpty/patches/patch-src_kpty.cpp    |  77 ++++++++++++++++++++++++++++++-
 5 files changed, 104 insertions(+), 8 deletions(-)

diffs (176 lines):

diff -r 17344d4ee553 -r 334ffe447f20 devel/kpty/Makefile
--- a/devel/kpty/Makefile       Mon May 09 17:07:19 2022 +0000
+++ b/devel/kpty/Makefile       Mon May 09 19:44:16 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.33 2022/04/25 04:55:47 markd Exp $
+# $NetBSD: Makefile,v 1.34 2022/05/09 19:44:16 jperkin Exp $
 
 DISTNAME=      kpty-${KF5VER}
 CATEGORIES=    devel
@@ -11,6 +11,16 @@
 
 USE_TOOLS+=    msgmerge
 
+CFLAGS.SunOS+= -D__EXTENSIONS__
+
+.include "../../mk/bsd.prefs.mk"
+
+PLIST_VARS+=   grantpty
+
+.if ${OPSYS} == "SunOS"
+PLIST.grantpty=        yes
+.endif
+
 .include "../../lang/python/tool.mk"
 .include "../../devel/kcoreaddons/buildlink3.mk"
 .include "../../devel/ki18n/buildlink3.mk"
diff -r 17344d4ee553 -r 334ffe447f20 devel/kpty/PLIST
--- a/devel/kpty/PLIST  Mon May 09 17:07:19 2022 +0000
+++ b/devel/kpty/PLIST  Mon May 09 19:44:16 2022 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.4 2022/04/25 04:55:47 markd Exp $
+@comment $NetBSD: PLIST,v 1.5 2022/05/09 19:44:16 jperkin Exp $
 include/KF5/KPty/KPty
 include/KF5/KPty/KPtyDevice
 include/KF5/KPty/KPtyProcess
@@ -14,6 +14,7 @@
 lib/libKF5Pty.so
 lib/libKF5Pty.so.5
 lib/libKF5Pty.so.${PKGVERSION}
+${PLIST.grantpty}libexec/kf5/kgrantpty
 qt5/mkspecs/modules/qt_KPty.pri
 share/locale/af/LC_MESSAGES/kpty5.mo
 share/locale/ar/LC_MESSAGES/kpty5.mo
diff -r 17344d4ee553 -r 334ffe447f20 devel/kpty/distinfo
--- a/devel/kpty/distinfo       Mon May 09 17:07:19 2022 +0000
+++ b/devel/kpty/distinfo       Mon May 09 19:44:16 2022 +0000
@@ -1,8 +1,9 @@
-$NetBSD: distinfo,v 1.14 2022/04/25 04:55:47 markd Exp $
+$NetBSD: distinfo,v 1.15 2022/05/09 19:44:16 jperkin Exp $
 
 BLAKE2s (kpty-5.93.0.tar.xz) = 8db60fd2b426ad20ccf7f15acbad24615f5f572f489ceb5472eefe2ddf92cbb4
 SHA512 (kpty-5.93.0.tar.xz) = 0d28e2a8bc3cee75f2ba00ddb63306152e166845c890b21ebf6eb10e7e9826de68c461a9c8492bf888e7f49aa41d1ccc635415e84b781b2e5bbd57bb77767d0d
 Size (kpty-5.93.0.tar.xz) = 59144 bytes
 SHA1 (patch-src_ConfigureCheck.cmake) = aa44e7b76545c450bc41265a8077877e9f69506b
-SHA1 (patch-src_kpty.cpp) = 88b3039792040cabb9c2d31b748f8b1b2efd87f6
+SHA1 (patch-src_kgrantpty.c) = 81787e45e3399871387d9f665b5430500bf96992
+SHA1 (patch-src_kpty.cpp) = da6e41dbfc4256e2474d144dc4b14aa32523e6b1
 SHA1 (patch-src_kptydevice.cpp) = 7c9dcf4ce662996286444c393a1f377bbbf88511
diff -r 17344d4ee553 -r 334ffe447f20 devel/kpty/patches/patch-src_kgrantpty.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/kpty/patches/patch-src_kgrantpty.c  Mon May 09 19:44:16 2022 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_kgrantpty.c,v 1.1 2022/05/09 19:44:16 jperkin Exp $
+
+Don't include C++ headers in a C file.
+
+--- src/kgrantpty.c.orig       2022-04-02 10:26:01.000000000 +0000
++++ src/kgrantpty.c
+@@ -27,7 +27,7 @@
+ 
+ #include <config-pty.h>
+ 
+-#include <cerrno>
++#include <errno.h>
+ #include <grp.h>
+ #include <stdio.h>
+ #include <stdlib.h>
diff -r 17344d4ee553 -r 334ffe447f20 devel/kpty/patches/patch-src_kpty.cpp
--- a/devel/kpty/patches/patch-src_kpty.cpp     Mon May 09 17:07:19 2022 +0000
+++ b/devel/kpty/patches/patch-src_kpty.cpp     Mon May 09 19:44:16 2022 +0000
@@ -1,10 +1,70 @@
-$NetBSD: patch-src_kpty.cpp,v 1.2 2021/03/30 10:58:23 markd Exp $
+$NetBSD: patch-src_kpty.cpp,v 1.3 2022/05/09 19:44:16 jperkin Exp $
 
 NetBSD loginx() complains if ut_type not set before calling
 
---- src/kpty.cpp.orig  2021-03-06 16:29:41.000000000 +0000
+--- src/kpty.cpp.orig  2022-04-02 10:26:01.000000000 +0000
 +++ src/kpty.cpp
-@@ -496,6 +496,9 @@ void KPty::login(const char *user, const
+@@ -10,6 +10,7 @@
+ 
+ #include "kpty_p.h"
+ 
++#include <QFile>
+ #include <QProcess>
+ #include <kpty_debug.h>
+ 
+@@ -168,7 +169,7 @@ KPtyPrivate::~KPtyPrivate()
+ bool KPtyPrivate::chownpty(bool grant)
+ {
+     return !QProcess::execute(QFile::decodeName(CMAKE_INSTALL_PREFIX "/" KDE_INSTALL_LIBEXECDIR_KF "/kgrantpty"),
+-                              QStringList() << (grant ? "--grant" : "--revoke") << QString::number(masterFd));
++                              QStringList() << (grant ? QStringLiteral("--grant") : QStringLiteral("--revoke")) << QString::number(masterFd));
+ }
+ #endif
+ 
+@@ -260,6 +261,7 @@ bool KPty::open()
+     }
+ #endif // HAVE_PTSNAME || TIOCGPTN
+ 
++#if 0
+     // Linux device names, FIXME: Trouble on other systems?
+     for (const char *s3 = "pqrstuvwxyzabcde"; *s3; s3++) {
+         for (const char *s4 = "0123456789abcdef"; *s4; s4++) {
+@@ -289,8 +291,10 @@ bool KPty::open()
+ 
+     qCWarning(KPTY_LOG) << "Can't open a pseudo teletype";
+     return false;
++#endif
+ 
+ gotpty:
++#if 0
+     QFileInfo info(d->ttyName.data());
+     if (!info.exists()) {
+         return false; // this just cannot happen ... *cough*  Yeah right, I just
+@@ -302,14 +306,15 @@ gotpty:
+         && !d->chownpty(true)) {
+         qCWarning(KPTY_LOG) << "chownpty failed for device " << ptyName << "::" << d->ttyName << "\nThis means the communication can be eavesdropped." << endl;
+     }
++#endif
+ 
+ grantedpt:
+ 
+-#ifdef HAVE_REVOKE
++#if HAVE_REVOKE
+     revoke(d->ttyName.data());
+ #endif
+ 
+-#ifdef HAVE_UNLOCKPT
++#if HAVE_UNLOCKPT
+     unlockpt(d->masterFd);
+ #elif defined(TIOCSPTLCK)
+     int flag = 0;
+@@ -502,11 +507,14 @@ void KPty::login(const char *user, const
+ #endif
+ 
+ #if HAVE_UTMPX
+-    gettimeofday(&l_struct.ut_tv, 0);
++    gettimeofday(&l_struct.ut_tv, nullptr);
+ #else
      l_struct.ut_time = time(0);
  #endif
  
@@ -14,7 +74,7 @@
  #if HAVE_LOGIN
  #if HAVE_LOGINX
      ::loginx(&l_struct);
-@@ -503,9 +506,6 @@ void KPty::login(const char *user, const
+@@ -514,9 +522,6 @@ void KPty::login(const char *user, const
      ::login(&l_struct);
  #endif
  #else
@@ -24,3 +84,12 @@
  #if HAVE_STRUCT_UTMP_UT_PID
      l_struct.ut_pid = getpid();
  #if HAVE_STRUCT_UTMP_UT_SESSION
+@@ -605,7 +610,7 @@ void KPty::logout()
+         ut->ut_type = DEAD_PROCESS;
+ #endif
+ #if HAVE_UTMPX
+-        gettimeofday(&(ut->ut_tv), 0);
++        gettimeofday(&(ut->ut_tv), nullptr);
+         pututxline(ut);
+     }
+     endutxent();



Home | Main Index | Thread Index | Old Index