pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/misc/watch - merge patch-aa and patch-ab, they patched...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/35e8fab9a6ee
branches:  trunk
changeset: 538965:35e8fab9a6ee
user:      tnn <tnn%pkgsrc.org@localhost>
date:      Fri Feb 22 02:14:53 2008 +0000

description:
- merge patch-aa and patch-ab, they patched the same file.
- Uses asprintf and getopt_long
This closes PR pkg/38054.

diffstat:

 misc/watch/Makefile         |   5 +-
 misc/watch/distinfo         |   5 +-
 misc/watch/patches/patch-aa |  75 ++++++++++++++++++++++++++++++++++++--------
 misc/watch/patches/patch-ab |  48 ----------------------------
 4 files changed, 66 insertions(+), 67 deletions(-)

diffs (166 lines):

diff -r 873644f81675 -r 35e8fab9a6ee misc/watch/Makefile
--- a/misc/watch/Makefile       Fri Feb 22 01:27:55 2008 +0000
+++ b/misc/watch/Makefile       Fri Feb 22 02:14:53 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2006/10/25 21:37:51 rillig Exp $
+# $NetBSD: Makefile,v 1.10 2008/02/22 02:14:53 tnn Exp $
 
 DISTNAME=      procps-3.2.6
 PKGNAME=       watch-3.2.6
@@ -11,9 +11,10 @@
 
 MAKE_FILE=     ${FILESDIR}/Makefile
 MAKE_ENV+=     ${BSD_MAKE_ENV}
-MAKE_ENV+=     LIBS=${LIBS}
+MAKE_ENV+=     LIBS=${LIBS:Q}
 
 LIBS.SunOS+=   -lrt
+USE_FEATURES+= asprintf getopt_long
 
 .include "../../devel/ncurses/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r 873644f81675 -r 35e8fab9a6ee misc/watch/distinfo
--- a/misc/watch/distinfo       Fri Feb 22 01:27:55 2008 +0000
+++ b/misc/watch/distinfo       Fri Feb 22 02:14:53 2008 +0000
@@ -1,7 +1,6 @@
-$NetBSD: distinfo,v 1.6 2006/11/09 08:55:54 rillig Exp $
+$NetBSD: distinfo,v 1.7 2008/02/22 02:14:53 tnn Exp $
 
 SHA1 (procps-3.2.6.tar.gz) = 91f44180eb50a94eb945c2598c0e849879e65893
 RMD160 (procps-3.2.6.tar.gz) = f0b09701ce48d9f6db1cbb209b02ba026ee58d09
 Size (procps-3.2.6.tar.gz) = 279084 bytes
-SHA1 (patch-aa) = 953dcd9c3287fec91ac7c585ad9dff4b7ec50cf7
-SHA1 (patch-ab) = e8ffa2a42ba13442d01511525bb526f7702494d0
+SHA1 (patch-aa) = 597d173b7ba9862b617494da534d630f0b754bbf
diff -r 873644f81675 -r 35e8fab9a6ee misc/watch/patches/patch-aa
--- a/misc/watch/patches/patch-aa       Fri Feb 22 01:27:55 2008 +0000
+++ b/misc/watch/patches/patch-aa       Fri Feb 22 02:14:53 2008 +0000
@@ -1,15 +1,62 @@
-$NetBSD: patch-aa,v 1.3 2006/05/15 16:01:03 tron Exp $
+$NetBSD: patch-aa,v 1.4 2008/02/22 02:14:53 tnn Exp $
 
