git: e6d3a2c6920a - main - archivers/arc: upgrade to 5.21q.

From: Xin LI <delphij_at_FreeBSD.org>
Date: Mon, 24 Apr 2023 01:18:37 UTC
The branch main has been updated by delphij:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e6d3a2c6920ad691aa47dccc62cbe7c9013f7d45

commit e6d3a2c6920ad691aa47dccc62cbe7c9013f7d45
Author:     Xin LI <delphij@FreeBSD.org>
AuthorDate: 2023-04-24 01:18:05 +0000
Commit:     Xin LI <delphij@FreeBSD.org>
CommitDate: 2023-04-24 01:18:05 +0000

    archivers/arc: upgrade to 5.21q.
---
 archivers/arc/Makefile              | 12 +++++-
 archivers/arc/distinfo              |  5 ++-
 archivers/arc/files/patch-Makefile  |  4 +-
 archivers/arc/files/patch-arc.c     |  6 +--
 archivers/arc/files/patch-arc.h     |  4 +-
 archivers/arc/files/patch-arcadd.c  | 12 +++---
 archivers/arc/files/patch-arccvt.c  |  4 +-
 archivers/arc/files/patch-arcdata.c |  4 +-
 archivers/arc/files/patch-arcdos.c  |  4 +-
 archivers/arc/files/patch-arcext.c  |  6 +--
 archivers/arc/files/patch-arcio.c   | 68 +++++++++++++++++++++++++++----
 archivers/arc/files/patch-arclzw.c  |  6 +--
 archivers/arc/files/patch-arcmisc.c | 80 +++++++++++++++++++++++++++++++++++++
 archivers/arc/files/patch-arcrun.c  | 10 ++---
 archivers/arc/files/patch-arcunp.c  |  8 ++--
 15 files changed, 188 insertions(+), 45 deletions(-)

diff --git a/archivers/arc/Makefile b/archivers/arc/Makefile
index 502c1667c694..4cfc79185ec1 100644
--- a/archivers/arc/Makefile
+++ b/archivers/arc/Makefile
@@ -1,7 +1,6 @@
 PORTNAME=	arc
-PORTVERSION=	5.21p
+PORTVERSION=	5.21q
 CATEGORIES=	archivers
-MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
 
 MAINTAINER=	delphij@FreeBSD.org
 COMMENT=	Create & extract files from DOS .ARC files
@@ -9,6 +8,10 @@ WWW=		http://arc.sourceforge.net/
 
 LICENSE=	GPLv2
 
+USE_GITHUB=	yes
+GH_ACCOUNT=	ani6al
+GH_PROJECT=	arc
+
 CONFLICTS_INSTALL= arcanist-php[0-9][0-9]
 
 OPTIONS_DEFINE=	DOCS
@@ -18,6 +21,11 @@ CPE_VENDOR=	arc_project
 PLIST_FILES=	bin/arc bin/marc man/man1/arc.1.gz
 PORTDOCS=	Arc521.doc
 
+post-patch:
+.for f in arc.1 marc.1
+	@${REINPLACE_CMD} 's/ 1L / 1 /' ${WRKSRC}/${f}
+.endfor
+
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/arc ${WRKSRC}/marc\
 		${STAGEDIR}/${PREFIX}/bin
diff --git a/archivers/arc/distinfo b/archivers/arc/distinfo
index 99ff7ee6b018..d154acdb1f5d 100644
--- a/archivers/arc/distinfo
+++ b/archivers/arc/distinfo
@@ -1,2 +1,3 @@
-SHA256 (arc-5.21p.tar.gz) = eacf870a245f155a4ba8c6f8e0fbb2e8a267aafa157f56ba7a8cb1d74fd8b5a1
-SIZE (arc-5.21p.tar.gz) = 84791
+TIMESTAMP = 1682294733
+SHA256 (ani6al-arc-5.21q_GH0.tar.gz) = bde44648d0c451852612da2256f5a7e48b97d0d625ba88b903d7f223959528cc
+SIZE (ani6al-arc-5.21q_GH0.tar.gz) = 79366
diff --git a/archivers/arc/files/patch-Makefile b/archivers/arc/files/patch-Makefile
index bc67c7a69791..e12453136c78 100644
--- a/archivers/arc/files/patch-Makefile
+++ b/archivers/arc/files/patch-Makefile
@@ -1,6 +1,6 @@
---- Makefile.orig	2010-08-07 13:06:42 UTC
+--- Makefile.orig	2013-06-27 02:00:19 UTC
 +++ Makefile
