- replace ugliness in install target with BSD_INSTALL macros

- convert patches to unified diffs
- add patch to suppress some warnings
This commit is contained in:
brad 1999-12-16 04:31:40 +00:00
parent 88b6e1ee18
commit 93d6a8d416
4 changed files with 133 additions and 344 deletions

View File

@ -1,240 +1,50 @@
*** bsd.c.orig Sat May 1 00:21:53 1993
--- bsd.c Tue Nov 25 14:51:06 1997
***************
*** 69,76 ****
}
/* Function gettz() returns the offset from GMT in seconds */
! long gettz()
{
#define SEC_IN_DAY (24L * 60L * 60L)
#define INV_VALUE (SEC_IN_DAY + 1L)
static long retval = INV_VALUE; /* cache, init to impossible value */
--- 69,84 ----
}
/* Function gettz() returns the offset from GMT in seconds */
! long gettz(t)
! #if defined(__OpenBSD__)
! time_t t;
! #else
! long t;
! #endif
{
+ #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+ return -localtime(&t)->tm_gmtoff;
+ #else
#define SEC_IN_DAY (24L * 60L * 60L)
#define INV_VALUE (SEC_IN_DAY + 1L)
static long retval = INV_VALUE; /* cache, init to impossible value */
***************
*** 95,100 ****
--- 103,109 ----
retval = -tm->tm_gmtoff;
#endif
return retval;
+ #endif
}
/* Standard UNIX-compatible time routines */
***************
*** 103,117 ****
/* Standard UNIX-specific file attribute routines */
#include "nixmode.i"
#ifndef SEEK_CUR
# define SEEK_CUR 1
#endif
/* Truncate a file. */
int zootrunc(f) FILE *f;
{
! extern long lseek();
! long seekpos;
int fd = fileno(f);
seekpos = lseek(fd, 0L, SEEK_CUR);
if (seekpos >= 0)
--- 112,130 ----
/* Standard UNIX-specific file attribute routines */
#include "nixmode.i"
+ #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+ #include <unistd.h>
+ #else
#ifndef SEEK_CUR
# define SEEK_CUR 1
#endif
+ #endif
/* Truncate a file. */
int zootrunc(f) FILE *f;
{
! extern off_t lseek();
! off_t seekpos;
int fd = fileno(f);
seekpos = lseek(fd, 0L, SEEK_CUR);
if (seekpos >= 0)
*** misc2.c.old Thu Aug 8 09:34:48 1991
--- misc2.c Thu Jan 5 05:37:06 1995
***************
*** 314,323 ****
{
long diff_tz;
long longtime;
if (direntry->tz == NO_TZ) /* none stored */
return;
! diff_tz = (long) direntry->tz * (3600/4) - gettz(); /* diff. in seconds */
! longtime = mstonix (direntry->date, direntry->time) + diff_tz; /* adj tz */
mstime (longtime, &direntry->date, &direntry->time);
}
#endif /* GETTZ */
--- 314,325 ----
{
long diff_tz;
long longtime;
+ long t;
if (direntry->tz == NO_TZ) /* none stored */
return;
! t = mstonix (direntry->date, direntry->time);
! diff_tz = (long) direntry->tz * (3600/4) - gettz(t); /* diff. in seconds */
! longtime = t + diff_tz; /* adj tz */
mstime (longtime, &direntry->date, &direntry->time);
}
#endif /* GETTZ */
*** nixtime.i.old Thu Aug 8 09:34:57 1991
--- nixtime.i Thu Jan 5 05:16:28 1995
***************
*** 52,58 ****
long mstonix();
long gettz();
long utimbuf[2];
! utimbuf[0] = utimbuf[1] = gettz() + mstonix (date, time);
return (utime (path, utimbuf));
}
--- 52,59 ----
long mstonix();
long gettz();
long utimbuf[2];
! long t = mstonix (date, time);
! utimbuf[0] = utimbuf[1] = t + gettz(t);
return (utime (path, utimbuf));
}
*** zoolist.c.old Thu Aug 8 09:36:09 1991
--- zoolist.c Thu Jan 5 05:41:47 1995
***************
*** 539,548 ****
{
long gettz();
int diff_tz; /* timezone difference */
if (file_tz == NO_TZ) /* if no timezone stored ..*/
printf (" "); /* .. just pad with blanks */
else {
! diff_tz = (file_tz / 4) - (int) (gettz() / 3600);
if (diff_tz == 0)
printf (" "); /* print nothing if same */
else if (diff_tz > 0) /* else print signed difference */
--- 539,550 ----
{
long gettz();
int diff_tz; /* timezone difference */
+ long t;
if (file_tz == NO_TZ) /* if no timezone stored ..*/
printf (" "); /* .. just pad with blanks */
else {
! time(&t);
! diff_tz = (file_tz / 4) - (int) (gettz(t) / 3600);
if (diff_tz == 0)
printf (" "); /* print nothing if same */
else if (diff_tz > 0) /* else print signed difference */
*** zoofns.h.bak Thu Aug 8 09:36:02 1991
--- zoofns.h Thu Jan 5 06:03:04 1995
***************
*** 94,100 ****
--- 94,104 ----
void fixslash PARMS ((char *));
void makelist PARMS ((int, char *[], char *[], int, char *, char *, char *, int *));
void memerr PARMS ((unsigned int));
+ #ifdef STDARG
+ void prterror(int level, char *format, ...);
+ #else
void prterror PARMS ((int, char *, ...));
+ #endif
void rootname PARMS ((char *, char *));
void skip_files PARMS ((ZOOFILE, unsigned int *, unsigned int *, int *,
char [], long *));
*** options.h.orig Sat May 1 08:27:59 1993
--- options.h Thu Jan 5 06:51:56 1995
***************
*** 96,102 ****
#define NIXTIME
#define NIXFNAME
#define NEEDCTYP
- #define NOENUM
#define REN_STDC
#define SETBUF
#define GETTZ
--- 96,101 ----
***************
*** 110,115 ****
--- 109,115 ----
#define ANSI_PROTO
#define VOIDPTR void *
#else
+ #define NOENUM
#define NOSTRCHR /* not really needed for 4.3BSD */
#define T_SIGNAL int
#define VARARGS
*** zooadd2.c.orig Sat Jul 20 02:38:10 1991
--- zooadd2.c Thu Jan 5 06:55:40 1995
***************
*** 258,269 ****
register struct direntry *direntry;
{
#ifdef GETTZ
long gettz();
#endif
direntry->zoo_tag = ZOO_TAG;
direntry->type = 2; /* type is now 2 */
#ifdef GETTZ
! direntry->tz = gettz() / (15 * 60); /* seconds => 15-min units */
#else
direntry->tz = NO_TZ; /* timezone unknown */
#endif
--- 258,272 ----
register struct direntry *direntry;
{
#ifdef GETTZ
+ long mstonix();
long gettz();
+ long t;
#endif
direntry->zoo_tag = ZOO_TAG;
direntry->type = 2; /* type is now 2 */
#ifdef GETTZ
! t = mstonix (direntry->date, direntry->time);
! direntry->tz = gettz(t) / (15 * 60); /* seconds => 15-min units */
#else
direntry->tz = NO_TZ; /* timezone unknown */
#endif
*** ar.h.orig Sat May 1 00:04:22 1993
--- ar.h Tue Nov 25 14:47:57 1997
***************
*** 15,25 ****
--- 15,29 ----
/* uchar should be 8 bits or more */
/* typedef unsigned char uchar; -- already in zoo.h */
+ #if !(defined(__FreeBSD__) && __FreeBSD__ < 3) && !defined(__OpenBSD__) && !defined(__NetBSD__)
typedef unsigned int uint; /* 16 bits or more */
#if !defined(__386BSD__) || !defined(_TYPES_H_)
typedef unsigned short ushort; /* 16 bits or more */
#endif
+ #endif
+ #if !(defined(__OpenBSD__))
typedef unsigned long ulong; /* 32 bits or more */
+ #endif
/* T_UINT16 must be #defined in options.h to be
a 16-bit unsigned integer type */
--- bsd.c.orig Sat May 1 00:21:53 1993
+++ bsd.c Wed Dec 15 23:08:42 1999
@@ -69,8 +69,16 @@
}
/* Function gettz() returns the offset from GMT in seconds */
-long gettz()
+long gettz(t)
+#if defined(__OpenBSD__)
+time_t t;
+#else
+long t;
+#endif
{
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+ return -localtime(&t)->tm_gmtoff;
+#else
#define SEC_IN_DAY (24L * 60L * 60L)
#define INV_VALUE (SEC_IN_DAY + 1L)
static long retval = INV_VALUE; /* cache, init to impossible value */
@@ -95,6 +103,7 @@
retval = -tm->tm_gmtoff;
#endif
return retval;
+#endif
}
/* Standard UNIX-compatible time routines */
@@ -103,15 +112,19 @@
/* Standard UNIX-specific file attribute routines */
#include "nixmode.i"
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+#include <unistd.h>
+#else
#ifndef SEEK_CUR
# define SEEK_CUR 1
#endif
+#endif
/* Truncate a file. */
int zootrunc(f) FILE *f;
{
- extern long lseek();
- long seekpos;
+ extern off_t lseek();
+ off_t seekpos;
int fd = fileno(f);
seekpos = lseek(fd, 0L, SEEK_CUR);
if (seekpos >= 0)

View File

@ -1,68 +1,41 @@
*** makefile.old Thu Aug 8 09:34:44 1991
--- makefile Thu Jan 5 05:07:23 1995
***************
*** 18,30 ****
MAKE = make # needed for some systems e.g. older BSD
! CC = cc
! CFLAGS =
MODEL =
EXTRA = -DBIG_MEM -DNDEBUG
LINTFLAGS = -DLINT
! OPTIM = -O
! DESTDIR = /usr/local/bin
#List of all object files created for Zoo
ZOOOBJS = addbfcrc.o addfname.o basename.o comment.o crcdefs.o \
--- 18,30 ----
MAKE = make # needed for some systems e.g. older BSD
! #CC = cc
! #CFLAGS =
MODEL =
EXTRA = -DBIG_MEM -DNDEBUG
LINTFLAGS = -DLINT
! OPTIM = $(CFLAGS)
! DESTDIR = $(PREFIX)/bin
#List of all object files created for Zoo
ZOOOBJS = addbfcrc.o addfname.o basename.o comment.o crcdefs.o \
***************
*** 67,73 ****
@echo "lint_turboc: Run lint under **IX for checking Turbo C/MSDOS code"
# install alpha zoo as "tzoo"
! install:
mv zoo $(DESTDIR)/tzoo
# install beta zoo as "bzoo"
--- 67,73 ----
@echo "lint_turboc: Run lint under **IX for checking Turbo C/MSDOS code"
# install alpha zoo as "tzoo"
! inst_test:
mv zoo $(DESTDIR)/tzoo
# install beta zoo as "bzoo"
***************
*** 75,82 ****
mv zoo $(DESTDIR)/bzoo
# install production zoo as "zoo"
! inst_prod:
! mv zoo $(DESTDIR)/zoo
# executable targets
TARGETS = zoo fiz
--- 75,83 ----
mv zoo $(DESTDIR)/bzoo
# install production zoo as "zoo"
! install:
! $(INSTALL) $(COPY) $(STRIP) -o $(BINOWN) -g $(BINGRP) -m $(BINMODE) $(TARGETS) $(DESTDIR)
! $(INSTALL) -c -o $(BINOWN) -g $(BINGRP) -m 444 zoo.1 fiz.1 $(PREFIX)/man/man1
# executable targets
TARGETS = zoo fiz
--- makefile.orig Tue Jul 16 11:52:08 1991
+++ makefile Wed Dec 15 23:14:17 1999
@@ -18,13 +18,13 @@
MAKE = make # needed for some systems e.g. older BSD
-CC = cc
-CFLAGS =
+#CC = cc
+#CFLAGS =
MODEL =
EXTRA = -DBIG_MEM -DNDEBUG
LINTFLAGS = -DLINT
-OPTIM = -O
-DESTDIR = /usr/local/bin
+OPTIM = $(CFLAGS)
+DESTDIR = $(PREFIX)/bin
#List of all object files created for Zoo
ZOOOBJS = addbfcrc.o addfname.o basename.o comment.o crcdefs.o \
@@ -67,7 +67,7 @@
@echo "lint_turboc: Run lint under **IX for checking Turbo C/MSDOS code"
# install alpha zoo as "tzoo"
-install:
+inst_test:
mv zoo $(DESTDIR)/tzoo
# install beta zoo as "bzoo"
@@ -75,8 +75,9 @@
mv zoo $(DESTDIR)/bzoo
# install production zoo as "zoo"
-inst_prod:
- mv zoo $(DESTDIR)/zoo
+install:
+ $(BSD_INSTALL_PROGRAM) $(TARGETS) $(DESTDIR)
+ $(BSD_INSTALL_MAN) zoo.1 fiz.1 $(PREFIX)/man/man1
# executable targets
TARGETS = zoo fiz

View File

@ -1,36 +1,26 @@
*** zoopack.c.orig Tue Nov 25 15:02:41 1997
--- zoopack.c Tue Nov 25 15:10:46 1997
***************
*** 78,83 ****
--- 78,86 ----
int curr_dir = 0; /* create backup in curr dir */
static char partial_msg[] =
"Partially packed archive left in %s.\n";
+ #if defined(__OpenBSD__)
+ int tempfd;
+ #endif
#ifdef FATTR
unsigned long zoofattr; /* zoo archive protection */
***************
*** 171,178 ****
} else {
strcpy (temp_file, xes);
}
! mktemp (temp_file); /* ... and make unique */
! new_file = zoocreate (temp_file);
if (new_file == NOFILE)
prterror ('f', "Could not create temporary file %s.\n", temp_file);
--- 174,184 ----
} else {
strcpy (temp_file, xes);
}
! tempfd = mkstemp (temp_file); /* ... and make unique */
! if (tempfd == -1)
! prterror ('f', "Could not create temporary file %s.\n", temp_file);
! new_file = fdopen(tempfd, "w+");
! /*new_file = zoocreate (temp_file); */
if (new_file == NOFILE)
prterror ('f', "Could not create temporary file %s.\n", temp_file);
--- zoopack.c.orig Fri Apr 30 23:59:21 1993
+++ zoopack.c Wed Dec 15 23:08:44 1999
@@ -78,6 +78,9 @@
int curr_dir = 0; /* create backup in curr dir */
static char partial_msg[] =
"Partially packed archive left in %s.\n";
+#if defined(__OpenBSD__)
+int tempfd;
+#endif
#ifdef FATTR
unsigned long zoofattr; /* zoo archive protection */
@@ -171,8 +174,11 @@
} else {
strcpy (temp_file, xes);
}
-mktemp (temp_file); /* ... and make unique */
-new_file = zoocreate (temp_file);
+tempfd = mkstemp (temp_file); /* ... and make unique */
+if (tempfd == -1)
+ prterror ('f', "Could not create temporary file %s.\n", temp_file);
+new_file = fdopen(tempfd, "w+");
+/*new_file = zoocreate (temp_file); */
if (new_file == NOFILE)
prterror ('f', "Could not create temporary file %s.\n", temp_file);

View File

@ -0,0 +1,16 @@
--- ar.h.orig Wed Dec 15 23:20:47 1999
+++ ar.h Wed Dec 15 23:21:17 1999
@@ -15,11 +15,11 @@
/* uchar should be 8 bits or more */
/* typedef unsigned char uchar; -- already in zoo.h */
+#ifndef _SYS_TYPES_H_
typedef unsigned int uint; /* 16 bits or more */
-#if !defined(__386BSD__) || !defined(_TYPES_H_)
typedef unsigned short ushort; /* 16 bits or more */
-#endif
typedef unsigned long ulong; /* 32 bits or more */
+#endif
/* T_UINT16 must be #defined in options.h to be
a 16-bit unsigned integer type */