Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jul 2013 17:54:09 +0000 (UTC)
From:      Devin Teske <dteske@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r252810 - head/usr.sbin/bsdconfig/examples
Message-ID:  <201307051754.r65Hs9um020364@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dteske
Date: Fri Jul  5 17:54:08 2013
New Revision: 252810
URL: http://svnweb.freebsd.org/changeset/base/252810

Log:
  Add example shell script for creating a local INDEX file that can be
  accessed quickly for browsing a list of available packages.

Added:
  head/usr.sbin/bsdconfig/examples/browse_packages.sh   (contents, props changed)

Added: head/usr.sbin/bsdconfig/examples/browse_packages.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/usr.sbin/bsdconfig/examples/browse_packages.sh	Fri Jul  5 17:54:08 2013	(r252810)
@@ -0,0 +1,25 @@
+#!/bin/sh
+# $FreeBSD$
+#
+# This sample downloads the package INDEX file from FTP to /tmp (if it doesn't
+# already exist) and then displays the package configuration/management screen
+# using the local INDEX file (results in faster browsing of packages from-start
+# since the INDEX can be loaded from local media).
+#
+# NOTE: Packages cannot be installed unless staged to /tmp/packages/All
+#
+. /usr/share/bsdconfig/script.subr
+nonInteractive=1
+TMPDIR=/tmp
+if [ ! -e "$TMPDIR/packages/INDEX" ]; then
+	[ -d "$TMPDIR/packages" ] || mkdir -p "$TMPDIR/packages" || exit 1
+	_ftpPath=ftp://ftp-archive.freebsd.org
+	mediaSetFTP
+	mediaOpen
+	f_show_info "Downloading packages/INDEX from %s" "$_ftpPath" 
+	f_device_get media packages/INDEX > $TMPDIR/packages/INDEX
+	mediaClose
+fi
+_directoryPath=$TMPDIR
+mediaSetDirectory
+configPackages



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