*BSD News Article 11939


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA2247 ; Mon, 01 Mar 93 10:50:54 EST
Path: sserve!manuel.anu.edu.au!munnari.oz.au!bruce.cs.monash.edu.au!monu6!escargot!minyos.xx.rmit.OZ.AU!s902113
From: s902113@minyos.xx.rmit.OZ.AU (Luke Mewburn)
Newsgroups: comp.os.386bsd.questions
Subject: Re: extract ??
Date: 26 Feb 1993 18:31:45 GMT
Organization: RMIT Computer Centre
Lines: 118
Message-ID: <1mlnmhINNhq@escargot.xx.rmit.OZ.AU>
References: <C2v7AD.LA@news.cso.uiuc.edu>
NNTP-Posting-Host: minyos.xx.rmit.oz.au

[ note, I tried emailing, but it bounced, so I post instead ]

lfm54477@ih-nxt07 (Libor F. Michalek) writes:

> I accidentaly erased extract ( I know it was a dumb thing to do ) and
>now I need to extract the src distribution. I've looked for it but I
>can't find it. Could somebody please tell me where to get it from or
>how to unpack the distribution without it or mail me a copy of extract.

>Thank You

>Libor
>email: libor@ncsa.uiuc.edu


Here is a script I wrote to extract the src dist, but should be able
to extract the bindist AS LONG AS cpio/sh/expr/zcat, etc exist on the
boot floppy, AND you are extracting from the other floppy drive (cause
the script needs to run commands from somewhere :)

You'll have to change some of the parameters in it.

Try it out, and mail back any comments.

NOTE: the following commands need to be on the boot volume:
    sh, cd, rm, mcopy, cat, zcat, cpio, tee, expr

[
    I actually wrote it from a hacked up script which took my version
    of the srcdist (a tar.gzipped volume in about 10 parts, each 1.44Mb
    long, and then decided ``let's add bells & whistles and post it''.
    This is the 2nd post of this, the first was about late January.
]

--- cut here --- file: zextr
#!/bin/sh
#
# zextr	- extracts files from 386bsd distributions without need for
#	  temporary storage space
#
# Copyright (C) 1993, Luke Mewburn (zak@rmit.edu.au)
#
# You are free to distribute/modify under the conditions of the
# GNU license version 2 (or later).
#
# Version: 1.2 (930124)
#
# Needs the following commands:
#	sh, cd, rm, mcopy, cat, zcat, cpio, tee, expr
#
# To use:
#	- change the settings as described below
#	- copy all the files in ascending order to floppies
#	- insert first disk, and run script.
#	- when both the floppy and HD lights are out (i.e, the
#	  machine appears to do nothing for a few seconds), swap
#	  disks, and press return.
#
# -----------
#
# Set:
#  NUMPERDISK	# of files per disk		(eg. 5 / 1.2MB, 6 / 1.44MB )
#  PREFIX	prefix of the distribution	(eg, src01)
#  NUMFILES	# of files in distribution	(eg, 57)
#  CPIOCMD	cmd to use with cpio (with -iv)	(eg, t to list, adm to extract)
#  DRIVE	drive to mcopy from		(eg, a)
#  DESTDIR	where to extract to		(eg, /mnt for bin, / for src)
#  LOGFILE	where output is to be tee-ed to	(eg, /var/tmp/extractlog)
#
# -----------
#

NUMPERDISK=6
PREFIX=bin01
NUMFILES=57
#CPIOCMD=adm
CPIOCMD=t
DRIVE=a
DESTDIR=/mnt
LOGFILE=${DESTDIR}/${PREFIX}_zextr_log


#
# the core code follows
#

NPDminus1=`expr $NUMPERDISK - 1`
cd $DESTDIR

num=0
while [ $num -ne $NUMFILES ];
do
    if [ $num -lt 10 ]; then
	i=${PREFIX}.0$num
    else
	i=${PREFIX}.$num
    fi
    rm -f $i
    mcopy -n ${DRIVE}:$i . >/dev/null
    if [ $? -ne 0 ]; then
	echo 1>&2 Mcopy died on file $i, exitting.
	exit 10;
    fi
    cat $i
    if [ `expr $num % $NUMPERDISK` -eq $NPDminus1 ]; then
	read next > /dev/null
    fi
    rm -f $i
    num=`expr $num + 1`
done | zcat | cpio -iv$CPIOCMD #| tee -a $LOGFILE
--- cut here ---


--
               Luke Mewburn [Zak]     zak@rmit.edu.au
   "Nobody dies on the Discworld, they just become dimensionally
    disadvantaged."         Terry Pratchett in alt.fan.pratchett