From nobody@FreeBSD.org  Tue Oct 12 22:10:49 2010
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 CD1B4106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 12 Oct 2010 22:10:49 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id A0AE28FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 12 Oct 2010 22:10:49 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CMAnnU012780
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 12 Oct 2010 22:10:49 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o9CMAn7g012757;
	Tue, 12 Oct 2010 22:10:49 GMT
	(envelope-from nobody)
Message-Id: <201010122210.o9CMAn7g012757@www.freebsd.org>
Date: Tue, 12 Oct 2010 22:10:49 GMT
From: John Hixson <john@ixsystems.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: pc-sysinstall patch that fixes component listing if components don't exist
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         151416
>Category:       bin
>Synopsis:       [patch] pc-sysinstall(8) patch that fixes component listing if components don't exist
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    imp
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 12 22:20:05 UTC 2010
>Closed-Date:    Thu Oct 21 11:24:24 MDT 2010
>Last-Modified:  Thu Oct 21 11:24:24 MDT 2010
>Originator:     John Hixson
>Release:        9.0-CURRENT
>Organization:
iXsystems
>Environment:
FreeBSD thinkbsd 9.0-CURRENT FreeBSD 9.0-CURRENT #6: Sat Sep 25 05:21:08 PDT 2010     john@thinkbsd:/usr/obj/usr/src/sys/THINKBSD  amd64

>Description:
This patch will only list components if the directory exists. The directory exist on PC-BSD but not FreeBSD, so an extra check is made. 
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -urN usr.sbin/pc-sysinstall.orig/backend-query/list-components.sh usr.sbin/pc-sysinstall/backend-query/list-components.sh
--- usr.sbin/pc-sysinstall.orig/backend-query/list-components.sh	2010-10-12 14:53:43.000000000 -0700
+++ usr.sbin/pc-sysinstall/backend-query/list-components.sh	2010-10-12 15:06:23.000000000 -0700
@@ -32,23 +32,24 @@
 
 echo "Available Components:"
 
-cd ${COMPDIR}
-for i in `ls -d *`
-do
-  if [ -e "${i}/component.cfg" -a -e "${i}/install.sh" -a -e "${i}/distfiles" ]
-  then
-    NAME="`grep 'name:' ${i}/component.cfg | cut -d ':' -f 2`"
-    DESC="`grep 'description:' ${i}/component.cfg | cut -d ':' -f 2`"
-    TYPE="`grep 'type:' ${i}/component.cfg | cut -d ':' -f 2`"
-    echo " "
-    echo "name: ${i}"
-    echo "desc:${DESC}"
-    echo "type:${TYPE}"
-    if [ -e "${i}/component.png" ]
+if [ -d "${COMPDIR}" ]
+then
+  cd ${COMPDIR}
+  for i in `ls -d *`
+  do
+    if [ -e "${i}/component.cfg" -a -e "${i}/install.sh" -a -e "${i}/distfiles" ]
     then
-      echo "icon: ${COMPDIR}/${i}/component.png"
+      NAME="`grep 'name:' ${i}/component.cfg | cut -d ':' -f 2`"
+      DESC="`grep 'description:' ${i}/component.cfg | cut -d ':' -f 2`"
+      TYPE="`grep 'type:' ${i}/component.cfg | cut -d ':' -f 2`"
+      echo " "
+      echo "name: ${i}"
+      echo "desc:${DESC}"
+      echo "type:${TYPE}"
+      if [ -e "${i}/component.png" ]
+      then
+        echo "icon: ${COMPDIR}/${i}/component.png"
+      fi
     fi
-  fi
-
-done
-
+  done
+fi


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->imp 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Oct 16 10:08:47 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=151416 
State-Changed-From-To: open->closed 
State-Changed-By: imp 
State-Changed-When: Thu Oct 21 11:24:10 MDT 2010 
State-Changed-Why:  
fixed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=151416 
>Unformatted:
