scc

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

0011-delete.sh (422B)


      1 #!/bin/sh
      2 
      3 
      4 set -e
      5 
      6 trap "rm -f file.a; exit" 0 2 3
      7 
      8 ############################################################################
      9 #no members
     10 cp master.a file.a
     11 
     12 last=`ls -l file.a | awk '{print $6,$7,$8}'`
     13 
     14 if ! scc-ar -dv file.a
     15 then
     16 	echo ar returned with error when no members
     17 	exit 1
     18 fi
     19 
     20 now=`ls -l file.a | awk '{print $6,$7,$8}'`
     21 if test "$now" != "$last"
     22 then
     23 	echo empty ar -d modified the archive >&2
     24 	exit 1
     25 fi