From 6507e789c65228ad014033da7ec09609266fa8aa Mon Sep 17 00:00:00 2001 From: imp Date: Thu, 21 Oct 2010 17:23:48 +0000 Subject: 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. Submitted by: John Hixson PR: 151461 --- .../pc-sysinstall/backend-query/list-components.sh | 37 +++++++++++----------- 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'usr.sbin/pc-sysinstall') diff --git a/usr.sbin/pc-sysinstall/backend-query/list-components.sh b/usr.sbin/pc-sysinstall/backend-query/list-components.sh index 294faad..a7cde89 100755 --- a/usr.sbin/pc-sysinstall/backend-query/list-components.sh +++ b/usr.sbin/pc-sysinstall/backend-query/list-components.sh @@ -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 -- cgit v1.1