Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Dec 2013 19:36:38 +0000 (UTC)
From:      Boris Samorodov <bsam@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r336211 - in head/print/mpage: . files
Message-ID:  <201312111936.rBBJacvV016973@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bsam
Date: Wed Dec 11 19:36:37 2013
New Revision: 336211
URL: http://svnweb.freebsd.org/changeset/ports/336211

Log:
  . support staging;
  . remove .if and .for loops at post-install target;
  . unmute INSTALL_DATA command;
  . gave patches more apropriate names.

Added:
  head/print/mpage/files/patch-Makefile
     - copied, changed from r335904, head/print/mpage/files/patch-aa
  head/print/mpage/files/patch-args.c
     - copied unchanged from r335904, head/print/mpage/files/patch-args_c
  head/print/mpage/files/patch-mpage.1.in
     - copied unchanged from r335904, head/print/mpage/files/patch-mpage_1_in
  head/print/mpage/files/patch-mpage.c
     - copied unchanged from r335904, head/print/mpage/files/patch-mpage_c
  head/print/mpage/files/patch-post.c
     - copied unchanged from r335904, head/print/mpage/files/patch-post_c
Deleted:
  head/print/mpage/files/patch-aa
  head/print/mpage/files/patch-args_c
  head/print/mpage/files/patch-mpage_1_in
  head/print/mpage/files/patch-mpage_c
  head/print/mpage/files/patch-post_c
Modified:
  head/print/mpage/Makefile

Modified: head/print/mpage/Makefile
==============================================================================
--- head/print/mpage/Makefile	Wed Dec 11 19:35:22 2013	(r336210)
+++ head/print/mpage/Makefile	Wed Dec 11 19:36:37 2013	(r336211)
@@ -16,21 +16,16 @@ COMMENT=	Print multiple pages per sheet 
 
 ALL_TARGET=	default
 
-MAN1=		mpage.1
 PORTDOCS=	CHANGES Characters Copyright Encoding.format FAQ NEWS \
 		README README.OS2 README.amiga SCOPTIONS TODO
 PLIST_FILES=	bin/mpage %%DATADIR%%/CP850.PC %%DATADIR%%/ISO+STD+OTH \
 		%%DATADIR%%/ISO-8859.1 %%DATADIR%%/ISO-8859.15 \
-		%%DATADIR%%/ISO-Latin.1 %%DATADIR%%/ISO-Latin.2
+		%%DATADIR%%/ISO-Latin.1 %%DATADIR%%/ISO-Latin.2 \
+		man/man1/mpage.1.gz
 PLIST_DIRS=	%%DATADIR%%
 
-NO_STAGE=	yes
 post-install:
-.if !defined(NOPORTDOCS)
-	@${MKDIR} ${DOCSDIR}
-.for FILE in ${PORTDOCS}
-	@${INSTALL_DATA} ${WRKSRC}/${FILE} ${DOCSDIR}
-.endfor
-.endif
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}
 
 .include <bsd.port.mk>

Copied and modified: head/print/mpage/files/patch-Makefile (from r335904, head/print/mpage/files/patch-aa)
==============================================================================
--- head/print/mpage/files/patch-aa	Sun Dec  8 15:16:47 2013	(r335904, copy source)
+++ head/print/mpage/files/patch-Makefile	Wed Dec 11 19:36:37 2013	(r336211)
@@ -1,5 +1,5 @@
---- Makefile.orig	Mon Oct 21 03:46:44 2002
-+++ Makefile	Sat Nov  2 16:41:52 2002
+--- Makefile.orig	2004-05-31 00:38:31.000000000 +0500
++++ Makefile	2013-12-11 23:08:46.646822192 +0400
 @@ -24,7 +24,6 @@
  # Set this to an ANSI compatible C compiler (preferably gcc)
  # See also system specific settings below
@@ -8,7 +8,7 @@
  
  ############################################################################
  #
-@@ -40,7 +39,7 @@
+@@ -40,7 +39,7 @@ CC=gcc
  #  See glob.c for all possibilities
  #
  # PAGESIZE=Letter
@@ -17,15 +17,22 @@
  
  #
  # Define your spooler type
-@@ -50,7 +49,6 @@
+@@ -50,11 +49,10 @@ PAGESIZE=A4
  SPOOL_TYPE=BSD_SPOOLER
  
  # PREFIX=e:/usr		# OS/2 type
 -PREFIX=/usr/local
  #PREFIX=/usr
