diff options
author | dteske <dteske@FreeBSD.org> | 2013-11-17 17:42:15 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2013-11-17 17:42:15 +0000 |
commit | f5e406a2b5dea405db2ad5d0f9c9a63b66293f45 (patch) | |
tree | 460b7c0051f614fab19a5fa8f36c126e04ed1b59 /usr.sbin/bsdconfig/share/packages | |
parent | 23a2aa8b488b5ebb3ad10ea77b5eef4df5692643 (diff) | |
download | FreeBSD-src-f5e406a2b5dea405db2ad5d0f9c9a63b66293f45.zip FreeBSD-src-f5e406a2b5dea405db2ad5d0f9c9a63b66293f45.tar.gz |
Improve debugging with f_eval_catch() introduced by SVN r257784 and also
fix a bug where "pkg update" was not getting the value of PACKAGESITE.
NB: PACKAGESITE needs to be explicitly exported in support of children.
MFC after: 3 days
Diffstat (limited to 'usr.sbin/bsdconfig/share/packages')
-rwxr-xr-x | usr.sbin/bsdconfig/share/packages/index.subr | 5 | ||||
-rwxr-xr-x | usr.sbin/bsdconfig/share/packages/packages.subr | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/usr.sbin/bsdconfig/share/packages/index.subr b/usr.sbin/bsdconfig/share/packages/index.subr index 2e56723..61a2464 100755 --- a/usr.sbin/bsdconfig/share/packages/index.subr +++ b/usr.sbin/bsdconfig/share/packages/index.subr @@ -86,6 +86,7 @@ INDEX_FORMAT="$INDEX_FORMAT|" # disc # f_index_initialize() { + local __funcname=f_index_initialize local __var_to_set="${2:-PACKAGE_INDEX}" [ "$_INDEX_INITTED" ] && return $SUCCESS @@ -117,7 +118,9 @@ f_index_initialize() $DEVICE_TYPE_NFS) __site="file://$MOUNTPOINT" ;; esac - if ! PACKAGESITE="$__site" f_quietly pkg update; then + export PACKAGESITE="$__site" + f_dprintf "PACKAGESITE=[%s]" "$PACKAGESITE" + if ! f_eval_catch $__funcname pkg "pkg update"; then f_show_err "$msg_unable_to_update_pkg_from_selected_media" f_device_shutdown media return $FAILURE diff --git a/usr.sbin/bsdconfig/share/packages/packages.subr b/usr.sbin/bsdconfig/share/packages/packages.subr index caff7cf..f4d1934 100755 --- a/usr.sbin/bsdconfig/share/packages/packages.subr +++ b/usr.sbin/bsdconfig/share/packages/packages.subr @@ -1013,9 +1013,9 @@ f_package_extract() # Request the package be added via pkg-install(8) if f_debugging; then - pkg -d install -y "$name" + f_eval_catch $funcname pkg 'pkg -d install -y "%s"' "$name" else - f_quietly pkg install -y "$name" + f_eval_catch $funcname pkg 'pkg install -y "%s"' "$name" fi if [ $? -ne $SUCCESS ]; then $alert "$msg_pkg_install_apparently_did_not_like_the_package" \ @@ -1144,9 +1144,9 @@ f_package_delete() # f_show_info "$msg_uninstalling_package_waiting_for_pkg_delete" "$name" if f_debugging; then - pkg -d delete -y "$name" + f_eval_catch $funcname pkg 'pkg -d delete -y "%s"' "$name" else - f_quietly pkg delete -y "$name" + f_eval_catch $funcname pkg 'pkg delete -y "%s"' "$name" fi if [ $? -ne $SUCCESS ]; then f_show_msg "$msg_pkg_delete_failed" "$name" |