[comp.sys.amiga] Admin sources/binaries

donw@zehntel (Don White) (01/25/89)

[ From donw Fri Jan 13 12:31:46 1989
  To: zehntel!sun!applicon!ulowel!page
  Subject: could I help?
  Cc: donw ]   /* normal email didn't get through. might as well let the */
               /* line eater have some too.                              */

  Bob (or anyone who has such sources),

     I would like to [help] create an automated program for unshar and unzoo.
  Unfortunately, I have sources to neither program. Do you have sources or 
  a recommendation of where to look? What versions should be used?

     You are doing an outstanding job. Moderating appears(from the outside)
  to be a method of getting lots of responsibility, lots of gripes, and 
  sparse thanks.

     Here's my two bits.                   THANKS!

     Don White
     ulowel!applicon!sun!zehntel!donw
     PO Box 271177 Concord, CA. 94527-1177
     work (415) 932-6900 ext 281  home (415) 682-7124
 

waynet@mongo.uucp (Wayne Thompson) (01/28/89)

I threw these together a while back and they work for me.

Wayne

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create:
#	unpack
#	unshar
# This archive created: Fri Jan 27 08:05:48 1989
export PATH; PATH=/bin:/usr/bin:$PATH
echo shar: "extracting 'unpack'" '(660 characters)'
if test -f 'unpack'
then
	echo shar: "will not over-write existing file 'unpack'"
else
sed 's/^	X//' << \SHAR_EOF > 'unpack'
	X#! /bin/sh
	X# unpack archives - W. Thompson - 02/19/87
	X
	Xfor i
	Xdo
	X   while true
	X   do
	X      file=`ls $i*`
	X      case $file in
	X         *.tar)
	X			tar xvpf $file
	X			if [ $? -ne 0 ]
	X			then
	X			   exit
	X			else
	X			   break
	X			fi
	X			;;
	X         *.shar)
	X			unshar $file
	X			if [ $? -ne 0 ]
	X			then
	X			   exit
	X			else
	X			   break
	X			fi
	X			;;
	X	 *.zoo)
	X			zoo e $file
	X			if [ $? -ne 0 ]
	X			then
	X			   exit
	X			else
	X			   break
	X			fi
	X			;;
	X         *.Z)
	X			uncompress $file
	X			if [ $? -ne 0 ]
	X			then
	X			   exit
	X			fi
	X			;;
	X	 *.uu|*.uue)
	X			uudecode $file
	X			if [ $? -ne 0 ]
	X			then
	X			   exit
	X			fi
	X			mv $file $file.
	X			;;
	X         *)		break
	X			;;
	X      esac
	X   done
	Xdone
	X
SHAR_EOF
if test 660 -ne "`wc -c < 'unpack'`"
then
	echo shar: "error transmitting 'unpack'" '(should have been 660 characters)'
fi
chmod +x 'unpack'
fi
echo shar: "extracting 'unshar'" '(284 characters)'
if test -f 'unshar'
then
	echo shar: "will not over-write existing file 'unshar'"
else
sed 's/^	X//' << \SHAR_EOF > 'unshar'
	X#! /bin/sh
	X# unshar multiple files - 12/18/86 - W. Thompson
	Xfor i
	Xdo
	X   echo "<-<-<-<-<-<-<-<-<-<- USHARING '$i' ->->->->->->->->->->"
	X   awk '
	X   /^#/		{ pr = 1 }	# assumed bof
	X   /^:/		{ pr = 1 }	# assumed bof
	X   /^--$/	{ exit }	# assumed eof
	X   pr == 1	{ print }
	X   ' $i | sh
	Xdone
SHAR_EOF
if test 284 -ne "`wc -c < 'unshar'`"
then
	echo shar: "error transmitting 'unshar'" '(should have been 284 characters)'
fi
chmod +x 'unshar'
fi
exit 0
#	End of shell archive

waynet@mongo.uucp (Wayne Thompson) (01/28/89)

Also here's my automated archiving script for comp.{binaries,sources}.amiga.

Wayne

#! /bin/sh
# zoonew - archive news articles - W.Thompson - 08/27/88

trap 'touch /tmp/$$; rm -f /tmp/*$$; exit' 0 1 2 3 14 15

NEWSPATH=/usr/spool/news

GETNEW() {			# src_dir dest_dir
    echo "Checking $1..."
    DESTBASE=`basename $2`
    # find new files
    /bin/ls $1 > /tmp/news$$
	zoo l $2/$DESTBASE |
	awk '/[0-9]$/ { print $NF }' |
	sort > /tmp/my$$
    NEW=`comm -23 /tmp/news$$ /tmp/my$$ | sort -n`
    # archive files with subject line as comment
    for i in $NEW
    do
	subject=`awk '
	    /^Subject:/ {
		print substr ($0, 10);
		exit;
	    }
	' $1/$i`
	echo "archiving $1/$i..."
	echo $subject
	echo $subject | zoo acq: $2/$DESTBASE $1/$i 2> /dev/null
    done
    return
}

GETNEW $NEWSPATH/comp/binaries/amiga $HOME/news/amiga/bin
GETNEW $NEWSPATH/comp/sources/amiga  $HOME/news/amiga/src