- BINDIR=$(PREFIX)/bin
- LIBDIR=$(PREFIX)/share
-@@ -106,8 +104,11 @@
+-BINDIR=$(PREFIX)/bin
+-LIBDIR=$(PREFIX)/share
+-MANDIR=$(PREFIX)/man/man1
++BINDIR=${DESTDIR}$(PREFIX)/bin
++LIBDIR=${DESTDIR}$(PREFIX)/share
++MANDIR=${DESTDIR}$(PREFIX)/man/man1
+ 
+ #
+ # A default encoding is given in encoding.h. Setting ENCODING=1 will
+@@ -106,8 +104,11 @@ O = .o
  # Choose one of the following CFLAGS/CC definitions:
  # If you are using gcc, you probably don't need to change anything here.
  
@@ -38,7 +45,7 @@
  
  # AIX (xlC on aix 4):
  #CFLAGS = -O2 -s $(DEFS)
-@@ -177,7 +178,6 @@
+@@ -181,7 +182,6 @@ install:
  	if [ ! -d $(LIBDIR)/mpage ] ; then mkdir -p $(LIBDIR)/mpage ; fi
  	if [ ! -d $(BINDIR) ] ; then mkdir -p $(BINDIR) ; fi
  	if [ ! -d $(MANDIR) ] ; then mkdir -p $(MANDIR) ; fi

