From ef78bf56c7db44ad94b52362571c2822119a9250 Mon Sep 17 00:00:00 2001 From: Neil Blakey-Milner Date: Thu, 4 Jan 2001 10:58:56 +0000 Subject: [PATCH] Add pg 010103,an implementation of System V's pg pager. PR: 24047 Submitted by: George Reid --- misc/Makefile | 1 + misc/pg/Makefile | 19 ++++++++++ misc/pg/distinfo | 1 + misc/pg/files/patch-aa | 15 ++++++++ misc/pg/files/patch-ab | 84 ++++++++++++++++++++++++++++++++++++++++++ misc/pg/pkg-comment | 1 + misc/pg/pkg-descr | 8 ++++ misc/pg/pkg-plist | 1 + 8 files changed, 130 insertions(+) create mode 100644 misc/pg/Makefile create mode 100644 misc/pg/distinfo create mode 100644 misc/pg/files/patch-aa create mode 100644 misc/pg/files/patch-ab create mode 100644 misc/pg/pkg-comment create mode 100644 misc/pg/pkg-descr create mode 100644 misc/pg/pkg-plist diff --git a/misc/Makefile b/misc/Makefile index 12e7fba6b8a8..5862ae1107fb 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -115,6 +115,7 @@ SUBDIR += p5-Locale-Codes SUBDIR += peq SUBDIR += pdmenu + SUBDIR += pg SUBDIR += pinfo SUBDIR += pkg_tarup SUBDIR += porteasy diff --git a/misc/pg/Makefile b/misc/pg/Makefile new file mode 100644 index 000000000000..35030fae3023 --- /dev/null +++ b/misc/pg/Makefile @@ -0,0 +1,19 @@ +# New ports collection makefile for: pg +# Date created: 3 January 2001 +# Whom: George Reid +# +# $FreeBSD$ +# + +PORTNAME= pg +PORTVERSION= 010103 +CATEGORIES= misc +MASTER_SITES= http://omnibus.ruf.uni-freiburg.de/~gritter/archive/ + +MAINTAINER= greid@ukug.uk.freebsd.org + +MAKEFILE= makefile + +MAN1= pg.1 + +.include diff --git a/misc/pg/distinfo b/misc/pg/distinfo new file mode 100644 index 000000000000..7832c3b3c538 --- /dev/null +++ b/misc/pg/distinfo @@ -0,0 +1 @@ +MD5 (pg-010103.tar.gz) = 36f495569fd8987f5a85684b7bbe5637 diff --git a/misc/pg/files/patch-aa b/misc/pg/files/patch-aa new file mode 100644 index 000000000000..2ff51df239c7 --- /dev/null +++ b/misc/pg/files/patch-aa @@ -0,0 +1,15 @@ +--- makefile.orig Wed Jan 3 05:06:51 2001 ++++ makefile Wed Jan 3 13:37:36 2001 +@@ -3,11 +3,10 @@ + # CONFIGURATION + + #WARN = -Wall -Wno-parentheses -Wno-implicit-int -Wshadow +-PREFIX = /usr/local + BINDIR = $(PREFIX)/bin + MANDIR = $(PREFIX)/man + MANSECT = $(MANDIR)/man1 +-INSTALL = /usr/ucb/install ++INSTALL = /usr/bin/install + # For Linux, enable both of the following flags. + # For Solaris 8, disable SUSF (other versions untested). + SUSF = -D_XOPEN_SOURCE=500L diff --git a/misc/pg/files/patch-ab b/misc/pg/files/patch-ab new file mode 100644 index 000000000000..07fbfb88250e --- /dev/null +++ b/misc/pg/files/patch-ab @@ -0,0 +1,84 @@ +--- pg.c.orig Wed Jan 3 13:29:40 2001 ++++ pg.c Wed Jan 3 13:34:48 2001 +@@ -59,8 +59,6 @@ + #include + #include + #include +-#include +-#include + #ifndef sun + #include + #include +@@ -786,7 +784,7 @@ + if ((wl = xmbstowcs(wbuf, t, sizeof wbuf)) == -1) + return; + while (wl--) { +- if (!iswprint(*wp) && *wp != L'\n' && *wp != L'\r' ++ if (!isprint(*wp) && *wp != L'\n' && *wp != L'\r' + && *wp != L'\b' && *wp != L'\t') + *wp = L'?'; + wp++; +@@ -988,7 +986,6 @@ + * We got a signal. + */ + canjump = 0; +- sigrelse(sig); + fseeko(fbuf, pos, SEEK_SET); + *b = '\0'; + dline = pagelen; +@@ -1086,7 +1083,6 @@ + * We got a signal. + */ + canjump = 0; +- sigrelse(sig); + dline = pagelen; + } else { + p = endline(ttycols, b); +@@ -1386,8 +1382,8 @@ + write(STDOUT_FILENO, cmd.cmdline, + strlen(cmd.cmdline)); + write(STDOUT_FILENO, "\n", 1); +- sigset(SIGINT, SIG_IGN); +- sigset(SIGQUIT, SIG_IGN); ++ signal(SIGINT, SIG_IGN); ++ signal(SIGQUIT, SIG_IGN); + switch (cpid = fork()) { + case 0: + p = getenv("SHELL"); +@@ -1402,9 +1398,9 @@ + } else { + fclose(f); + } +- sigset(SIGINT, oldint); +- sigset(SIGQUIT, oldquit); +- sigset(SIGTERM, oldterm); ++ signal(SIGINT, oldint); ++ signal(SIGQUIT, oldquit); ++ signal(SIGTERM, oldterm); + execl(p, p, "-c", + cmd.cmdline + 1, NULL); + eof = errno; +@@ -1420,8 +1416,8 @@ + default: + while (wait(NULL) != cpid); + } +- sigset(SIGINT, sighandler); +- sigset(SIGQUIT, sighandler); ++ signal(SIGINT, sighandler); ++ signal(SIGQUIT, sighandler); + mesg("!\n"); + } + goto newcmd; +@@ -1504,9 +1500,9 @@ + progname = argv[0]; + if (tcgetattr(STDOUT_FILENO, &otio) == 0) { + ontty = 1; +- oldint = sigset(SIGINT, sighandler); +- oldquit = sigset(SIGQUIT, sighandler); +- oldterm = sigset(SIGTERM, sighandler); ++ oldint = signal(SIGINT, sighandler); ++ oldquit = signal(SIGQUIT, sighandler); ++ oldterm = signal(SIGTERM, sighandler); + setlocale(LC_CTYPE, ""); + setlocale(LC_COLLATE, ""); + tty = ttyname(STDOUT_FILENO); diff --git a/misc/pg/pkg-comment b/misc/pg/pkg-comment new file mode 100644 index 000000000000..5d08c7b1ed12 --- /dev/null +++ b/misc/pg/pkg-comment @@ -0,0 +1 @@ +An implementation of System V's pg pager diff --git a/misc/pg/pkg-descr b/misc/pg/pkg-descr new file mode 100644 index 000000000000..fc1bff126ac6 --- /dev/null +++ b/misc/pg/pkg-descr @@ -0,0 +1,8 @@ +The pg command originates from System V and is a text file browser, +like more. It lets the user scroll forward and backward even if input +comes from a pipe. This free clone is intended to comply to the SVID 4 +and SUSv2 specifications of this utility; it can handle large files as +well as files that contain multibyte characters. + +- George Reid +greid@ukug.uk.freebsd.org diff --git a/misc/pg/pkg-plist b/misc/pg/pkg-plist new file mode 100644 index 000000000000..fe05e6ba1359 --- /dev/null +++ b/misc/pg/pkg-plist @@ -0,0 +1 @@ +bin/pg