diff options
author | Renato Botelho <renato@netgate.com> | 2016-01-07 19:14:44 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-01-07 19:15:08 -0200 |
commit | 6cf87aec745eb5b2f488ed3a4ec24b11a806b613 (patch) | |
tree | 5481e93162aed42351a5759c3e1c8a50d0093c07 /src/usr | |
parent | 274351c5595b3dd976a4d2853907177791d23dfc (diff) | |
download | pfsense-6cf87aec745eb5b2f488ed3a4ec24b11a806b613.zip pfsense-6cf87aec745eb5b2f488ed3a4ec24b11a806b613.tar.gz |
Do not set PKG_AUTOUPDATE=false anymore and let pkg to update metadata when it's necessary. Some users reported to see issues in cases where update was necessary
Diffstat (limited to 'src/usr')
-rwxr-xr-x | src/usr/local/sbin/pfSense-upgrade | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/src/usr/local/sbin/pfSense-upgrade b/src/usr/local/sbin/pfSense-upgrade index 297476d..2ce7421 100755 --- a/src/usr/local/sbin/pfSense-upgrade +++ b/src/usr/local/sbin/pfSense-upgrade @@ -244,25 +244,10 @@ pkg_update() { local _force="" if [ "${1}" = "force" ]; then - local _force=1 + _force=" -f" fi - if [ -z "${_force}" -a -f ${last_update_file} ]; then - local _last_update=$(head -n 1 ${last_update_file}) - # Verify if content contains only numbers - if echo "${_last_update}" | grep -E -q '^[0-9]+$'; then - local _now=$(date +%s) - # Only run update hourly, and if last update is in the future - [ ${_now} -gt ${_last_update} -a $((${_now} - ${_last_update})) -le $((60 * 60)) ] \ - && unset _run_update - fi - fi - - [ -z "${_run_update}" ] \ - && return 0 - - _exec "pkg ${pkg_chroot} update" "Updating repositories" mute - date +%s > ${last_update_file} + _exec "pkg ${pkg_chroot} update${_force}" "Updating repositories metadata" } pkg_upgrade() { @@ -609,8 +594,6 @@ pkg_install() { _exit 1 fi - pkg_update - if is_pkg_installed ${_pkg_name}; then local _cversion=$(compare_pkg_version ${_pkg_name}) @@ -672,16 +655,12 @@ do_reboot() { } pid_file="/var/run/$(basename $0).pid" -last_update_file="/var/run/$(basename $0)-last-update" logfile="/cf/conf/upgrade_log.txt" stdout='/dev/null' # pkg should not ask for confirmations export ASSUME_ALWAYS_YES=true -# Disable automatic update -export REPO_AUTOUPDATE=false - export product=$(/usr/local/bin/php -n /usr/local/sbin/read_global_var product_name pfSense) export pkg_prefix=$(/usr/local/bin/php -n /usr/local/sbin/read_global_var pkg_prefix pfSense-pkg-) export platform=$(cat /etc/platform) |