Add pg 010103,an implementation of System V's pg pager.

PR:		24047
Submitted by:	George Reid <greid@ukug.uk.freebsd.org>
This commit is contained in:
Neil Blakey-Milner 2001-01-04 10:58:56 +00:00
parent 72fb4c7165
commit ef78bf56c7
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=36770
8 changed files with 130 additions and 0 deletions

View File

@ -115,6 +115,7 @@
SUBDIR += p5-Locale-Codes
SUBDIR += peq
SUBDIR += pdmenu
SUBDIR += pg
SUBDIR += pinfo
SUBDIR += pkg_tarup
SUBDIR += porteasy

19
misc/pg/Makefile Normal file
View File

@ -0,0 +1,19 @@
# New ports collection makefile for: pg
# Date created: 3 January 2001
# Whom: George Reid <greid@ukug.uk.freebsd.org>
#
# $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 <bsd.port.mk>

1
misc/pg/distinfo Normal file
View File

@ -0,0 +1 @@
MD5 (pg-010103.tar.gz) = 36f495569fd8987f5a85684b7bbe5637

15
misc/pg/files/patch-aa Normal file
View File

@ -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

84
misc/pg/files/patch-ab Normal file
View File

@ -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 <signal.h>
#include <setjmp.h>
#include <locale.h>
-#include <wctype.h>
-#include <wchar.h>
#ifndef sun
#include <curses.h>
#include <term.h>
@@ -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);

1
misc/pg/pkg-comment Normal file
View File

@ -0,0 +1 @@
An implementation of System V's pg pager

8
misc/pg/pkg-descr Normal file
View File

@ -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

1
misc/pg/pkg-plist Normal file
View File

@ -0,0 +1 @@
bin/pg