svn commit: r252810 - head/usr.sbin/bsdconfig/examples

Devin Teske dteske at FreeBSD.org
Fri Jul 5 17:54:09 UTC 2013


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


More information about the svn-src-all mailing list