home *** CD-ROM | disk | FTP | other *** search
/ ftp.uv.es / 2014.11.ftp.uv.es.tar / ftp.uv.es / pub / unix / elm-2.4-pl20.tar.Z / elm-2.4-pl20.tar / nls / Install next >
Text File  |  1991-10-20  |  1KB  |  51 lines

  1. # This shell script is called with 2 arguments as
  2. #    Install LangFile Gencat CatName
  3. # It reads the file LANGS, and parses the lines in it.  Each line
  4. # is assumed to have 2 fields.  The first is the relative directory
  5. # path to the message catalog input for a particular language.
  6. # The second field is the name of the destination directory into
  7. # which the resulting message catalog should be placed.  The second
  8. # argument to Install is used as the name of the message catalog
  9. # in each destination directory.
  10.  
  11. case $# in
  12.     3)    ;;
  13.     *)    echo "usage: $0 LangFile CatName"
  14.         exit 1
  15.         ;;
  16. esac
  17. LANGFILE=$1
  18. GENCAT=$2
  19. CATNAME=$3
  20.  
  21. if [ ! -r "$LANGFILE" ]
  22. then
  23.     echo "Can not open \"$LANGFILE\" for reading"
  24.     exit 1
  25. fi
  26.  
  27. while read InDir DestDir
  28. do
  29.     if [ -z "$InDir" ]
  30.     then
  31.         continue
  32.     fi
  33.     if [ "$InDir" = "#" ]
  34.     then
  35.         continue
  36.     fi
  37.     if [ ! -d $InDir ]
  38.     then
  39.         echo "\"$InDir\" is not a directory"
  40.         continue
  41.     fi
  42.     if [ ! -d $DestDir ]
  43.     then
  44.         echo "\"$DestDir\" is not a directory"
  45.         continue
  46.     fi
  47.     /bin/rm -f $DestDir/$CATNAME
  48.     echo "$GENCAT $DestDir/$CATNAME $InDir/*.m"
  49.     $GENCAT $DestDir/$CATNAME $InDir/*.m
  50. done < $LANGFILE
  51.