]> icculus.org git repositories - icculus/iodoom3.git/blob - neo/sys/linux/pk4/syncfromlist.sh
Various Mac OS X tweaks to get this to build. Probably breaking things.
[icculus/iodoom3.git] / neo / sys / linux / pk4 / syncfromlist.sh
1 #!/bin/sh
2 base=/home/doom-grp/Doom/base
3 host=timo@idnet.ua-corp.com
4 srvscript=/var/local/builds/misc/packup.sh
5
6 maindir=$(pwd)
7 cd $(dirname $1)
8 source=$(pwd)/$(basename $1)
9 outdir=$(pwd)
10 cd $maindir
11
12 echo "list of files : $source"
13 echo "base          : $base"
14 echo "host          : $host"
15 echo "server script : $srvscript"
16 echo "press enter"
17 read
18
19 flip -u $source
20
21 (
22 cd $base
23 cat $source | while read i ; do find . -ipath "./$i" | cut -b 3- ; done | tee $outdir/matched.cased.log
24 )
25
26 # find the no match, not even case sensitive
27 diff -ui $source $outdir/matched.cased.log | grep ^- | cut -b 2- | tee $outdir/missing.log
28
29 scp $outdir/missing.log $host:/home/timo/missing.log
30 ssh $host $srvscript /home/timo/dl.zip /home/timo/missing.log
31 rm $outdir/dl.zip
32 scp $host:/home/timo/dl.zip $outdir
33 scp $host:/home/timo/cased.log $outdir/missing.cased.log
34 (
35 cd $base
36 unzip $outdir/dl.zip
37
38 # merge both lists into a single thing
39 rm $outdir/dl.zip
40 cat $outdir/missing.cased.log | zip $outdir/dl.zip -@
41 cat $outdir/matched.cased.log | zip $outdir/dl.zip -@
42 )