---- watch.c.orig       2005-10-30 00:44:53.000000000 +0100
-+++ watch.c    2006-05-15 16:49:04.000000000 +0100
-@@ -164,9 +164,7 @@
-                       break;
-               case 'n':
-                       {
--                              char *str;
--                              interval = strtof(optarg, &str);
--                              if (!*optarg || *str)
-+                              if (sscanf(optarg, "%f", &interval) != 1)
-                                       do_usage();
-                               if(interval < 0.1)
-                                       interval = 0.1;
+--- watch.c.orig       2008-02-22 03:05:28.000000000 +0100
++++ watch.c
+@@ -13,7 +13,13 @@
+ #define VERSION "0.2.0"
+ 
+ #include <ctype.h>
++#if defined(HAVE_NBCOMPAT_H)
++#include <nbcompat/config.h>
++#include <nbcompat/cdefs.h>
++#include <nbcompat/getopt.h>
++#else
+ #include <getopt.h>
++#endif
+ #include <signal.h>
+ #include <ncurses.h>
+ #include <stdio.h>
+@@ -142,6 +148,7 @@ main(int argc, char *argv[])
+           option_differences_cumulative = 0,
+           option_help = 0, option_version = 0;
+       float interval = 2;
++      struct timespec tsinterval;
+       char *command;
+       int command_length = 0; /* not including final \0 */
+ 
+@@ -199,6 +206,9 @@ main(int argc, char *argv[])
+       if (optind >= argc)
+               do_usage();
+ 
++      tsinterval.tv_sec = interval;
++      tsinterval.tv_nsec = (interval - tsinterval.tv_sec) * 1000000000L;
++
+       command = strdup(argv[optind++]);
+       command_length = strlen(command);
+       for (; optind < argc; optind++) {
+@@ -246,10 +256,16 @@ main(int argc, char *argv[])
+               }
+ 
+               if (show_title) {
++#if defined(__sun)
++                      header = malloc(width + 1);
++                      if (!header) { perror("malloc"); do_exit(2); }
++                      snprintf(header, width + 1, "Every %.1fs: %s", interval, command);
++#else
+                       // left justify interval and command,
+                       // right justify time, clipping all to fit window width
+                       asprintf(&header, "Every %.1fs: %.*s",
+                               interval, min(width - 1, command_length), command);
++#endif
+                       mvaddstr(0, 0, header);
+                       if (strlen(header) > (size_t) (width - tsl - 1))
+                               mvaddstr(0, width - tsl - 4, "...  ");
+@@ -313,7 +329,7 @@ main(int argc, char *argv[])
+ 
+               first_screen = 0;
+               refresh();
+-              usleep(interval * 1000000);
++              nanosleep(&tsinterval, NULL);
+       }
+ 
+       endwin();
diff -r 873644f81675 -r 35e8fab9a6ee misc/watch/patches/patch-ab
--- a/misc/watch/patches/patch-ab       Fri Feb 22 01:27:55 2008 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-$NetBSD: patch-ab,v 1.2 2006/10/25 21:37:51 rillig Exp $
-
---- watch.c.orig       2006-10-25 23:13:48.793523972 +0200
-+++ watch.c    2006-10-25 23:25:56.542821832 +0200
-@@ -142,6 +142,7 @@ main(int argc, char *argv[])
-           option_differences_cumulative = 0,
-           option_help = 0, option_version = 0;
-       float interval = 2;
-+      struct timespec tsinterval;
-       char *command;
-       int command_length = 0; /* not including final \0 */
- 
-@@ -199,6 +200,9 @@ main(int argc, char *argv[])
-       if (optind >= argc)
-               do_usage();
- 
-+      tsinterval.tv_sec = interval;
-+      tsinterval.tv_nsec = (interval - tsinterval.tv_sec) * 1000000000L;
-+
-       command = strdup(argv[optind++]);
-       command_length = strlen(command);
-       for (; optind < argc; optind++) {
-@@ -246,10 +250,16 @@ main(int argc, char *argv[])
-               }
- 
-               if (show_title) {
-+#if defined(__sun)
-+                      header = malloc(width + 1);
-+                      if (!header) { perror("malloc"); do_exit(2); }
-+                      snprintf(header, width + 1, "Every %.1fs: %s", interval, command);
-+#else
-                       // left justify interval and command,
-                       // right justify time, clipping all to fit window width
-                       asprintf(&header, "Every %.1fs: %.*s",
-                               interval, min(width - 1, command_length), command);
-+#endif
-                       mvaddstr(0, 0, header);
-                       if (strlen(header) > (size_t) (width - tsl - 1))
-                               mvaddstr(0, width - tsl - 4, "...  ");
-@@ -313,7 +323,7 @@ main(int argc, char *argv[])
- 
-               first_screen = 0;
-               refresh();
--              usleep(interval * 1000000);
-+              nanosleep(&tsinterval, NULL);
-       }
- 
-       endwin();



Home | Main Index | Thread Index | Old Index