[comp.os.minix] makepost

ast@cs.vu.nl (Andy Tanenbaum) (10/05/89)

I am starting to think about making the 1.4b posting.  Not that I am ready
to do it, just think about it.  To minimize the chance of my screwing up,
I am trying to get the computer to help.  Basically, I have two trees on
my Sun, .../minix/tape3 and .../minix/tape4.  I wrote a shell script to
take two corresponding directories, and compare all the files in the new
directory to the old one.  Files that are brand new are copied to a
scratch directory. Files that are modified have their cdif copied to the
scratch directory (unless the new file is smaller than the cdif).  Then
the .cdif files are catted to something.cdif.  This and the new files are
shar'ed, compressed and uuencoded.  This monster is then split
into mail-size chunks and copied to my posting directory, with cut lines
appended automatically top and bottom to each chunk.

When you receive this stuff, you will see things like:
  commands.xaa  commands.xab   commands.xac

The idea is that you do the following.

1. Copy your V1.3/commands to V1.4b/commands  (all the files).

2. Copy commands.x?? to V1.4b/commands.

3. Type: cd V1.4b/commands

4. Type: install commands   where 'install' is the following shell script:

cleanit $1.x??		# strip off headers and trailers
cat $1.x?? | uudecode	# get the compressed shar file
compress -cd $1.sh.Z|sh	# extract all the files
patch <$1.cdif		# patch everything
rm $1.x?? $1.sh.Z $1.sh

My hope is that this will minimize work for everyone, be acceptable to
bitnet, and minimize network bandwidth.  My 'makepost' shell script is
below.  If anyone has suggestions or comments on this whole process, let
me know or post something.  However, don't salivate.  I am not ready with
1.4b yet.  I will ring the bell when it is time to salivate.

Andy Tanenbaum

# makepost new old postdir
# prepares a posting and puts the files in postdir
# All three arguments must be absolute path names

new=$1
old=$2
post=$3
dir=`basename $new`
case $# in
3)	echo "" >/dev/null ;;
*)	echo Usage: makepost newdir olddir postdir
		exit 1 ;;
esac

rm -rf W$$
mkdir W$$
cd W$$
for i in $new/*
do  b=`basename $i`
    if test -d $i
	then 
	    # It is a directory.  Skip
	    echo $i is a dir "(skipping)"
#	    makepost $new/$b $old/$b $post
#	    exit 0
	else
	    # It is a regular file.  See if it existed last time.
	    if test -r $old/$b
		then 
		    # It existed last time. Did it change?
		    if cmp -s $new/$b $old/$b
			then
			    # File didn't change.  Don't do anything.
			    echo $b is unchanged
			else
			    # File did change.
			    echo $b has been modified
			    cdiff $old/$b $new/$b >$b.CD
			    if bigger $b.CD $new/$b
				then cp $new/$b .
echo $b.CD bigger than $new/$b
ls -l $b.CD $new/$b
				     rm $b.CD
			    fi
		    fi
		else
		    # This file is new.
		    cp $new/$b .
	    fi
   fi
done

# At this point, W$$ contains *.CD and new files (*.c, *.h etc).
crc * >Crc
cat *.CD >$dir.cdif
if test -s $dir.cdif
    then echo "" >/dev/null
    else rm $dir.cdif
fi
ls -l			# for the log
rm -rf *.CD
shar * >/tmp/$dir.sh
rm *
compress -fc /tmp/$dir.sh >$dir.sh.Z
crc *Z
rm /tmp/$dir.sh
uuencode $dir.sh.Z <$dir.sh.Z >$dir.uue
rm $dir.sh.Z
split -800 $dir.uue
echo "------------------------- cut here -------------------------" >cutline
for j in xa?
do cat cutline $j cutline >$post/$dir.$j
done
rm -rf W$$
exit 0

paula@bcsaic.UUCP (Paul Allen) (10/06/89)

In article <3493@ast.cs.vu.nl> ast@cs.vu.nl (Andy Tanenbaum) writes:
> [ about posting 1.4b as uuencoded compressed shars ]
>My hope is that this will minimize work for everyone, be acceptable to
>bitnet, and minimize network bandwidth.  

I was about to write something about how terrible it is to post
uuencoded compressed stuff, but then I re-read Andy's article and
noticed the bit about 'being acceptable to bitnet'.  <Sigh>
I suppose I could put up with the evil of uuencoded postings if
it means our unfortunate friends on bitnet will have access to
1.4b.  Is there any way that the 1.4b stuff can go out to the
mainstream Usenet in clear-text and get uuencoded by the bitnet
gateway?

Paul Allen
-- 
------------------------------------------------------------------------
Paul L. Allen                       | pallen@atc.boeing.com
Boeing Advanced Technology Center   | ...!uw-beaver!bcsaic!pallen

ncoverby@ndsuvax.UUCP (Glen Overby) (10/12/89)

In article <15538@bcsaic.UUCP> paula@bcsaic.UUCP (Paul Allen) writes:
>[...]  Is there any way that the 1.4b stuff can go out to the
>mainstream Usenet in clear-text and get uuencoded by the bitnet
>gateway?

Well, yes, but another list should really be set up for that and
*everything* posted would have to go thru it (a blind encoder).  Right now,
I dont think we're set up to do the gatewaying here.  

I have tried to maintain an archive containing files which should be usable
with no problems to anybody on Bitnet (the <tabs> are not expanded).  A few
people have had problems, but in the end I think most of them worked out OK.
I don't know of anybody who had to give up because of transport problems.
So Bitnet *is* usable, just not easily.

By the way, I do intend to place copies of the 1.4b postings on
vm1.nodak.edu (aka ndsuvm1 on bitnet) as soon as I get them via News, so
anybody who misses a piece can get it from there rather than asking the
entire net to mail them a copy.

Other caveats about Bitnet postings: uuencode will use <space> (0x20) as a
clear character.  This is not so at the end of a line since RSCS (the bitnet
transport protocol, etc. machine) will remove them.  There was a fix posted
to the net soon after 1.3d came out.  All the Bitneters will need to have
that.
-- 
		Glen Overby	<ncoverby@plains.nodak.edu>
	uunet!ndsuvax!ncoverby (UUCP)	ncoverby@ndsuvax (Bitnet)