Ignore:
Timestamp:
Jan 28, 2016, 5:02:13 PM (8 years ago)
Author:
Laurent Fairhead
Message:

Merged trunk changes r2396:2434 into testing branch

Location:
LMDZ5/branches/testing
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/branches/testing

  • LMDZ5/branches/testing/tools/compare_real.py

    r2160 r2435  
    1 #!/usr/bin/env python
     1"""This script should be called by "diffdef.sh". It operates on
     2different lines with common variables. It requires version 2.7 or
     3higher of Python (it also works with Python 3).
    24
    3 # Author: Lionel GUEZ
    4 
    5 # This script should be called by "diffdef.sh". It operates on
    6 # different lines with common variables. It requires version 2.7 or
    7 # higher of Python (it also works with Python 3).
     5Author: Lionel GUEZ"""
    86
    97import sys, os.path
  • LMDZ5/branches/testing/tools/diffdef.sh

    r2160 r2435  
    22# Author: Lionel GUEZ
    33
    4 # This script compares files "*.def" other than "traceur.def" and
    5 # "out.def" in two directories. The script uses GNU versions of the
    6 # utilities cut, sort and uniq.
     4# This script compares files "*.def" other than "*traceur.def" and
     5# "out.def" in two directories.
     6
     7# This script uses GNU versions of the utilities cut, sort and uniq,
     8# and calls a Python script.
    79
    810# See guide:
     
    1820
    1921##set -x
     22
     23type python3 >/dev/null 2>&1
     24if (($? == 0))
     25then
     26    my_python=python3
     27else
     28    my_python=python
     29fi
     30
    2031set -e
    2132
     
    3344  rm -f all.def
    3445  echo "def files in $my_directory:"
    35   ls !(traceur|out).def
     46  ls !(*traceur|out).def
    3647
    3748  # Concatenate and format the def files:
    38   cat !(traceur|out).def | tr -d " " | grep -v -E '(^#|^!|INCLUDEDEF|^$)' \
     49  cat !(*traceur|out).def | tr '\r' '\n' | tr -d " " \
     50      | grep -v -E '(^#|^!|INCLUDEDEF|^$)' \
    3951      | tr '[:lower:]' '[:upper:]' | sed 's/=[NF]$/=FALSE/' \
    4052      | sed 's/=[YT]$/=TRUE/' | sort >all.def
     
    5163      cat plouf_$$
    5264      rm plouf_$$
     65      rm all.def
    5366      exit 1
    5467  fi
     
    8194done
    8295
    83 $script_dir/compare_real.py $*
     96$my_python $script_dir/compare_real.py $*
    8497sort common_lines --output=common_lines # was modified by the Python script
    8598echo "Created files \"./common_lines\" and \"./uniq_val\"."
Note: See TracChangeset for help on using the changeset viewer.