Path: utzoo!dciem!nrcaer!scs!spl1!laidbak!att!pacbell!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!ukc!eag From: lmjm@doc.ic.ac.uk (Lee McLoughlin) Newsgroups: comp.os.minix Subject: Re: Wanted: pdtar Message-ID: <309@gould.doc.ic.ac.uk> Date: 1 Jun 88 16:25:05 GMT Article-I.D.: gould.309 References: <2654@louie.udel.EDU> Reply-To: lmjm@doc.ic.ac.uk (Lee McLoughlin) Organization: Dept. of Computing, Imperial College, London, UK. Lines: 112 Thanks to everyone for there help with pdtar. Here is what I finally did to be able to recompile it under minix 1.2 with the 1.2 C compiler. Take the original pdtar from a source archive. 3631@uunet.UU.NET v12i068: Public domain TAR, Part01/03 3632@uunet.UU.NET v12i069: Public-domain TAR, Part02/03 3633@uunet.UU.NET v12i070: Public-domain TAR, Part03/03 Take the fixes to pdtar for minix from a minix source archive. 950@uokmax.UUCP PD Tar for MINIX -- how to get it working 951@uokmax.UUCP changes for PD-Tar, part 1 of 3 953@uokmax.UUCP changes needed for PD-Tar, part 2 of 3 955@uokmax.UUCP changes needed for PD Tar, part 3 of 3 Then unpack the shar lump at the end of this message and read the parts. I use the pd make not the minix one - it shouldn't make any difference - I hope! All the assembler generated is munged to repair the parts causing the problems. There is one additioinal patch (the cast to long in list.c) to overcome a compiler bug. You still have to compile asfix by hand before running make: cc -o asfix asfix.c echo x - Makefile.note gres '^X' '' > Makefile.note << '/' X# Arrgggg what is happening under minix! what is wrong with "x = y" anyhow? X# Patch the output (see sfix and asfix.c) X.c.s: X $(CC) $(CFLAGS) -S $*.c X sfix $*.s / echo x - list.note gres '^X' '' > list.note << '/' X for (i = sizeof(*header); --i >= 0;) { X /* X * We can't use unsigned char here because of old compilers, X * e.g. V7. X */ X#ifdef ORIG X sum += 0xFF & *p++; X#else X sum += 0xFF & (long)*p++; X#endif X } X X /* Adjust checksum to count the "chksum" field as blanks. */ / echo x - asfix.c gres '^X' '' > asfix.c << '/' X/* X * Look for lines like: X * new = old X * Followed by X * old: X * Zap the former and insert: X * new: X * Just before the later X * L.M.McLoughlin X */ X#include X Xmain() X{ X extern char *index(); X char buf[ BUFSIZ ]; X char new[ 10 ], old[ 10 ]; X char afix = 0; X X while( gets( buf ) ){ X/* Xprintf( "buf=%s afix=%d old=%s new=%s \n", buf, afix, old, new ); X*/ X /* Old label found */ X if( afix && strncmp( buf, old, strlen( old ) ) == 0 ){ X puts( new ); X afix = 0; X } X /* An '=' found? */ X else if( index( buf, '=' ) != NULL ){ X /* Get the new and old labels */ X if( sscanf( buf, "%s = %s", new, old ) != 3 ){ X fprintf( stderr, "bad = line\n" ); X exit( 0 ); X } X /* Stick on the trailing :'s */ X strcat( new, ":" ); X strcat( old, ":" ); X X afix = 1; X continue; /* Don't print this line */ X } X puts( buf ); X } X} X / echo x - sfix gres '^X' '' > sfix << '/' X# change some symbols to overcome asld bug (I think) Xf=`basename $1 .s` Xlibupack < $1 | asfix | libpack > _$1 Xmv _$1 $1 / -- UKUUCP SUPPORT Lee McLoughlin "What you once thought was only a nightmare is now a reality!" Janet: lmjm@uk.ac.ic.doc, lmcl@uk.ac.ukc DARPA: lmjm@doc.ic.ac.uk (or lmjm%uk.ac.ic.doc@nss.cs.ucl.ac.uk) Uucp: lmjm@icdoc.UUCP, ukc!icdoc!lmjm