]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - include/MKkey_defs.sh
ncurses 5.6 - patch 20070310
[ncurses.git] / include / MKkey_defs.sh
index 655078b924cfcf13d3f655e92aa73cff4971abec..b3cb4f7f72cbd6b721a2d48a0d7e6dc5f5582814 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
-# $Id: MKkey_defs.sh,v 1.10 2002/09/28 23:32:16 tom Exp $
+# $Id: MKkey_defs.sh,v 1.14 2003/12/06 17:10:09 tom Exp $
 ##############################################################################
-# Copyright (c) 2001,2002 Free Software Foundation, Inc.                     #
+# Copyright (c) 2001-2002,2003 Free Software Foundation, Inc.                #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
@@ -30,7 +30,7 @@
 #
 # MKkey_defs.sh -- generate function-key definitions for curses.h
 #
-# Author: Thomas E. Dickey <dickey@herndon4.his.com> 2001
+# Author: Thomas E. Dickey 2001
 #
 # Extract function-key definitions from the Caps file
 #
@@ -49,10 +49,14 @@ trap 'rm -f $data pass[1234]_$$' 0 1 2 5 15
 if sort -k 6 $DATA >$data 2>/dev/null
 then
        # POSIX
-       sed -e 's/[     ]\+/    /g' < $DATA |sort -n -k 6 >$data
-else
+       sed -e 's/[     ][      ]*/     /g' < $DATA |sort -n -k 6 >$data
+elif sort -n +5 $DATA >$data 2>/dev/null
+then
        # SunOS (and SVr4, marked as obsolete but still recognized)
-       sed -e 's/[     ]\+/    /g' < $DATA |sort -n +5 >$data
+       sed -e 's/[     ][      ]*/     /g' < $DATA |sort -n +5 >$data
+else
+       echo "Your sort utility is broken.  Please install one that works." >&2
+       exit 1
 fi
 
 # add keys that we generate automatically: