From nobody@FreeBSD.org  Wed Jul 21 04:05:50 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 0BB2D1065674
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 21 Jul 2010 04:05:50 +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 E3D838FC15
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 21 Jul 2010 04:05: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 o6L45nKT001220
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 21 Jul 2010 04:05:49 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o6L45n1l001219;
	Wed, 21 Jul 2010 04:05:49 GMT
	(envelope-from nobody)
Message-Id: <201007210405.o6L45n1l001219@www.freebsd.org>
Date: Wed, 21 Jul 2010 04:05:49 GMT
From: John Hixson <john@ixsystems.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: pc-sysinstall misc cleanup
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         148806
>Category:       bin
>Synopsis:       [patch] pc-sysinstall(8) misc cleanup
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    imp
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 21 04:10:01 UTC 2010
>Closed-Date:    Thu Aug 19 00:05:59 MDT 2010
>Last-Modified:  Thu Aug 19 06:10:04 UTC 2010
>Originator:     John Hixson
>Release:        9.0-CURRENT
>Organization:
iXsystems, Inc
>Environment:
FreeBSD thinkbsd 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Tue Jul 13 09:31:39 PDT 2010     john@thinkbsd:/usr/src/sys/amd64/compile/THINKBSD  amd64

>Description:
Some cleanup, changed some echo's to echo_log, check for PROGDIR so that different PROGDIR's can be set. 
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -urN usr.sbin/pc-sysinstall.ftpinstall/backend/functions-extractimage.sh usr.sbin/pc-sysinstall/backend/functions-extractimage.sh
--- usr.sbin/pc-sysinstall.ftpinstall/backend/functions-extractimage.sh	2010-07-15 18:40:46.000000000 -0700
+++ usr.sbin/pc-sysinstall/backend/functions-extractimage.sh	2010-07-19 16:59:43.000000000 -0700
@@ -123,7 +123,7 @@
 	cd "${dir}"
 	if [ -f "install.sh" ]
 	then
-	  echo "Extracting" `basename ${dir}`
+	  echo_log "Extracting" `basename ${dir}`
       echo "y" | sh install.sh >/dev/null
       if [ "$?" != "0" ]
       then
@@ -139,7 +139,7 @@
   cd "${KERNELS}"
   if [ -f "install.sh" ]
   then
-	echo "Extracting" `basename ${KERNELS}`
+	echo_log "Extracting" `basename ${KERNELS}`
     echo "y" | sh install.sh generic >/dev/null
     if [ "$?" != "0" ]
     then
@@ -155,7 +155,7 @@
   cd "${SOURCE}"
   if [ -f "install.sh" ]
   then
-	echo "Extracting" `basename ${SOURCE}`
+	echo_log "Extracting" `basename ${SOURCE}`
     echo "y" | sh install.sh all >/dev/null
     if [ "$?" != "0" ]
     then
@@ -259,8 +259,8 @@
 
 EOF
 
-   # Fetch the files via ftp
-   echo "$ INSTALL" | ftp -N "${NETRC}" "${FTPHOST}"
+  # Fetch the files via ftp
+  echo "$ INSTALL" | ftp -N "${NETRC}" "${FTPHOST}"
 
   # Done fetching, now reset the INSFILE to our downloaded archived
   INSFILE="${OUTFILE}" ; export INSFILE
diff -urN usr.sbin/pc-sysinstall.ftpinstall/backend/functions-packages.sh usr.sbin/pc-sysinstall/backend/functions-packages.sh
--- usr.sbin/pc-sysinstall.ftpinstall/backend/functions-packages.sh	2010-07-15 18:39:27.000000000 -0700
+++ usr.sbin/pc-sysinstall/backend/functions-packages.sh	2010-07-15 20:11:52.000000000 -0700
@@ -63,6 +63,22 @@
 	fetch_file "${INDEX_FILE}" "${CONFDIR}/" "0"
 };
 