Copied: head/print/mpage/files/patch-args.c (from r335904, head/print/mpage/files/patch-args_c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/print/mpage/files/patch-args.c	Wed Dec 11 19:36:37 2013	(r336211, copy of r335904, head/print/mpage/files/patch-args_c)
@@ -0,0 +1,35 @@
+$OpenBSD: patch-args_c,v 1.3 2002/11/13 17:15:49 naddy Exp $
+--- args.c.orig	Thu Oct 17 07:22:48 2002
++++ args.c	Mon Nov 11 05:43:01 2002
+@@ -35,6 +35,7 @@ do_args(int argc, char **argv, int envfl
+     int consumed;
+     int currarg;
+     int opterrors;
++    size_t len;
+ 
+     int i;
+ 
+@@ -142,18 +143,17 @@ do_args(int argc, char **argv, int envfl
+                         break;
+                 case 'C':    /* select character definitions */
+                         consumed = 1;
++                        len = (strlen(libdir) + strlen(optstr) + 2);
+                         if (*++optstr) { /* did we get a encoding name ? */
+-                            if ((charvec_file = (char *) malloc(strlen(libdir) +
+-                                                                strlen(optstr) +
+-                                                                2)) == NULL) {
++                            if ((charvec_file = (char *) malloc(len)) == NULL) {
+                                 perror(optstr);
+                                 fprintf(stderr,
+                                     "ignoring character encoding definition\n");
+                             }
+                             else {
+-                                (void) strcpy(charvec_file, libdir);
+-                                (void) strcat(charvec_file, "/");
+-                                (void) strcat(charvec_file, optstr);
++                                (void) strlcpy(charvec_file, libdir, len);
++                                (void) strlcat(charvec_file, "/", len);
++                                (void) strlcat(charvec_file, optstr, len);
+                                 opt_encoding = 1;
+                             }
+                         }

Copied: head/print/mpage/files/patch-mpage.1.in (from r335904, head/print/mpage/files/patch-mpage_1_in)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/print/mpage/files/patch-mpage.1.in	Wed Dec 11 19:36:37 2013	(r336211, copy of r335904, head/print/mpage/files/patch-mpage_1_in)
@@ -0,0 +1,12 @@
+$OpenBSD: patch-mpage_1_in,v 1.2 2002/11/13 17:20:42 naddy Exp $
+--- mpage.1.in.orig	Sun Oct 20 20:50:58 2002
++++ mpage.1.in	Wed Nov 13 18:19:15 2002
+@@ -539,7 +539,7 @@ and 
+ environment variables.
+ 
+ .SH FILES
+-/usr/tmp/mpageXXXXXX
++/tmp/mpageXXXXXX
+ .br
+ PREFIX/share/mpage
+ 

Copied: head/print/mpage/files/patch-mpage.c (from r335904, head/print/mpage/files/patch-mpage_c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/print/mpage/files/patch-mpage.c	Wed Dec 11 19:36:37 2013	(r336211, copy of r335904, head/print/mpage/files/patch-mpage_c)
@@ -0,0 +1,16 @@
+$OpenBSD: patch-mpage_c,v 1.1 2002/07/07 17:03:37 naddy Exp $
+--- mpage.c.orig	Tue Nov 13 18:04:46 2001
++++ mpage.c	Sun May 19 01:00:14 2002
+@@ -74,10 +74,10 @@ char **argv;
+      */
+     if (doprint) {
+         if (printque != NULL)
+-            (void) sprintf(outcommand, "%s %s%s",
++            (void) snprintf(outcommand, sizeof(outcommand), "%s %s%s",
+                            printprog, printarg, printque);
+         else
+-            (void) strcpy(outcommand, printprog);
++            (void) strlcpy(outcommand, printprog, sizeof(outcommand));
+         if ((outfd = popen(outcommand, "w")) == NULL) {
+             fprintf(stderr, "%s: cannot create pipe for '%s'\n",
+                             MPAGE, outcommand);

Copied: head/print/mpage/files/patch-post.c (from r335904, head/print/mpage/files/patch-post_c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/print/mpage/files/patch-post.c	Wed Dec 11 19:36:37 2013	(r336211, copy of r335904, head/print/mpage/files/patch-post_c)
@@ -0,0 +1,73 @@
+$OpenBSD: patch-post_c,v 1.2 2002/11/13 17:15:49 naddy Exp $
+--- post.c.orig	Wed Oct 16 23:45:54 2002
++++ post.c	Wed Nov 13 18:04:56 2002
+@@ -353,6 +353,7 @@ ps_copyprolog(fd, outfd)
+  FILE *fd;
+  FILE *outfd;
+ {
++    size_t len;
+ 
+     Debug(DB_PSDOC, "%%ps_copyprolog: adding mpage prolog\n", 0);
+     if (!have_showsheet) {
+@@ -399,15 +400,17 @@ ps_copyprolog(fd, outfd)
+                  */
+                 if (tex1)
+                     free(tex1);
+-                tex1 = malloc(strlen(currline)+1);
+-                strcpy(tex1, currline);
++                len = strlen(currline)+1;
++                tex1 = malloc(len);
++                (void)strlcpy(tex1, currline, len);
+                 fprintf(outfd, "%s", currline);
+ 
+                 fgets(currline, LINESIZE-1, fd);
+                 if (tex2)
+                     free(tex2);
+-                tex2 = malloc(strlen(currline)+1);
+-                strcpy(tex2, currline);
++                len = strlen(currline)+1;
++                tex2 = malloc(len);
++                (void)strlcpy(tex2, currline, len);
+             }
+         }
+         fprintf(outfd, "%s", currline);
+@@ -432,7 +435,7 @@ ps_roff_copyprolog(fd, outfd)
+  /*       if (strcmp(currline, "xi\n") == 0) */
+         if (strstr(currline, "xi\n")) {
+             fprintf(outfd, "%%%s", currline); 
+-            strcpy(ps_roff_xi, currline);
++            (void)strlcpy(ps_roff_xi, currline, sizeof(ps_roff_xi));
+         }
+         else if (strncmp(currline, "%%Page:", 7) == 0) {
+             fprintf(outfd, "/p { } def\n");
+@@ -1013,6 +1016,8 @@ post_one_line(line, fd, outfd, indoc, fl
+  int * indoc;
+  int flush_page;
+ {
++        size_t len;
++
+         if (strncmp(line, "%%BeginDocument", 15) == 0) {
+             (*indoc)++;
+         }
+@@ -1063,15 +1068,17 @@ post_one_line(line, fd, outfd, indoc, fl
+                      */
+                     if (tex1)
+                         free(tex1);
+-                    tex1 = malloc(strlen(line)+1);
+-                    strcpy(tex1, line);
++                    len = strlen(line)+1;
++                    tex1 = malloc(len);
++                    (void)strlcpy(tex1, line, len);
+                     fprintf(outfd, "%s", line);
+                     flush_page ?  memgets(line, LINESIZE-1) :
+                                   fgets(line, LINESIZE-1, fd);
+                     if (tex2)
+                         free(tex2);
+-                    tex2 = malloc(strlen(line)+1);
+-                    strcpy(tex2, line);
++                    len = strlen(line)+1;
++                    tex2 = malloc(len);
++                    (void)strlcpy(tex2, line, len);
+                 } 
+             }
+ 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312111936.rBBJacvV016973>