[minicom] - update to new upstream version - remove patches merged by upstream - update rh patch to support un

Jan Görig jgorig at fedoraproject.org
Mon Jan 31 09:47:09 UTC 2011


commit 67ec19fdb22c6f155007daa62d4a5d75f06c55c1
Author: Jan Görig <jgorig at redhat.com>
Date:   Mon Jan 31 10:45:30 2011 +0100

    - update to new upstream version
    - remove patches merged by upstream
    - update rh patch to support unix socket (#592355)

 .gitignore                     |    1 +
 minicom-2.2-spaces.patch       |   45 --------
 minicom-2.3-gotodir.patch      |   65 ------------
 minicom-2.4-config-parse.patch |   12 --
 minicom-2.4-config.patch       |   16 ---
 minicom-2.4-esc.patch          |   12 --
 minicom-2.4-man-typo.patch     |   21 ----
 minicom-2.4-rh.patch           |  113 ---------------------
 minicom-2.4-staticbuf.patch    |  217 ----------------------------------------
 minicom-2.4-umask.patch        |   12 --
 minicom-2.5-rh.patch           |  159 +++++++++++++++++++++++++++++
 minicom.spec                   |   31 ++----
 sources                        |    2 +-
 13 files changed, 171 insertions(+), 535 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 3f12e06..6014faf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 minicom-2.4.tar.gz
+/minicom-2.5.tar.gz
diff --git a/minicom-2.5-rh.patch b/minicom-2.5-rh.patch
new file mode 100644
index 0000000..474b842
--- /dev/null
+++ b/minicom-2.5-rh.patch
@@ -0,0 +1,159 @@
+diff --git a/src/main.c b/src/main.c
+index bc4db89..8e68e2c 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -154,16 +154,22 @@ void term_socket_close(void)
+ int open_term(int doinit, int show_win_on_error, int no_msgs)
+ {
+   struct stat stt;
++#ifdef NOTNOW
+   union {
+ 	char bytes[128];
+ 	int kermit;
+   } buf;
+-  int fd, n = 0;
++  int fd;
+   int pid;
++#endif
++  int rc;
++  int n = 0;
+ #ifdef HAVE_ERRNO_H
+   int s_errno;
+ #endif
+ 
++#ifdef NOTNOW
++
+   /* First see if the lock file directory is present. */
+   if (P_LOCK[0] && stat(P_LOCK, &stt) == 0) {
+ 
+@@ -215,6 +221,44 @@ int open_term(int doinit, int show_win_on_error, int no_msgs)
+   if (doinit > 0)
+     lockfile_create();
+ 
++#else
++  lockfile[0] = 0;
++  if (doinit > 0) {
++#ifdef USE_SOCKET
++    if (strncmp(dial_tty, SOCKET_PREFIX, strlen(SOCKET_PREFIX)) == 0) {
++      if (stat(dial_tty+strlen(SOCKET_PREFIX), &stt) == 0 &&
++         S_ISSOCK(stt.st_mode)) {
++        rc = 0;
++      } else {
++        rc = 1;
++        fprintf(stderr, _("File %s is not a socket.\n"),
++                dial_tty+strlen(SOCKET_PREFIX));
++      }
++    } else {
++#endif
++      rc = ttylock(dial_tty);
++      if (rc < 0) {
++        if (access(dial_tty, W_OK) == -1)
++          fprintf(stderr, _("Device %s access failed: %s.\n"),
++                  dial_tty, strerror(errno));
++        else
++          fprintf(stderr, _("Device %s lock failed: %s.\n"),
++                  dial_tty, strerror(-rc));
++      } else if (rc > 0) {
++        fprintf(stderr, _("Device %s is locked.\n"), dial_tty);
++      }
++#ifdef USE_SOCKET
++    }
++#endif
++    if (rc == 0) {
++      snprintf(lockfile, sizeof(lockfile), "%s", dial_tty);
++    } else {
++      if (stdwin) mc_wclose(stdwin, 1);
++      return(-1);
++    }
++  }
++#endif
++
+   /* Run a special program to disable callin if needed. */
+     if (doinit > 0 && P_CALLOUT[0]) {
+       if (fastsystem(P_CALLOUT, NULL, NULL, NULL) < 0) {
+@@ -232,7 +276,6 @@ int open_term(int doinit, int show_win_on_error, int no_msgs)
+     signal(SIGALRM, get_alrm);
+     alarm(4);
+ #ifdef USE_SOCKET
+-#define SOCKET_PREFIX "unix#"
+     portfd_is_socket = portfd_is_connected = 0;
+     if (strncmp(dial_tty, SOCKET_PREFIX, strlen(SOCKET_PREFIX)) == 0) {
+       portfd_is_socket = 1;
+diff --git a/src/minicom.c b/src/minicom.c
+index 7780ff7..8b26f0d 100644
+--- a/src/minicom.c
++++ b/src/minicom.c
+@@ -1569,8 +1569,7 @@ dirty_goto:
+   mc_wclose(st, 0);
+   mc_wclose(stdwin, 1);
+   keyboard(KUNINSTALL, 0);
+-  if (lockfile[0])
+-    unlink(lockfile);
++  lockfile_remove();
+   close(portfd);
+ 
+   if (quit != NORESET && P_CALLIN[0])
+diff --git a/src/minicom.h b/src/minicom.h
+index 309d54a..83f3fca 100644
+--- a/src/minicom.h
++++ b/src/minicom.h
+@@ -34,10 +34,14 @@
+ #include "libport.h"
+ 
+ #include <time.h>
++#include <limits.h>
++#include <baudboy.h>
+ 
+ #ifdef USE_SOCKET
+ #include <sys/socket.h>
+ #include <sys/un.h>
++
++#define SOCKET_PREFIX "unix#"
+ #endif
+ 
+ /*
+@@ -82,7 +86,7 @@ EXTERN int tempst;	/* Status line is temporary */
+ EXTERN int escape;	/* Escape code. */
+ EXTERN int disable_online_time; /* disable online time display */
+ 
+-EXTERN char lockfile[128]; /* UUCP lock file of terminal */
++EXTERN char lockfile[PATH_MAX]; /* UUCP lock file of terminal */
+ EXTERN char homedir[256];  /* Home directory of user */
+ EXTERN char logfname[PARS_VAL_LEN]; /* Name of the logfile */
+ EXTERN char username[16];  /* Who is using minicom? */
+diff --git a/src/updown.c b/src/updown.c
+index 24531a2..23194e4 100644
+--- a/src/updown.c
++++ b/src/updown.c
+@@ -441,12 +441,14 @@ void updown(int what, int nr)
+ 
+ void lockfile_remove(void)
+ {
+-  if (lockfile[0])
+-    unlink(lockfile);
++  if (lockfile[0] && strncmp(dial_tty, SOCKET_PREFIX, strlen(SOCKET_PREFIX)) != 0)
++    ttyunlock(lockfile);
+ }
+ 
+ void lockfile_create(void)
+ {
++  int rc;
++#ifdef NOTNOW
+   int fd, n;
+ 
+   if (!lockfile[0])
+@@ -468,6 +470,14 @@ void lockfile_create(void)
+     close(fd);
+   }
+   umask(n);
++#else
++  if (strncmp(dial_tty, SOCKET_PREFIX, strlen(SOCKET_PREFIX)) != 0) {
++    rc = ttylock(lockfile);
++    if (rc) {
++      werror(_("Cannot lock device!"));
++    }
++  }
++#endif
+ }
+ 
+ /*
diff --git a/minicom.spec b/minicom.spec
index ea1b039..7bf013f 100644
--- a/minicom.spec
+++ b/minicom.spec
@@ -1,7 +1,7 @@
 Summary: A text-based modem control and terminal emulation program
 Name: minicom
-Version: 2.4
-Release: 2%{?dist}
+Version: 2.5
+Release: 1%{?dist}
 URL: http://alioth.debian.org/projects/minicom/
 License: GPLv2+
 Group: Applications/Communications
@@ -10,17 +10,9 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: lockdev-devel ncurses-devel
 Requires: lockdev lrzsz
 
-Source0: http://alioth.debian.org/frs/download.php/3195/minicom-2.4.tar.gz
+Source0: http://alioth.debian.org/frs/download.php/3487/minicom-2.5.tar.gz
 
-Patch1: minicom-2.4-umask.patch
-Patch2: minicom-2.2-spaces.patch
-Patch3: minicom-2.3-gotodir.patch
-Patch4: minicom-2.4-rh.patch
-Patch5: minicom-2.4-esc.patch
-Patch6: minicom-2.4-staticbuf.patch
-Patch7: minicom-2.4-config.patch
-Patch8: minicom-2.4-config-parse.patch
-Patch9: minicom-2.4-man-typo.patch
+Patch1: minicom-2.5-rh.patch
 
 %description
 Minicom is a simple text-based modem control and terminal emulation
@@ -30,15 +22,7 @@ language, and other features.
 
 %prep
 %setup -q
-%patch1 -p1 -b .umask
-%patch2 -p1 -b .spaces
-%patch3 -p1 -b .gotodir
-%patch4 -p1 -b .rh
-%patch5 -p1 -b .esc
-%patch6 -p1 -b .staticbuf
-%patch7 -p1 -b .config
-%patch8 -p1 -b .config-parse
-%patch9 -p1 -b .man
+%patch1 -p1 -b .rh
 
 cp -pr doc doc_
 rm -f doc_/Makefile*
@@ -68,6 +52,11 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man1/*
 
 %changelog
+* Mon Jan 31 2011 Jan Görig <jgorig at redhat.com> 2.5-1
+- update to new upstream version
+- remove patches merged by upstream
+- update rh patch to support unix socket (#592355)
+
 * Fri Jan 14 2011 Jan Görig <jgorig at redhat.com> 2.4-2
 - fixed typos in ascii-xfr manpage (#669098)
 - fixed empty lines handling in configuration file (#669406)
diff --git a/sources b/sources
index da43475..d8d81ea 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-700976a3c2dcc8bbd50ab9bb1c08837b  minicom-2.4.tar.gz
+a5117d4d21e2c9e825edb586ee2fe8d2  minicom-2.5.tar.gz


More information about the scm-commits mailing list