4 # This sample downloads the package digests.txz and packagesite.txz files from
5 # HTTP to /tmp (if they don't already exist) and then displays the package
6 # configuration/management screen using the local files (resulting in faster
7 # browsing of packages from-start since digests.txz/packagesite.txz can be
8 # loaded from local media).
10 # NOTE: Packages cannot be installed unless staged to
11 # /tmp/packages/$PKG_ABI/All
13 [ "$_SCRIPT_SUBR" ] || . /usr/share/bsdconfig/script.subr || exit 1
15 f_musthavepkg_init # Make sure we have a usable pkg(8) with $PKG_ABI
17 PKGDIR=$TMPDIR/packages/$PKG_ABI
18 [ -d "$PKGDIR" ] || mkdir -p "$PKGDIR" || exit 1
19 for file in digests.txz packagesite.txz; do
20 [ -s "$PKGDIR/$file" ] && continue
21 if [ ! "$HTTP_INITIALIZED" ]; then
22 _httpPath=http://pkg.freebsd.org
26 f_show_info "Downloading %s from\n %s" "$file" "$_httpPath"
27 f_device_get device_media "/$PKG_ABI/latest/$file" > $PKGDIR/$file ||
30 _directoryPath=$TMPDIR