Deleted Added
full compact
index.subr (257817) index.subr (258265)
1if [ ! "$_PACKAGES_INDEX_SUBR" ]; then _PACKAGES_INDEX_SUBR=1
2#
3# Copyright (c) 2013 Devin Teske
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:

--- 10 unchanged lines hidden (view full) ---

19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
1if [ ! "$_PACKAGES_INDEX_SUBR" ]; then _PACKAGES_INDEX_SUBR=1
2#
3# Copyright (c) 2013 Devin Teske
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:

--- 10 unchanged lines hidden (view full) ---

19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
27# $FreeBSD: head/usr.sbin/bsdconfig/share/packages/index.subr 257817 2013-11-07 21:16:32Z dteske $
27# $FreeBSD: head/usr.sbin/bsdconfig/share/packages/index.subr 258265 2013-11-17 17:42:15Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." packages/index.subr
34f_include $BSDCFG_SHARE/device.subr
35f_include $BSDCFG_SHARE/media/common.subr

--- 45 unchanged lines hidden (view full) ---

81# Read and initialize the global index. Returns success unless media cannot be
82# initialized for any reason (e.g. user cancels media selection dialog or an
83# error occurs). The index is sorted before being loaded into $var_to_set.
84#
85# NOTE: The index is processed with f_index_read() [below] after being loaded.
86#
87f_index_initialize()
88{
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." packages/index.subr
34f_include $BSDCFG_SHARE/device.subr
35f_include $BSDCFG_SHARE/media/common.subr

--- 45 unchanged lines hidden (view full) ---

81# Read and initialize the global index. Returns success unless media cannot be
82# initialized for any reason (e.g. user cancels media selection dialog or an
83# error occurs). The index is sorted before being loaded into $var_to_set.
84#
85# NOTE: The index is processed with f_index_read() [below] after being loaded.
86#
87f_index_initialize()
88{
89 local __funcname=f_index_initialize
89 local __var_to_set="${2:-PACKAGE_INDEX}"
90
91 [ "$_INDEX_INITTED" ] && return $SUCCESS
92
93 # Got any media?
94 f_media_verify || return $FAILURE
95
96 # Does it move when you kick it?

--- 15 unchanged lines hidden (view full) ---

112 $DEVICE_TYPE_HTTP_PROXY) f_getvar $VAR_HTTP_PROXY_PATH __site ;;
113 $DEVICE_TYPE_HTTP) f_getvar $VAR_HTTP_PATH __site ;;
114 $DEVICE_TYPE_CDROM) __site="file://$MOUNTPOINT" ;;
115 $DEVICE_TYPE_USB) __site="file://$MOUNTPOINT" ;;
116 $DEVICE_TYPE_DOS) __site="file://$MOUNTPOINT" ;;
117 $DEVICE_TYPE_NFS) __site="file://$MOUNTPOINT" ;;
118 esac
119
90 local __var_to_set="${2:-PACKAGE_INDEX}"
91
92 [ "$_INDEX_INITTED" ] && return $SUCCESS
93
94 # Got any media?
95 f_media_verify || return $FAILURE
96
97 # Does it move when you kick it?

--- 15 unchanged lines hidden (view full) ---

113 $DEVICE_TYPE_HTTP_PROXY) f_getvar $VAR_HTTP_PROXY_PATH __site ;;
114 $DEVICE_TYPE_HTTP) f_getvar $VAR_HTTP_PATH __site ;;
115 $DEVICE_TYPE_CDROM) __site="file://$MOUNTPOINT" ;;
116 $DEVICE_TYPE_USB) __site="file://$MOUNTPOINT" ;;
117 $DEVICE_TYPE_DOS) __site="file://$MOUNTPOINT" ;;
118 $DEVICE_TYPE_NFS) __site="file://$MOUNTPOINT" ;;
119 esac
120
120 if ! PACKAGESITE="$__site" f_quietly pkg update; then
121 export PACKAGESITE="$__site"
122 f_dprintf "PACKAGESITE=[%s]" "$PACKAGESITE"
123 if ! f_eval_catch $__funcname pkg "pkg update"; then
121 f_show_err "$msg_unable_to_update_pkg_from_selected_media"
122 f_device_shutdown media
123 return $FAILURE
124 fi
125
126 #
127 # Try to get contents from validated on-disk cache
128 #

--- 330 unchanged lines hidden ---
124 f_show_err "$msg_unable_to_update_pkg_from_selected_media"
125 f_device_shutdown media
126 return $FAILURE
127 fi
128
129 #
130 # Try to get contents from validated on-disk cache
131 #

--- 330 unchanged lines hidden ---