You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
668B

  1. #!/bin/sh
  2. PNAME=${PNAME:-./gpsbabel}
  3. DIFF=${DIFF:-diff}
  4. TMPDIR=${GBTEMP:-/tmp}/gpsbabel.$$
  5. mkdir -p $TMPDIR
  6. trap "rm -fr $TMPDIR" 0 1 2 3 15
  7. #
  8. # This is nasty. If we have a dictionary handy, treat it as a list of
  9. # waypoints and reduce all the names to eight characters. Fewer chars
  10. # results in lost waypoints currently and that's a defect.
  11. #
  12. DICT=/usr/share/dict/words
  13. if [ -f $DICT ];
  14. then
  15. WORDS=`cat $DICT | wc -l`
  16. SWORDS=`${PNAME} -i gpsdrive -f $DICT -o gpsdrive,snlen=8 -F /dev/fd/1 |
  17. wc -l`
  18. if [ $WORDS -ne $SWORDS ];
  19. then
  20. echo "Shortname reduction failed."
  21. exit 1
  22. fi
  23. fi
  24. exit 0