+get_package_index_size()
+{
+	if [ -f "${CONFDIR}/INDEX" ]
+	then
+		SIZE=`ls -l ${CONFDIR}/INDEX | awk '{ print $5 }'`
+	else
+		get_ftp_mirror
+		FTPHOST="${VAL}"
+
+		FTPDIR="/pub/FreeBSD/releases/${FBSD_ARCH}/${FBSD_BRANCH}"
+		FTPPATH="ftp://${FTPHOST}${FTPDIR}/packages"
+
+		fetch -s "${FTPPATH}/INDEX.bz2"
+	fi
+};
+
 get_package_index()
 {
 	RES=0
diff -urN usr.sbin/pc-sysinstall.ftpinstall/pc-sysinstall/pc-sysinstall.sh usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh
--- usr.sbin/pc-sysinstall.ftpinstall/pc-sysinstall/pc-sysinstall.sh	2010-07-14 16:01:57.000000000 -0700
+++ usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh	2010-07-19 16:16:12.000000000 -0700
@@ -36,8 +36,11 @@
 # User-editable configuration variables
 
 # Set this to the program location
-PROGDIR="/usr/share/pc-sysinstall"
-export PROGDIR
+if [ -z "${PROGDIR}" ]
+then
+	PROGDIR="/usr/share/pc-sysinstall"
+	export PROGDIR
+fi
 
 # Set this to the components location
 COMPDIR="${PROGDIR}/components"


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->imp 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Jul 21 10:14:17 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=148806 
State-Changed-From-To: open->closed 
State-Changed-By: imp 
State-Changed-When: Thu Aug 19 00:05:45 MDT 2010 
State-Changed-Why:  
committed 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/148806: commit references a PR
Date: Thu, 19 Aug 2010 06:02:40 +0000 (UTC)

 Author: imp
 Date: Thu Aug 19 06:02:31 2010
 New Revision: 211487
 URL: http://svn.freebsd.org/changeset/base/211487
 
 Log:
   Some cleanup, changed some echo's to echo_log, check for PROGDIR so
   that different PROGDIR's can be set.
   
   PR:		148806
   Submitted by:	John Hixson
 
 Modified:
   head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh
   head/usr.sbin/pc-sysinstall/backend/functions-packages.sh
   head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh
 
 Modified: head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh
 ==============================================================================
 --- head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh	Thu Aug 19 06:01:25 2010	(r211486)
 +++ head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh	Thu Aug 19 06:02:31 2010	(r211487)
 @@ -123,7 +123,7 @@ start_extract_split()
  	cd "${dir}"
  	if [ -f "install.sh" ]
  	then
 -	  echo "Extracting" `basename ${dir}`
 +	  echo_log "Extracting" `basename ${dir}`
        echo "y" | sh install.sh >/dev/null
        if [ "$?" != "0" ]
        then
 @@ -139,7 +139,7 @@ start_extract_split()
    cd "${KERNELS}"
    if [ -f "install.sh" ]
    then
 -	echo "Extracting" `basename ${KERNELS}`
 +	echo_log "Extracting" `basename ${KERNELS}`
      echo "y" | sh install.sh generic >/dev/null
      if [ "$?" != "0" ]
      then
 @@ -155,7 +155,7 @@ start_extract_split()
    cd "${SOURCE}"
    if [ -f "install.sh" ]
    then
 -	echo "Extracting" `basename ${SOURCE}`
 +	echo_log "Extracting" `basename ${SOURCE}`
      echo "y" | sh install.sh all >/dev/null
      if [ "$?" != "0" ]
      then
 @@ -259,8 +259,8 @@ bye
  
  EOF
  
 -   # Fetch the files via ftp
 -   echo "$ INSTALL" | ftp -N "${NETRC}" "${FTPHOST}"
 +  # Fetch the files via ftp
 +  echo "$ INSTALL" | ftp -N "${NETRC}" "${FTPHOST}"
  
    # Done fetching, now reset the INSFILE to our downloaded archived
    INSFILE="${OUTFILE}" ; export INSFILE
 
 Modified: head/usr.sbin/pc-sysinstall/backend/functions-packages.sh
 ==============================================================================
 --- head/usr.sbin/pc-sysinstall/backend/functions-packages.sh	Thu Aug 19 06:01:25 2010	(r211486)
 +++ head/usr.sbin/pc-sysinstall/backend/functions-packages.sh	Thu Aug 19 06:02:31 2010	(r211487)
 @@ -63,6 +63,22 @@ get_package_index_by_fs()
  	fetch_file "${INDEX_FILE}" "${CONFDIR}/" "0"
  };
  
 +get_package_index_size()
 +{
 +	if [ -f "${CONFDIR}/INDEX" ]
 +	then
 +		SIZE=`ls -l ${CONFDIR}/INDEX | awk '{ print $5 }'`
 +	else
 +		get_ftp_mirror
 +		FTPHOST="${VAL}"
 +
 +		FTPDIR="/pub/FreeBSD/releases/${FBSD_ARCH}/${FBSD_BRANCH}"
 +		FTPPATH="ftp://${FTPHOST}${FTPDIR}/packages"
 +
 +		fetch -s "${FTPPATH}/INDEX.bz2"
 +	fi
 +};
 +
  get_package_index()
  {
  	RES=0
 
 Modified: head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh
 ==============================================================================
 --- head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh	Thu Aug 19 06:01:25 2010	(r211486)
 +++ head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh	Thu Aug 19 06:02:31 2010	(r211487)
 @@ -36,8 +36,11 @@
  # User-editable configuration variables
  
  # Set this to the program location
 -PROGDIR="/usr/share/pc-sysinstall"
 -export PROGDIR
 +if [ -z "${PROGDIR}" ]
 +then
 +	PROGDIR="/usr/share/pc-sysinstall"
 +	export PROGDIR
 +fi
  
  # Set this to the components location
  COMPDIR="${PROGDIR}/components"
 _______________________________________________
 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:
