Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jul 2010 23:50:03 GMT
From:      dfilter@FreeBSD.ORG (dfilter service)
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/148584: commit references a PR
Message-ID:  <201007132350.o6DNo3lW080655@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/148584; it has been noted by GNATS.

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/148584: commit references a PR
Date: Tue, 13 Jul 2010 23:47:26 +0000 (UTC)

 Author: imp
 Date: Tue Jul 13 23:47:12 2010
 New Revision: 210036
 URL: http://svn.freebsd.org/changeset/base/210036
 
 Log:
   Add support for packages.
   
   PR:		148584
   Submitted by:	John Hixon
 
 Added:
   head/usr.sbin/pc-sysinstall/backend-query/get-packages.sh   (contents, props changed)
   head/usr.sbin/pc-sysinstall/backend-query/list-packages.sh   (contents, props changed)
   head/usr.sbin/pc-sysinstall/backend/functions-packages.sh   (contents, props changed)
 Modified:
   head/usr.sbin/pc-sysinstall/backend-query/Makefile
   head/usr.sbin/pc-sysinstall/backend-query/list-config.sh
   head/usr.sbin/pc-sysinstall/backend-query/list-mirrors.sh
   head/usr.sbin/pc-sysinstall/backend/Makefile
   head/usr.sbin/pc-sysinstall/backend/functions-ftp.sh
   head/usr.sbin/pc-sysinstall/doc/help-index
   head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh
 
 Modified: head/usr.sbin/pc-sysinstall/backend-query/Makefile
 ==============================================================================
 --- head/usr.sbin/pc-sysinstall/backend-query/Makefile	Tue Jul 13 23:34:43 2010	(r210035)
 +++ head/usr.sbin/pc-sysinstall/backend-query/Makefile	Tue Jul 13 23:47:12 2010	(r210036)
 @@ -1,11 +1,11 @@
  # $FreeBSD$
  
  FILES=	detect-laptop.sh detect-nics.sh detect-emulation.sh disk-info.sh \
 -	disk-list.sh disk-part.sh enable-net.sh list-config.sh list-components.sh \
 -	list-mirrors.sh list-rsync-backups.sh list-tzones.sh query-langs.sh \
 -	send-logs.sh setup-ssh-keys.sh sys-mem.sh test-live.sh test-netup.sh \
 -	update-part-list.sh xkeyboard-layouts.sh xkeyboard-models.sh \
 -	xkeyboard-variants.sh
 +	disk-list.sh disk-part.sh enable-net.sh get-packages.sh list-config.sh \
 +	list-components.sh list-mirrors.sh list-packages.sh list-rsync-backups.sh \
 +	list-tzones.sh query-langs.sh send-logs.sh setup-ssh-keys.sh sys-mem.sh \
 +	test-live.sh test-netup.sh update-part-list.sh xkeyboard-layouts.sh \
 +	xkeyboard-models.sh xkeyboard-variants.sh
  FILESMODE=	${BINMODE}
  FILESDIR=${SHAREDIR}/pc-sysinstall/backend-query
  NO_OBJ=
 
 Added: head/usr.sbin/pc-sysinstall/backend-query/get-packages.sh
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/usr.sbin/pc-sysinstall/backend-query/get-packages.sh	Tue Jul 13 23:47:12 2010	(r210036)
 @@ -0,0 +1,60 @@
 +#!/bin/sh
 +#-
 +# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
 +#
 +# Redistribution and use in source and binary forms, with or without
 +# modification, are permitted provided that the following conditions
 +# are met:
 +# 1. Redistributions of source code must retain the above copyright
 +#    notice, this list of conditions and the following disclaimer.
 +# 2. Redistributions in binary form must reproduce the above copyright
 +#    notice, this list of conditions and the following disclaimer in the
 +#    documentation and/or other materials provided with the distribution.
 +#
 +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 +# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 +# SUCH DAMAGE.
 +#
 +# $FreeBSD$
 +
 +# Script which lists the available packages for this release
 +###########################################################################
 +
 +. ${PROGDIR}/backend/functions.sh
 +. ${PROGDIR}/backend/functions-packages.sh
 +
 +DEFAULT_FTP_SERVER="ftp.freebsd.org"
 +FTP_SERVER="${1}"
 +ID=`id -u`
 +
 +if [ "${ID}" -ne "0" ]
 +then
 +	echo "Error: must be root!" 
 +	exit 1
 +fi
 +
 +if [ -z "${FTP_SERVER}" ]
 +then
 +	FTP_SERVER="${DEFAULT_FTP_SERVER}"
 +fi
 +
 +if [ ! -f "${PKGDIR}/INDEX" ]
 +then
 +	get_package_index "${FTP_SERVER}"
 +fi
 +
 +if [ -f "${PKGDIR}/INDEX" ]
 +then
 +	echo "${PKGDIR}/INDEX"
 +	exit 0
 +fi
 +
 +exit 1
 
 Modified: head/usr.sbin/pc-sysinstall/backend-query/list-config.sh
 ==============================================================================
 --- head/usr.sbin/pc-sysinstall/backend-query/list-config.sh	Tue Jul 13 23:34:43 2010	(r210035)
 +++ head/usr.sbin/pc-sysinstall/backend-query/list-config.sh	Tue Jul 13 23:47:12 2010	(r210036)
 @@ -1,6 +1,6 @@
  #!/bin/sh
  #-
 -# Copyright (c) 2010 iX Systems, Inc.  All rights reserved.
 +# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
  #
  # Redistribution and use in source and binary forms, with or without
  # modification, are permitted provided that the following conditions
 
 Modified: head/usr.sbin/pc-sysinstall/backend-query/list-mirrors.sh
 ==============================================================================
 --- head/usr.sbin/pc-sysinstall/backend-query/list-mirrors.sh	Tue Jul 13 23:34:43 2010	(r210035)
 +++ head/usr.sbin/pc-sysinstall/backend-query/list-mirrors.sh	Tue Jul 13 23:47:12 2010	(r210036)
 @@ -1,6 +1,6 @@
  #!/bin/sh
  #-
 -# Copyright (c) 2010 iX Systems, Inc.  All rights reserved.
 +# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
  #
  # Redistribution and use in source and binary forms, with or without
  # modification, are permitted provided that the following conditions
 
 Added: head/usr.sbin/pc-sysinstall/backend-query/list-packages.sh
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/usr.sbin/pc-sysinstall/backend-query/list-packages.sh	Tue Jul 13 23:47:12 2010	(r210036)
 @@ -0,0 +1,74 @@
 +#!/bin/sh
 +#-
 +# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
 +#
 +# Redistribution and use in source and binary forms, with or without
 +# modification, are permitted provided that the following conditions
 +# are met:
 +# 1. Redistributions of source code must retain the above copyright
 +#    notice, this list of conditions and the following disclaimer.
 +# 2. Redistributions in binary form must reproduce the above copyright
 +#    notice, this list of conditions and the following disclaimer in the
 +#    documentation and/or other materials provided with the distribution.
 +#
 +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 +# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 +# SUCH DAMAGE.
 +#
 +# $FreeBSD$
 +
 +# Script which lists the available packages for this release
 +###########################################################################
 +
 +. ${PROGDIR}/backend/functions.sh
 +. ${PROGDIR}/backend/functions-packages.sh
 +
 +PACKAGE_CATEGORY="${1}"
 +PACKAGE_NAME="${2}"
 +NARGS=0
 +
 +if [ ! -f "${PKGDIR}/INDEX" ]
 +then
 +	echo "Error: please fetch package index with get-packages!"
 +	exit 1
 +fi
 +
 +if [ ! -f "${PKGDIR}/INDEX.parsed" ]
 +then
 +	parse_package_index
 +fi
 +
 +if [ -n "${PACKAGE_CATEGORY}" ]
 +then
 +	NARGS=$((NARGS+1))
 +fi
 +
 +if [ -n "${PACKAGE_NAME}" ]
 +then
 +	NARGS=$((NARGS+1))
 +fi
 +
 +echo "Available Packages:"
 +if [ "${NARGS}" -eq "0" ]
 +then
 +	show_packages
 +
 +elif [ "${NARGS}" -eq "1" ]
 +then
 +	show_packages_by_category "${PACKAGE_CATEGORY}"
 +
 +elif [ "${NARGS}" -eq "2" ]
 +then
 +	show_package_by_name "${PACKAGE_CATEGORY}" "${PACKAGE_NAME}"
 +
 +else
 +	show_packages
 +fi
 
 Modified: head/usr.sbin/pc-sysinstall/backend/Makefile
 ==============================================================================
 --- head/usr.sbin/pc-sysinstall/backend/Makefile	Tue Jul 13 23:34:43 2010	(r210035)
 +++ head/usr.sbin/pc-sysinstall/backend/Makefile	Tue Jul 13 23:47:12 2010	(r210036)
 @@ -4,8 +4,9 @@ FILES=	functions-bsdlabel.sh functions-c
  	functions-extractimage.sh functions-ftp.sh functions-installcomponents.sh \
  	functions-localize.sh functions-mountdisk.sh \
  	functions-mountoptical.sh functions-networking.sh \
 -	functions-newfs.sh functions-parse.sh functions-runcommands.sh \
 -	functions-unmount.sh functions-upgrade.sh functions-users.sh \
 +	functions-newfs.sh functions-packages.sh functions-parse.sh \
 +	functions-runcommands.sh functions-unmount.sh \
 +	functions-upgrade.sh functions-users.sh \
  	functions.sh parseconfig.sh startautoinstall.sh
  FILESMODE=	${BINMODE}
  FILESDIR=${SHAREDIR}/pc-sysinstall/backend
 
 Modified: head/usr.sbin/pc-sysinstall/backend/functions-ftp.sh
 ==============================================================================
 --- head/usr.sbin/pc-sysinstall/backend/functions-ftp.sh	Tue Jul 13 23:34:43 2010	(r210035)
 +++ head/usr.sbin/pc-sysinstall/backend/functions-ftp.sh	Tue Jul 13 23:47:12 2010	(r210036)
 @@ -1,6 +1,6 @@
  #!/bin/sh
  #-
 -# Copyright (c) 2010 iX Systems, Inc.  All rights reserved.
 +# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
  #
  # Redistribution and use in source and binary forms, with or without
  # modification, are permitted provided that the following conditions
 
 Added: head/usr.sbin/pc-sysinstall/backend/functions-packages.sh
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/usr.sbin/pc-sysinstall/backend/functions-packages.sh	Tue Jul 13 23:47:12 2010	(r210036)
 @@ -0,0 +1,148 @@
 +#!/bin/sh
 +#-
 +# Copyright (c) 2010 iXsystems, Inc.  All rights reserved.
 +#
 +# Redistribution and use in source and binary forms, with or without
 +# modification, are permitted provided that the following conditions
 +# are met:
 +# 1. Redistributions of source code must retain the above copyright
 +#    notice, this list of conditions and the following disclaimer.
 +# 2. Redistributions in binary form must reproduce the above copyright
 +#    notice, this list of conditions and the following disclaimer in the
 +#    documentation and/or other materials provided with the distribution.
 +#
 +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 +# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 +# SUCH DAMAGE.
 +#
 +# $FreeBSD$
 +
 +# Functions which runs commands on the system
 +
 +. ${BACKEND}/functions.sh
 +. ${BACKEND}/functions-parse.sh
 +. ${BACKEND}/functions-ftp.sh
 +
 +
 +get_package_index()
 +{
 +	FTP_SERVER="${1}"
 +	FTP_DIR="ftp://${FTP_SERVER}/pub/FreeBSD/releases/${FBSD_ARCH}/${FBSD_BRANCH}/packages"
 +	INDEX_FILE="INDEX"
 +	USE_BZIP2=0
 +
 +	if [ -f "/usr/bin/bzip2" ]
 +	then
 +		INDEX_FILE="${INDEX_FILE}.bz2"
 +		USE_BZIP2=1
 +	fi
 +
 +	ftp "${FTP_DIR}/${INDEX_FILE}"
 +	if [ -f "${INDEX_FILE}" ]
 +	then
 +		if [ "${USE_BZIP2}" -eq  "1" ]
 +		then
 +			bzip2 -d "${INDEX_FILE}"
 +			INDEX_FILE="${INDEX_FILE%.bz2}"
 +		fi
 +
 +		mv "${INDEX_FILE}" "${PKGDIR}"
 +	fi
 +}
 +
 +parse_package_index()
 +{
 +	INDEX_FILE="${PKGDIR}/INDEX"
 +
 +	exec 3<&0
 +	exec 0<"${INDEX_FILE}"
 +
 +	while read -r line
 +	do
 +		CATEGORY=""
 +		PACKAGE=""
 +		DESC=""
 +		i=0
 +
 +		SAVE_IFS="${IFS}"
 +		IFS="|"
 +
 +		for part in ${line}
 +		do
 +			if [ "${i}" -eq "1" ]
 +			then
 +				PACKAGE=`basename "${part}"`
 +
 +			elif [ "${i}" -eq "3" ]
 +			then
 +				DESC="${part}"
 +
 +			elif [ "${i}" -eq "6" ]
 +			then
 +				CATEGORY=`echo "${part}" | cut -f1 -d' '`
 +			fi
 +
 +			i=$((i+1))
 +		done
 +
 +		echo "${CATEGORY}|${PACKAGE}|${DESC}" >> "${INDEX_FILE}.parsed"
 +		IFS="${SAVE_IFS}"
 +	done
 +
 +	exec 0<&3
 +}
 +
 +show_package_file()
 +{
 +	PKGFILE="${1}"
 +
 +	exec 3<&0
 +	exec 0<"${PKGFILE}"
 +
 +	while read -r line
 +	do
 +		CATEGORY=`echo "${line}" | cut -f1 -d'|'`
 +		PACKAGE=`echo "${line}" | cut -f2 -d'|'`
 +		DESC=`echo "${line}" | cut -f3 -d'|'`
 +
 +		echo "${CATEGORY}/${PACKAGE}:${DESC}"
 +	done
 +
 +	exec 0<&3
 +}
 +
 +show_packages_by_category()
 +{
 +	CATEGORY="${1}"
 +	INDEX_FILE="${PKGDIR}/INDEX.parsed"
 +	TMPFILE="/tmp/.pkg.cat"
 +
 +	grep "^${CATEGORY}|" "${INDEX_FILE}" > "${TMPFILE}"
 +	show_package_file "${TMPFILE}"
 +	rm "${TMPFILE}"
 +}
 +
 +show_package_by_name()
 +{
 +	CATEGORY="${1}"
 +	PACKAGE="${2}"
 +	INDEX_FILE="${PKGDIR}/INDEX.parsed"
 +	TMPFILE="/tmp/.pkg.cat.pak"
 +
 +	grep "^${CATEGORY}|${PACKAGE}" "${INDEX_FILE}" > "${TMPFILE}"
 +	show_package_file "${TMPFILE}"
 +	rm "${TMPFILE}"
 +}
 +
 +show_packages()
 +{
 +	show_package_file "${PKGDIR}/INDEX.parsed"
 +}
 
 Modified: head/usr.sbin/pc-sysinstall/doc/help-index
 ==============================================================================
 --- head/usr.sbin/pc-sysinstall/doc/help-index	Tue Jul 13 23:34:43 2010	(r210035)
 +++ head/usr.sbin/pc-sysinstall/doc/help-index	Tue Jul 13 23:47:12 2010	(r210036)
 @@ -11,49 +11,55 @@ Help Commands
  System Query Commands
  
      disk-list 
 -	Provides a listing of the disk drives detected on this system
 +        Provides a listing of the disk drives detected on this system
  
      disk-part <disk>
 -	Queries the specified disk and returns information about its partitions
 +        Queries the specified disk and returns information about its partitions
      
      disk-info <disk>
 -	Returns information about the disks size, cyls, heads, and sectors 
 +        Returns information about the disks size, cyls, heads, and sectors 
      
      detect-laptop
 -	Tests to see if this system is a laptop or desktop
 +        Tests to see if this system is a laptop or desktop
  
      detect-emulation
 -	Tests to see if this system is actually running in an emulator such as VirtualBox
 +        Tests to see if this system is actually running in an emulator such as VirtualBox
      
      detect-nics
 -	Returns a listing of the detected network cards on this system
 +        Returns a listing of the detected network cards on this system
  
      list-config
          Returns a listing of the pc-sysinstall configuration
  
      list-components
 -	Returns a listing of the available components which can be installed
 +        Returns a listing of the available components which can be installed
  
      list-mirrors
 -	Returns a listing of the available FTP mirrors
 +        Returns a listing of the available FTP mirrors
 +
 +    list-packages
 +        Returns a listing of the available packages
  
      list-rsync-backups <user> <host> <port>
 -	Returns a listing of available rsync-backups on the target server in the life-preserver/ dir
 +        Returns a listing of available rsync-backups on the target server in the life-preserver/ dir
      
      list-tzones
 -	Returns a listing of available timezones
 +        Returns a listing of available timezones
  
      query-langs 
          Return a list of languages that the installer supports
  
 +    get-packages 
 +        Retrieves the list of packages from an FTP mirror
 +
      sys-mem
 -	Return the size of installed system RAM in MegaBytes
 +        Return the size of installed system RAM in MegaBytes
  
      test-netup
 -	Test if an internet connection is available
 +        Test if an internet connection is available
      
      update-part-list
 -	Return a list of PC-BSD & FreeBSD installs on this system for updates
 +        Return a list of PC-BSD & FreeBSD installs on this system for updates
  
      xkeyboard-layouts
          Return a list of keyboard layouts that xorg supports
 
 Modified: head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh
 ==============================================================================
 --- head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh	Tue Jul 13 23:34:43 2010	(r210035)
 +++ head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh	Tue Jul 13 23:47:12 2010	(r210036)
 @@ -43,6 +43,10 @@ export PROGDIR
  COMPDIR="${PROGDIR}/components"
  export COMPDIR
  
 +# Set this to the packages location
 +PKGDIR="${PROGDIR}/conf"
 +export PKGDIR
 +
  # End of user-editable configuration
  #####################################################################
  
 @@ -156,6 +160,10 @@ case $1 in
    list-mirrors) ${QUERYDIR}/list-mirrors.sh "${2}"
    ;;
  
 +  # Function which lists available packages
 +  list-packages) ${QUERYDIR}/list-packages.sh "${2}" "${3}"
 +  ;;
 +
    # Function which lists available backups on a rsync/ssh server
    list-rsync-backups) ${QUERYDIR}/list-rsync-backups.sh "${2}" "${3}" "${4}"
    ;;
 @@ -172,6 +180,10 @@ case $1 in
    send-logs) ${QUERYDIR}/send-logs.sh ${2}
    ;;
  
 +  # Function to get package index
 +  get-packages) ${QUERYDIR}/get-packages.sh "${2}"
 +  ;;
 +
    # Function which allows setting up of SSH keys
    setup-ssh-keys) ${QUERYDIR}/setup-ssh-keys.sh "${2}" "${3}" "${4}"
    ;;
 @@ -209,4 +221,4 @@ case $1 in
  esac
  
  # Exit with success if we made it to the end
 -exit 0
 +exit $?
 _______________________________________________
 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"
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007132350.o6DNo3lW080655>