run_keydiff 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/bash
  2. ################################################################################
  3. # HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. ################################################################################
  17. if [ $# -lt 5 ]; then
  18. echo usage: $0 workdir newkeyfile oldkeyfile patchfile flagfile
  19. exit 1
  20. fi
  21. cd `dirname $0`
  22. deploydir=`pwd`
  23. mkdir -p $1
  24. cd $1
  25. rm -f $5
  26. export PATH=$PATH:$deploydir
  27. export LD_LIBRARY_PATH=$deploydir
  28. keydiff -o -c $3 $2 $4 &>$5.log
  29. errcode = $?
  30. if [ $errcode -ne 0 ]; then
  31. echo error=$errcode deploydir=$deploydir >> $5.log
  32. echo cmd = keydiff -o -c $3 $2 $4 >> $5.log
  33. fi
  34. mv -f $5.log $5