Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!ginosko!uunet!mcsun!hp4nl!star.cs.vu.nl!ast@cs.vu.nl From: ast@cs.vu.nl (Andy Tanenbaum) Newsgroups: comp.os.minix Subject: makepost Message-ID: <3493@ast.cs.vu.nl> Date: 4 Oct 89 21:57:30 GMT Sender: ast@cs.vu.nl Reply-To: ast@cs.vu.nl (Andy Tanenbaum) Organization: VU Informatica, Amsterdam Lines: 115 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