scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

0026-extract.sh (716B)


      1 #!/bin/sh
      2 
      3 set -e
      4 
      5 trap 'rm -f file* $tmp1' EXIT
      6 trap 'exit $?' HUP INT TERM
      7 
      8 tmp1=tmp1.$$
      9 
     10 ############################################################################
     11 #extract all members
     12 
     13 cp master.a file.a
     14 
     15 $EXEC scc ar -xv file.a file1 file2 file3
     16 cat file1 file2 file3 > $tmp1
     17 
     18 diff -u $tmp1 - <<EOF
     19 This is the first file,
     20 and it should go in the
     21 first position in the archive.
     22 But this other one is the second one,
     23 and it shouldn't go in the first position
     24 because it should go in the second position.
     25 and at the end, this is the last file
     26 that should go at the end of the file,
     27 thus it should go in the third position.
     28 EOF
     29 
     30 if test `ls file? | wc -l` -ne 3
     31 then
     32 	echo some error extracting files
     33 	exit 1
     34 fi