scc

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

0039-update.sh (520B)


      1 #!/bin/sh
      2 
      3 set -e
      4 
      5 tmp1=`mktemp`
      6 tmp2=`mktemp`
      7 
      8 trap "rm -f file* $tmp1 $tmp2" 0 2 3 15
      9 
     10 ############################################################################
     11 #Update one member that already exist
     12 
     13 echo First > file1
     14 
     15 cp master.a file.a
     16 sleep 1
     17 touch file1
     18 scc-ar -ruv file.a file1
     19 
     20 scc-ar -p file.a file1 > $tmp1
     21 
     22 cat <<EOF > $tmp2
     23 First
     24 EOF
     25 
     26 cmp $tmp1 $tmp2
     27 
     28 echo Second > file1
     29 touch -t 197001010000 file.1
     30 scc-ar -ruv file.a file1
     31 
     32 scc-ar -p file.a file1 > $tmp1
     33 
     34 cat <<EOF > $tmp2
     35 First
     36 EOF
     37 
     38 cmp $tmp1 $tmp2