1if [ ! "$_PACKAGES_PACKAGES_SUBR" ]; then _PACKAGES_PACKAGES_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/packages.subr 258267 2013-11-17 17:53:55Z dteske $ |
28# 29############################################################ INCLUDES 30 31BSDCFG_SHARE="/usr/share/bsdconfig" 32. $BSDCFG_SHARE/common.subr || exit 1 33f_dprintf "%s: loading includes..." "$0" 34f_include $BSDCFG_SHARE/dialog.subr 35f_include $BSDCFG_SHARE/device.subr --- 930 unchanged lines hidden (view full) --- 966 f_quietly ldconfig /usr/lib /usr/lib/compat /usr/local/lib 967 968 # Make a couple paranoid locations for temp 969 # files to live if user specified none 970 local tmpdir 971 f_getvar $VAR_PKG_TMPDIR:-/var/tmp tmpdir 972 f_quietly mkdir -p -m 1777 "$tmpdir" 973 |
974 local path device_type 975 device_$device get type device_type |
976 case "$name" in 977 */*) path="$name" ;; |
978 *) 979 if [ "$device_type" = "$DEVICE_TYPE_HTTP" ]; then 980 path="$PKG_ABI/latest/All/$name" 981 else 982 path="packages/$PKG_ABI/All/$name" 983 fi |
984 esac 985 986 # We have a path, call the device strategy routine to check the file 987 local pkg_ext found= 988 for pkg_ext in "" $PACKAGE_EXTENSIONS; do 989 if f_device_get $device "$path$pkg_ext" $PROBE_EXIST; then 990 path="$path$pkg_ext" |
991 found=1 992 break |
993 elif [ "$device_type" = "$DEVICE_TYPE_HTTP" ] && 994 f_device_get $device \ 995 "packages/$PKG_ABI/All/$name$pkg_ext" $PROBE_EXIST 996 then 997 # Mirroring physical media over HTTP 998 path="packages/$PKG_ABI/All/$name$pkg_ext" 999 found=1 1000 break |
1001 fi 1002 done |
1003 [ "$found" ] && f_dprintf "$funcname: found path=[%s] dev=[%s]" \ 1004 "$path" "$device" |
1005 1006 local alert=f_show_msg no_confirm= 1007 f_getvar $VAR_NO_CONFIRM no_confirm 1008 [ "$no_confirm" ] && alert=f_show_info 1009 1010 if [ ! "$found" ]; then 1011 f_dprintf "$funcname: No such %s file on %s device" \ 1012 "$path" "$device" --- 176 unchanged lines hidden --- |