From nobody@FreeBSD.org  Fri Feb 11 15:12:41 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E2FBC106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 11 Feb 2011 15:12:41 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id D1E6B8FC18
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 11 Feb 2011 15:12:41 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p1BFCfSm039211
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 11 Feb 2011 15:12:41 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p1BFCfOH039207;
	Fri, 11 Feb 2011 15:12:41 GMT
	(envelope-from nobody)
Message-Id: <201102111512.p1BFCfOH039207@red.freebsd.org>
Date: Fri, 11 Feb 2011 15:12:41 GMT
From: Kris Moore <kmoore@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: bin: usr.sbin/pc-sysinstall - Fixed sorting for keyboard layouts
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         154687
>Category:       bin
>Synopsis:       bin: usr.sbin/pc-sysinstall - Fixed sorting for keyboard layouts
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jpaetzel
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 11 15:20:07 UTC 2011
>Closed-Date:    Fri Feb 18 15:13:41 UTC 2011
>Last-Modified:  Fri Feb 18 15:20:09 UTC 2011
>Originator:     Kris Moore
>Release:        9.0-Current
>Organization:
PC-BSD / iXsystems
>Environment:
FreeBSD 9.0-CURRENT
>Description:
This small fix is for the sorting of available keyboard layouts to a more sane default.  
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ruN usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh
--- usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh	2011-01-27 10:26:03.667376965 -0500
+++ usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh	2011-01-27 11:04:16.000000000 -0500
@@ -26,6 +26,12 @@
 # $FreeBSD$
 
 FOUND="0"
+TMPLIST="/tmp/.xkeyList.$$"
+XLST="/usr/local/share/X11/xkb/rules/xorg.lst"
+
+if [ ! -e "${XLST}" ] ; then
+  exit 1
+fi
 
 # Lets parse the xorg.list file, and see what layouts are supported
 while read line
@@ -36,9 +42,9 @@
     echo $line | grep '! ' >/dev/null 2>/dev/null
     if [ "$?" = "0" ]
     then
-      exit 0
+	break
     else 
-      echo "$line"
+      echo "$line" >> ${TMPLIST}
     fi 
   fi 
 
@@ -51,6 +57,13 @@
     fi 
   fi
 
-done < /usr/local/share/X11/xkb/rules/xorg.lst
+done < $XLST
+
+# Display the output, with us English as the first entry
+echo "us		U.S. English"
+sort -b -d +1 $TMPLIST
+
+# Delete the tmp file
+rm $TMPLIST
 
 exit 0


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->jpaetzel 
Responsible-Changed-By: jpaetzel 
Responsible-Changed-When: Fri Feb 11 15:45:42 UTC 2011 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=154687 
State-Changed-From-To: open->closed 
State-Changed-By: jpaetzel 
State-Changed-When: Fri Feb 18 15:13:21 UTC 2011 
State-Changed-Why:  
Committed, thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=154687 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/154687: commit references a PR
Date: Fri, 18 Feb 2011 15:13:14 +0000 (UTC)

 Author: jpaetzel
 Date: Fri Feb 18 15:13:07 2011
 New Revision: 218802
 URL: http://svn.freebsd.org/changeset/base/218802
 
 Log:
   Sort available keyboard layouts to a more sane default.
   
   PR:	bin/154687
   Submitted by:	kmoore
   Approved by:	kib (mentor, implicit)
 
 Modified:
   head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh
 
 Modified: head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh
 ==============================================================================
 --- head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh	Fri Feb 18 15:06:35 2011	(r218801)
 +++ head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh	Fri Feb 18 15:13:07 2011	(r218802)
 @@ -26,6 +26,12 @@
  # $FreeBSD$
  
  FOUND="0"
 +TMPLIST="/tmp/.xkeyList.$$"
 +XLST="/usr/local/share/X11/xkb/rules/xorg.lst"
 +
 +if [ ! -e "${XLST}" ] ; then
 +  exit 1
 +fi
  
  # Lets parse the xorg.list file, and see what layouts are supported
  while read line
 @@ -36,9 +42,9 @@ do
      echo $line | grep '! ' >/dev/null 2>/dev/null
      if [ "$?" = "0" ]
      then
 -      exit 0
 +	break
      else 
 -      echo "$line"
 +      echo "$line" >> ${TMPLIST}
      fi 
    fi 
  
 @@ -51,6 +57,13 @@ do
      fi 
    fi
  
 -done < /usr/local/share/X11/xkb/rules/xorg.lst
 +done < $XLST
 +
 +# Display the output, with us English as the first entry
 +echo "us		U.S. English"
 +sort -b -d +1 $TMPLIST
 +
 +# Delete the tmp file
 +rm $TMPLIST
  
  exit 0
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