-@@ -44,14 +44,14 @@ SYSTEM = -DSYSV=1
+@@ -43,14 +43,14 @@ OPT = -O -Wall
  OPT = -O -Wall
  # For MWC 3.0 on the Atari ST, use:
  #CFLAGS = -VCOMPAC -VPEEP
diff --git a/archivers/arc/files/patch-arc.c b/archivers/arc/files/patch-arc.c
index 446149131503..fc92208b4536 100644
--- a/archivers/arc/files/patch-arc.c
+++ b/archivers/arc/files/patch-arc.c
@@ -1,6 +1,6 @@
---- arc.c.orig	2010-08-07 13:06:42 UTC
+--- arc.c.orig	2013-06-27 02:00:19 UTC
 +++ arc.c
-@@ -298,7 +298,7 @@ main(num, arg)			/* system entry point *
+@@ -280,7 +280,7 @@ main(num, arg)			/* system entry point */
  			keepbak = 1;
  
  		else if (*a == 'W')	/* suppress warnings */
@@ -9,7 +9,7 @@
  #if	!DOS
  		else if (*a == 'I')	/* image mode, no ASCII/EBCDIC x-late */
  			image = !image;
-@@ -434,7 +434,7 @@ static	VOID
+@@ -416,7 +416,7 @@ expandlst(n)			/* expand an indirect reference */
  expandlst(n)			/* expand an indirect reference */
  	int		n;	/* number of entry to expand */
  {
diff --git a/archivers/arc/files/patch-arc.h b/archivers/arc/files/patch-arc.h
index 0ba371b9f874..59c9f60ed2eb 100644
--- a/archivers/arc/files/patch-arc.h
+++ b/archivers/arc/files/patch-arc.h
@@ -1,6 +1,6 @@
---- arc.h.orig	2010-08-07 13:06:42 UTC
+--- arc.h.orig	2013-06-27 02:00:19 UTC
 +++ arc.h
-@@ -106,7 +106,7 @@ extern char     tmpchr[2];	/* Temporary 
+@@ -104,7 +104,7 @@ extern int      hold;		/* hold screen before exiting *
  #if	GEMDOS
  extern int      hold;		/* hold screen before exiting */
  #endif
diff --git a/archivers/arc/files/patch-arcadd.c b/archivers/arc/files/patch-arcadd.c
index 2c10334c08a0..3c5d96511fbc 100644
--- a/archivers/arc/files/patch-arcadd.c
+++ b/archivers/arc/files/patch-arcadd.c
@@ -1,6 +1,6 @@
---- arcadd.c.orig	2010-08-07 13:06:42 UTC
+--- arcadd.c.orig	2013-06-27 02:00:19 UTC
 +++ arcadd.c
-@@ -119,7 +119,7 @@ int             fresh;		/* true if fresh
+@@ -117,7 +117,7 @@ int             fresh;		/* true if freshening */
  			}
  #endif
  		}
@@ -9,7 +9,7 @@
  			printf("No files match: %s\n", arg[n]);
  	}
  
-@@ -133,7 +133,7 @@ int             fresh;		/* true if fresh
+@@ -131,7 +131,7 @@ int             fresh;		/* true if freshening */
  		free(path);
  		free(name);
  	}
@@ -18,7 +18,7 @@
  		printf("No files were added.\n");
  }
  
-@@ -227,7 +227,7 @@ addbunch(nfiles, path, name, move, updat
+@@ -225,7 +225,7 @@ addbunch(nfiles, path, name, move, update, fresh)	/* a
  	if (move) {		/* if this was a move */
  		for (n = 0; n < nfiles; n++) {	/* then delete each file
  						 * added */
@@ -27,7 +27,7 @@
  				printf("Cannot unsave %s\n", path[n]);
  				nerrs++;
  			}
-@@ -259,7 +259,7 @@ addfile(path, name, update, fresh)	/* ad
+@@ -257,7 +257,7 @@ addfile(path, name, update, fresh)	/* add named file t
  	if (!f)
  #endif
  	{
@@ -36,7 +36,7 @@
  			printf("Cannot read file: %s\n", path);
  			nerrs++;
  		}
-@@ -267,7 +267,7 @@ addfile(path, name, update, fresh)	/* ad
+@@ -265,7 +265,7 @@ addfile(path, name, update, fresh)	/* add named file t
  	}
  #if	!DOS
  	if (strlen(name) >= FNLEN) {
diff --git a/archivers/arc/files/patch-arccvt.c b/archivers/arc/files/patch-arccvt.c
index 54fe714c5b57..15508bd03c22 100644
--- a/archivers/arc/files/patch-arccvt.c
+++ b/archivers/arc/files/patch-arccvt.c
@@ -1,6 +1,6 @@
---- arccvt.c.orig	2010-08-07 13:06:42 UTC
+--- arccvt.c.orig	2013-06-27 02:00:19 UTC
 +++ arccvt.c
-@@ -120,7 +120,7 @@ cvtfile(hdr)			/* convert a file */
+@@ -118,7 +118,7 @@ cvtfile(hdr)			/* convert a file */
  	writehdr(hdr, new);	/* write out real header */
  	fseek(new, hdr->size, 1);	/* skip over data to next header */
  	fclose(tmp);		/* all done with the file */
diff --git a/archivers/arc/files/patch-arcdata.c b/archivers/arc/files/patch-arcdata.c
index 386eb235c141..17e8c1c17741 100644
--- a/archivers/arc/files/patch-arcdata.c
+++ b/archivers/arc/files/patch-arcdata.c
@@ -1,6 +1,6 @@
---- arcdata.c.orig	2010-08-07 13:06:42 UTC
+--- arcdata.c.orig	2013-06-27 02:00:19 UTC
 +++ arcdata.c
-@@ -35,7 +35,7 @@ char            tmpchr[2] = "-";/* Tempo
+@@ -33,7 +33,7 @@ int		hold = 0;	/* true to pause before exit */
  #if	GEMDOS
  int		hold = 0;	/* true to pause before exit */
  #endif
diff --git a/archivers/arc/files/patch-arcdos.c b/archivers/arc/files/patch-arcdos.c
index 28cec121b0f3..fb242010c6e2 100644
--- a/archivers/arc/files/patch-arcdos.c
+++ b/archivers/arc/files/patch-arcdos.c
@@ -1,6 +1,6 @@
---- arcdos.c.orig	2010-08-07 13:06:42 UTC
+--- arcdos.c.orig	2013-06-27 02:00:19 UTC
 +++ arcdos.c
-@@ -175,14 +175,20 @@ setstamp(f, date, time)		/* set a file's
+@@ -173,14 +173,20 @@ setstamp(f, date, time)		/* set a file's date/time sta
  	struct tm	tm;
  	struct timeval  tvp[2];
  	int	utimes();
diff --git a/archivers/arc/files/patch-arcext.c b/archivers/arc/files/patch-arcext.c
index 7e8f1434ea04..44e18fd7ae7c 100644
--- a/archivers/arc/files/patch-arcext.c
+++ b/archivers/arc/files/patch-arcext.c
@@ -1,6 +1,6 @@
---- arcext.c.orig	2010-08-07 13:06:42 UTC
+--- arcext.c.orig	2013-06-27 02:00:19 UTC
 +++ arcext.c
-@@ -143,7 +143,7 @@ extfile(hdr, path, prt)		/* extract a fi
+@@ -141,7 +141,7 @@ extfile(hdr, path, prt)		/* extract a file */
  	if (note)
  		printf("Extracting file: %s\n", fix);
  
@@ -9,7 +9,7 @@
  		if ((f = fopen(fix, "r"))) {	/* see if it exists */
  				fclose(f);
  				printf("WARNING: File %s already exists!", fix);
-@@ -191,7 +191,7 @@ extfile(hdr, path, prt)		/* extract a fi
+@@ -189,7 +189,7 @@ extfile(hdr, path, prt)		/* extract a file */
  	if (!f)
  #endif
  	{
diff --git a/archivers/arc/files/patch-arcio.c b/archivers/arc/files/patch-arcio.c
index be27ece679a4..8a883178e378 100644
--- a/archivers/arc/files/patch-arcio.c
+++ b/archivers/arc/files/patch-arcio.c
@@ -1,6 +1,14 @@
---- arcio.c.orig	2010-08-07 13:06:42 UTC
+--- arcio.c.orig	2013-06-27 02:00:19 UTC
 +++ arcio.c
-@@ -46,7 +46,7 @@ readhdr(hdr, f)			/* read a header from 
+@@ -35,6 +35,7 @@ readhdr(hdr, f)			/* read a header from an archive */
+ #endif
+ 	char            name[FNLEN];	/* filename buffer */
+ 	int             try = 0;/* retry counter */
++	int             hdrlen;
+ 	static int      first = 1;	/* true only on first read */
+ 
+ 	if (!f)			/* if archive didn't open */
+@@ -44,7 +45,7 @@ readhdr(hdr, f)			/* read a header from an archive */
  		return 0;	/* then signal end of archive */
  
  	if (hdrver != ARCMARK) {	/* check archive validity */
@@ -9,7 +17,7 @@
  			printf("An entry in %s has a bad header.\n", arcname);
  			nerrs++;
  		}
-@@ -67,10 +67,10 @@ readhdr(hdr, f)			/* read a header from 
+@@ -65,10 +66,10 @@ readhdr(hdr, f)			/* read a header from an archive */
  		if (feof(f) && first)
  			arcdie("%s is not an archive", arcname);
  
@@ -22,11 +30,57 @@
  			printf("  %d bytes skipped.\n", try);
  
  		if (feof(f))
-@@ -118,7 +118,8 @@ readhdr(hdr, f)			/* read a header from 
- 	hdr->crc = (short) ((dummy[22] << 8) + dummy[21]);
- 	for (i = 0, hdr->length=0; i<4; hdr->length<<=8, hdr->length += dummy[26-i], i++);
+@@ -90,33 +91,40 @@ readhdr(hdr, f)			/* read a header from an archive */
+ 		printf("I think you need a newer version of ARC.\n");
+ 		exit(1);
+ 	}
++
+ 	/* amount to read depends on header type */
++	if (hdrver == 1) {
++		hdrlen = 23; /* old style is shorter */
++	} else {
++		hdrlen = 27;
++	}
+ 
+-	if (hdrver == 1) {	/* old style is shorter */
+-		if (fread(hdr, sizeof(struct heads) - sizeof(long int), 1, f) != 1)
+-			arcdie("%s was truncated", arcname);
+-		hdrver = 2;	/* convert header to new format */
+-		hdr->length = hdr->size;	/* size is same when not
+-						 * packed */
+-	} else
+-#if	MSDOS
+-		if (fread(hdr, sizeof(struct heads), 1, f) != 1)
+-			arcdie("%s was truncated", arcname);
+-#else
+-		if (fread(dummy, 27, 1, f) != 1)
+-			arcdie("%s was truncated", arcname);
++	if (fread(dummy, hdrlen, 1, f) != 1)
++		arcdie("%s was truncated", arcname);
+ 
+ 	for (i = 0; i < FNLEN; hdr->name[i] = dummy[i], i++);
++	hdr->name[FNLEN - 1] = 0; /* ensure 0 termination */
+ #if	_MTS
+ 	(void) atoe(hdr->name, strlen(hdr->name));
  #endif
--
++	if (strchr(hdr->name, CUTOFF) != NULL)
++		arcdie("%s contains illegal filename %s", arcname, hdr->name);
++
+ 	for (i = 0, hdr->size=0; i<4; hdr->size<<=8, hdr->size += dummy[16-i], i++);
+ 	hdr->date = (short) ((dummy[18] << 8) + dummy[17]);
+ 	hdr->time = (short) ((dummy[20] << 8) + dummy[19]);
+ 	hdr->crc = (short) ((dummy[22] << 8) + dummy[21]);
+-	for (i = 0, hdr->length=0; i<4; hdr->length<<=8, hdr->length += dummy[26-i], i++);
+-#endif
+ 
++	if (hdrver == 1) {
++		hdrver = 2;	/* convert header to new format */
++		hdr->length = hdr->size;	/* size is same when not
++						 * packed */
++	} else {
++		for (i = 0, hdr->length=0; i<4; hdr->length<<=8, hdr->length += dummy[26-i], i++);
++	}
++
 +	if (hdr->size < 0)
 +		arcdie("Invalid header in archive %s", arcname);
  	if (hdr->date > olddate
diff --git a/archivers/arc/files/patch-arclzw.c b/archivers/arc/files/patch-arclzw.c
index 4ee553832413..746fcd02993b 100644
--- a/archivers/arc/files/patch-arclzw.c
+++ b/archivers/arc/files/patch-arclzw.c
@@ -1,6 +1,6 @@
---- arclzw.c.orig	2010-08-07 13:06:42 UTC
+--- arclzw.c.orig	2013-06-27 02:00:19 UTC
 +++ arclzw.c
-@@ -57,9 +57,11 @@ static VOID     putcode();
+@@ -55,9 +55,11 @@ extern u_char	*pinbuf;
  #define NOT_FND  0xFFFF
  
  extern u_char	*pinbuf;
@@ -15,7 +15,7 @@
  
  static int      sp;		/* current stack pointer */
  static int	inflag;
-@@ -560,7 +562,7 @@ decomp(squash, f, t)		/* decompress a file */
+@@ -558,7 +560,7 @@ decomp(squash, f, t)		/* decompress a file */
  		 */
  		if (code >= free_ent) {
  			if (code > free_ent) {
diff --git a/archivers/arc/files/patch-arcmisc.c b/archivers/arc/files/patch-arcmisc.c
new file mode 100644
index 000000000000..24117570b2f1
--- /dev/null
+++ b/archivers/arc/files/patch-arcmisc.c
@@ -0,0 +1,80 @@
+--- arcmisc.c.orig	2013-06-27 02:00:19 UTC
++++ arcmisc.c
+@@ -6,7 +6,9 @@
+  */
+ 
+ #include <stdio.h>
++#include <stdarg.h>
+ #include <ctype.h>
++#include <unistd.h>
+ #include "arc.h"
+ 
+ #include <string.h>
+@@ -68,7 +70,6 @@ chdir(dirname)
+ #define DIRECT direct
+ #endif
+ #include <sys/stat.h>
+-	int	rename(), unlink();
+ #include <fcntl.h>
+ #endif
+ 
+@@ -110,7 +111,7 @@ move(oldnam, newnam)
+ move(oldnam, newnam)
+ 	char           *oldnam, *newnam;
+ {
+-	FILE           *fopen(), *old, *new;
++	FILE           *old, *new;
+ #if	!_MTS
+ 	struct stat     oldstat;
+ #endif
+@@ -225,11 +226,13 @@ VOID
+ }
+ /* VARARGS1 */
+ VOID
+-arcdie(s, arg1, arg2, arg3)
+-	char           *s;
++arcdie(const char *s, ...)
+ {
++	va_list args;
+ 	fprintf(stderr, "ARC: ");
+-	fprintf(stderr, s, arg1, arg2, arg3);
++	va_start(args, s);
++	vfprintf(stderr, s, args);
++	va_end(args);
+ 	fprintf(stderr, "\n");
+ #if	UNIX
+ 	perror("UNIX");
+@@ -247,7 +250,6 @@ gcdir(dirname)
+ 	char           *dirname;
+ 
+ {
+-	char           *getcwd();
+ #if	GEMDOS
+ 	int             drv;
+ 	char           *buf;
+@@ -310,11 +312,7 @@ dir(filename)		/* get files, one by one */
+ 	static struct DIRECT **namelist;
+ 	static char   **NameList;
+ 	static char	namecopy[STRLEN], *dirname;
+-#if	UNIX
+-	int             alphasort();
+-	int             scandir();
+-#endif				/* UNIX */
+-	int             fmatch();
++	int fmatch(const struct DIRECT *);
+ 	static int      Nnum = 0, ii;
+ 
+ 
+@@ -354,10 +352,9 @@ int
+  */
+ 
+ int
+-fmatch(direntry)
+-	struct DIRECT  *direntry;
++fmatch(const struct DIRECT  *direntry)
+ {
+-	char           *string;
++	const char           *string;
+ 
+ 	string = direntry->d_name;
+ 
diff --git a/archivers/arc/files/patch-arcrun.c b/archivers/arc/files/patch-arcrun.c
index 42b1985b4bd8..dca4e84addea 100644
--- a/archivers/arc/files/patch-arcrun.c
+++ b/archivers/arc/files/patch-arcrun.c
@@ -1,6 +1,6 @@
---- arcrun.c.orig	2010-08-07 13:06:42 UTC
+--- arcrun.c.orig	2013-06-27 02:00:19 UTC
 +++ arcrun.c
-@@ -98,7 +98,7 @@ runfile(hdr, num, arg)		/* run a file */
+@@ -96,7 +96,7 @@ runfile(hdr, num, arg)		/* run a file */
  		strcpy(sys, buf);
  
  	else {
@@ -9,7 +9,7 @@
  			printf("File %s is not a .BAS, .BAT, .COM, or .EXE\n",
  			       hdr->name);
  			nerrs++;
-@@ -112,7 +112,7 @@ runfile(hdr, num, arg)		/* run a file */
+@@ -110,7 +110,7 @@ runfile(hdr, num, arg)		/* run a file */
                && strcmp(i, ".TTP")
                && strcmp(i, ".TOS"))
        {
@@ -18,7 +18,7 @@
                        printf("File %s is not a .PRG, .TOS, or .TTP\n",
                                hdr->name);
                        nerrs++;
-@@ -122,7 +122,7 @@ runfile(hdr, num, arg)		/* run a file */
+@@ -120,7 +120,7 @@ runfile(hdr, num, arg)		/* run a file */
        }
  #endif
  
@@ -27,7 +27,7 @@
  		if ((tmp = fopen(buf, "r")))
  			arcdie("Temporary file %s already exists", buf);
  	if (!(tmp = tmpopen(buf)))
-@@ -146,7 +146,7 @@ runfile(hdr, num, arg)		/* run a file */
+@@ -144,7 +144,7 @@ runfile(hdr, num, arg)		/* run a file */
  	if (system(buf))		/* try to invoke it */
  		arcdie("Execution failed for %s", buf);
  #endif
diff --git a/archivers/arc/files/patch-arcunp.c b/archivers/arc/files/patch-arcunp.c
index b157130802f0..0b47452359e3 100644
--- a/archivers/arc/files/patch-arcunp.c
+++ b/archivers/arc/files/patch-arcunp.c
@@ -1,6 +1,6 @@
---- arcunp.c.orig	2010-08-07 13:06:42 UTC
+--- arcunp.c.orig	2013-06-27 02:00:19 UTC
 +++ arcunp.c
-@@ -39,8 +39,8 @@ extern int	lastc;
+@@ -37,8 +37,8 @@ extern int	lastc;
  #define NOHIST 0		/* no relevant history */
  #define INREP 1			/* sending a repeated value */
  
@@ -11,7 +11,7 @@
  #if	!DOS
  static int	gotcr;		/* got a carriage return? */
  #endif
-@@ -122,7 +122,7 @@ unpack(f, t, hdr)		/* unpack an archive entry */
+@@ -120,7 +120,7 @@ unpack(f, t, hdr)		/* unpack an archive entry */
  		break;
  
  	default:		/* unknown method */
@@ -20,7 +20,7 @@
  			printf("I don't know how to unpack file %s\n", hdr->name);
  			printf("I think you need a newer version of ARC\n");
  			nerrs++;
-@@ -134,7 +134,7 @@ unpack(f, t, hdr)		/* unpack an archive entry */
+@@ -132,7 +132,7 @@ unpack(f, t, hdr)		/* unpack an archive entry */
  	/* cleanups common to all methods */
  
  	if (crcval != hdr->crc) {