diff -rc cpio-1.5-orig/Makefile cpio-1.5/Makefile *** cpio-1.5-orig/Makefile Tue May 26 16:02:24 1992 --- cpio-1.5/Makefile Tue May 26 15:57:07 1992 *************** *** 0 **** --- 1,145 ---- + # Generated automatically from Makefile.in by configure. + # Makefile for GNU cpio. + # Copyright (C) 1988-1991 Free Software Foundation, Inc. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2, or (at your option) + # any later version. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + SHELL = /bin/sh + + #### Start of system configuration section. #### + + srcdir = . + + + # If you use gcc, you should either run the fixincludes script that + # comes with it or else use gcc with the -traditional option. Otherwise + # ioctl calls will be compiled incorrectly on some systems. + CC = gcc -O2 -static #Need static for essential programs like this! + + # If you don't have a BSD or GNU install program, use cp. + INSTALL = install -c + INSTALLDATA = install -c -m644 + + # Things you might add to DEFS: + # -DSTDC_HEADERS If you have ANSI C headers and libraries. + # -DPOSIX If you have POSIX.1 headers and libraries. + # -DSIGTYPE=int If your signal handlers return int, not void. + # -DUSG If you have System V/ANSI C string + # and memory functions and headers. + # -DVPRINTF_MISSING If you lack vprintf function (but have _doprnt). + # -DDOPRNT_MISSING If you lack _doprnt function. Also need to define + # -DVPRINTF_MISSING. + # -DNO_MTIO If you lack sys/mtio.h (magtape ioctls). + # -DNO_REMOTE If you do not have a remote shell or rexec. + # -DUSE_REXEC To use rexec for remote tape operations + # instead of forking rsh or remsh. + + DEFS = -DSTDC_HEADERS -DPOSIX -DUSG -DNO_REMOTE -D_POSIX_SOURCE \ + -DMACRO_BSTRING + #This _POSIX_SOURCE thing should be done automatically in the /usr/includes + LIBS = + # Set this to rtapelib.o unless you defined NO_REMOTE, in which case + # make it empty. + RTAPELIB = + + CDEBUG = # -g + CFLAGS = $(CDEBUG) -I$(srcdir) $(DEFS) + LDFLAGS = # -g + + prefix = /usr/local + + # Where to install the cpio and mt executables. + bindir = $(prefix)/gnubin + + # Where to put the Unix-style manual pages. + mandir = $(prefix)/man/man1 + # Extension (including `.') for the Unix-style manual page filenames. + manext = .1 + + #### End of system configuration section. #### + + SRCS = copyin.c copyout.c copypass.c dstring.c fnmatch.c global.c \ + main.c util.c error.c getopt.c getopt1.c filemode.c version.c \ + rtapelib.c dirname.c idcache.c makepath.c xmalloc.c xstrdup.c \ + bcopy.c mkdir.c strdup.c + OBJS = copyin.o copyout.o copypass.o dstring.o fnmatch.o global.o \ + main.o util.o error.o getopt.o getopt1.o filemode.o version.o \ + $(RTAPELIB) dirname.o idcache.o makepath.o xmalloc.o xstrdup.o \ + strdup.o + # mt source files not shared with cpio. + MT_SRCS = mt.c argmatch.c + MT_OBJS = mt.o argmatch.o error.o getopt.o getopt1.o xmalloc.o $(RTAPELIB) + HDRS = cpio.h dstring.h extern.h filetypes.h fnmatch.h getopt.h rmt.h + DISTFILES = $(SRCS) $(HDRS) COPYING COPYING.LIB ChangeLog Makefile.in \ + README gcpio.1 gmt.1 makefile.pc cpio.def cpio.cs configure $(MT_SRCS) \ + rmt.c tcexparg.c alloca.c + + all: cpio mt + .PHONY: all + + install: all $(srcdir)/gcpio.1 $(srcdir)/gmt.1 + $(INSTALL) cpio $(bindir) + test ! -f mt || $(INSTALL) mt $(bindir) + -test ! -f rmt || $(INSTALL) rmt /etc + $(INSTALLDATA) $(srcdir)/gcpio.1 $(mandir)/`basename gcpio.1 .1`$(manext) + test ! -f mt || $(INSTALLDATA) $(srcdir)/gmt.1 $(mandir)/`basename gmt.1 .1`$(manext) + .PHONY: install + + cpio: $(OBJS) + $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) + + copyin.o: cpio.h dstring.h extern.h filetypes.h fnmatch.h rmt.h + copyout.o: cpio.h dstring.h extern.h filetypes.h rmt.h + copypass.o: cpio.h dstring.h extern.h filetypes.h + dstring.o: dstring.h + global.o: cpio.h dstring.h + main.o: cpio.h dstring.h extern.h rmt.h + util.o: extern.h rmt.h + mt.o: rmt.h + + rmt: rmt.o + $(CC) $(LDFLAGS) -o $@ rmt.o $(LIBS) + + mt: $(MT_OBJS) + $(CC) $(LDFLAGS) -o $@ $(MT_OBJS) $(LIBS) + + LINT: $(SRCS) $(HDRS) + lint -I. $(DEFS) $(SRCS) > LINT + + tags: $(SRCS) + ctags $(SRCS) + + TAGS: $(SRCS) + etags $(SRCS) + + clean: + rm -f cpio rmt mt *.o core + .PHONY: clean + + distclean: clean + rm -f TAGS tags Makefile config.status + .PHONY: distclean + + realclean: distclean + .PHONY: realclean + + dist: + echo cpio-`sed -e '/version_string/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q < version.c` > .fname + rm -rf `cat .fname` + mkdir `cat .fname` + ln $(DISTFILES) `cat .fname` + tar chZf `cat .fname`.tar.Z `cat .fname` + rm -rf `cat .fname` .fname + .PHONY: dist diff -rc cpio-1.5-orig/config.status cpio-1.5/config.status *** cpio-1.5-orig/config.status Tue May 26 16:03:17 1992 --- cpio-1.5/config.status Thu Apr 16 01:45:26 1992 *************** *** 0 **** --- 1,9 ---- + CC = gcc -O + INSTALL = install -c + INSTALLDATA = install -c -m644 + DEFS = -DSTDC_HEADERS -DPOSIX -DUSG -DNO_REMOTE + LIBS = + RTAPELIB = + LIBOBJS = strdup.o + ALLOCA = + PROGS = cpio mt diff -rc cpio-1.5-orig/copyin.c cpio-1.5/copyin.c *** cpio-1.5-orig/copyin.c Thu Jul 18 22:16:08 1991 --- cpio-1.5/copyin.c Thu Apr 16 01:46:30 1992 *************** *** 38,43 **** --- 38,47 ---- #include #endif + #ifdef linux + #include + #endif + #ifdef _POSIX_SOURCE #define major(dev) (((dev) >> 8) & 0xff) #define minor(dev) ((dev) & 0xff) *************** *** 201,207 **** --- 205,215 ---- FILE *tty_in; /* Interactive file for rename option. */ FILE *tty_out; /* Interactive file for rename option. */ char *str_res; /* Result for string function. */ + #ifdef linux + struct utimbuf times; /* actually this is POSIX, I think -- hhb */ + #else long times[2]; /* For setting file times. */ + #endif struct stat file_stat; /* Output file stat record. */ struct cpio_header file_hdr; /* Output header information. */ int out_file_des; /* Output file descriptor. */ *************** *** 413,420 **** error (0, errno, "%s", file_hdr.h_name); if (retain_time_flag) { ! times[0] = times[1] = file_hdr.h_mtime; if (utime (file_hdr.h_name, times) < 0) error (0, errno, "%s", file_hdr.h_name); } } --- 421,433 ---- error (0, errno, "%s", file_hdr.h_name); if (retain_time_flag) { ! #ifdef linux /* again repairing POSIX violation, I think -- hhb */ ! times.actime = times.modtime = file_hdr.h_mtime; ! if (utime (file_hdr.h_name, ×) < 0) ! #else ! times.[0] = times[1] = file_hdr.h_mtime; if (utime (file_hdr.h_name, times) < 0) + #endif error (0, errno, "%s", file_hdr.h_name); } } diff -rc cpio-1.5-orig/copyout.c cpio-1.5/copyout.c *** cpio-1.5-orig/copyout.c Thu Jul 18 22:16:27 1991 --- cpio-1.5/copyout.c Thu Apr 16 01:46:30 1992 *************** *** 98,104 **** --- 98,108 ---- { int res; /* Result of functions. */ dynamic_string input_name; /* Name of file read from stdin. */ + #ifdef linux + struct utimbuf times; + #else long times[2]; /* For resetting file times after copy. */ + #endif struct stat file_stat; /* Stat record for file. */ struct cpio_header file_hdr; /* Output header information. */ int in_file_des; /* Source file descriptor. */ *************** *** 207,215 **** --- 211,225 ---- error (0, errno, "%s", input_name.ds_string); if (reset_time_flag) { + #ifdef linux + times.actime = file_stat.st_atime; + times.modtime = file_stat.st_mtime; + if (utime (file_hdr.h_name, ×) < 0) + #else times[0] = file_stat.st_atime; times[1] = file_stat.st_mtime; if (utime (file_hdr.h_name, times) < 0) + #endif error (0, errno, "%s", file_hdr.h_name); } break; diff -rc cpio-1.5-orig/extern.h cpio-1.5/extern.h *** cpio-1.5-orig/extern.h Wed Jul 10 19:48:05 1991 --- cpio-1.5/extern.h Thu Apr 16 01:46:30 1992 *************** *** 46,52 **** --- 46,55 ---- extern int (*xstat) (); extern void (*copy_function) (); + #ifndef linux long lseek (); + #endif + #ifndef STDC_HEADERS char *malloc (); char *realloc (); diff -rc cpio-1.5-orig/mt.c cpio-1.5/mt.c *** cpio-1.5-orig/mt.c Sun Aug 25 11:06:55 1991 --- cpio-1.5/mt.c Tue May 26 00:26:29 1992 *************** *** 20,26 **** If -f is not given, the environment variable TAPE is used; if that is not set, a default device defined in sys/mtio.h is used. The device must be either a character special file or a remote ! tape drive with the form "[user@]system:/dev/*". The default count is 1. Some operations ignore it. Exit status: --- 20,26 ---- If -f is not given, the environment variable TAPE is used; if that is not set, a default device defined in sys/mtio.h is used. The device must be either a character special file or a remote ! tape drive with the form "[user@]system:/dev/ * ". -- avoid nested comments The default count is 1. Some operations ignore it. Exit status: diff -rc cpio-1.5-orig/strdup.c cpio-1.5/strdup.c *** cpio-1.5-orig/strdup.c Sat Jul 13 02:45:00 1991 --- cpio-1.5/strdup.c Tue May 26 00:01:48 1992 *************** *** 26,33 **** /* Return a newly allocated copy of STR, or 0 if out of memory. */ char * ! strdup (str) char *str; { char *newstr; --- 26,34 ---- /* Return a newly allocated copy of STR, or 0 if out of memory. */ + #ifndef linux /* don't need this with gcc2 any more */ char * ! strdup (str) /* should be strdup(const char *str) */ char *str; { char *newstr; *************** *** 37,39 **** --- 38,42 ---- strcpy (newstr, str); return newstr; } + + #endif /* !linux */