head	1.5;
access;
symbols;
locks; strict;
comment	@# @;


1.5
date	2011.11.22.10.24.14;	author dunc;	state Exp;
branches;
next	1.4;

1.4
date	99.09.30.06.52.39;	author roedc;	state Exp;
branches;
next	1.3;

1.3
date	99.09.30.06.00.55;	author roedc;	state Exp;
branches;
next	1.2;

1.2
date	99.09.29.06.59.25;	author roedc;	state Exp;
branches;
next	1.1;

1.1
date	99.09.28.07.46.05;	author roedc;	state Exp;
branches;
next	;


desc
@@


1.5
log
@grave elimination
@
text
@#!/bin/sh
found=false;
i=$(basename $1 .tar.gz)
if [ $i != $1 ];then
  for j in $i/README.$i $i/README ./$i/README.$i;do
    if tar -tzf $1 $j >/dev/null 2>&1;then
      found=true
      break
    fi
  done
  if $found;then
    tar -xOzf $1 $j
    exit
  else
    echo no $i/README.$i or $i/README or ./$i/README.$i in $1
    echo
    tar -tzf $1
    exit 1
  fi
fi
i=$(basename $1 .zip)
if [ $i != $1 ];then
  for j in $i/README $i/README.$i ./$i/README.$i;do
    if unzip -t $1 $j >/dev/null 2>&1;then
      found=true
      break
    fi
  done
  if $found;then
    unzip -p $1 $j
  else
    echo no $i/README or $i/README.$i or ./$i/README.$i in $1
    echo
    unzip -t $1
    exit 1
  fi
  exit
fi
echo $1 not a recognised format
exit 1
@


1.4
log
@Can have ./$i/README.$i in tgz files too
@
text
@d3 1
a3 1
i=`basename $1 .tar.gz`
d21 1
a21 1
i=`basename $1 .zip`
@


1.3
log
@Need to look for different paths in tgz files too
@
text
@d5 1
a5 1
  for j in $i/README.$i $i/README;do
d15 1
a15 1
    echo no $i/README.$i or $i/README in $1
@


1.2
log
@Cater fot .zip patch files (3 possible README paths)
@
text
@d2 1
d5 15
a19 2
  tar -xOzf $1 $i/README.$i
  exit
a22 1
  found=false;
@


1.1
log
@Initial revision
@
text
@d7 19
@
