mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Do all steps to replace repo package and make sure symlink is in place
This commit is contained in:
parent
f5edca6c48
commit
5caee0ba0f
@ -299,6 +299,9 @@ pkg_upgrade() {
|
||||
_exec "pkg ${pkg_chroot} set -A 1 ${product}-repo-devel" \
|
||||
"Scheduling package ${product}-repo-devel for removal"
|
||||
_exec "pkg install ${_repo_pkg}" "Installing ${_repo_pkg}" mute
|
||||
_exec "pkg delete ${product}-repo-devel" "Removing ${product}-repo-devel" \
|
||||
mute ignore_result
|
||||
validate_repo_conf
|
||||
pkg_update force
|
||||
fi
|
||||
|
||||
@ -698,6 +701,31 @@ do_reboot() {
|
||||
fi
|
||||
}
|
||||
|
||||
validate_repo_conf() {
|
||||
# Make sure to use default repo conf when it doesn't exist
|
||||
pkg_repo_conf="/usr/local/etc/pkg/repos/${product}.conf"
|
||||
default_pkg_repo_conf_path="/usr/local/share/${product}/pkg/repos/${product}-repo.conf"
|
||||
|
||||
pkg_repo_conf_path=$(/usr/local/sbin/read_xml_tag.sh string system/pkg_repo_conf_path \
|
||||
${default_pkg_repo_conf_path})
|
||||
|
||||
if [ -z "${pkg_repo_conf_path}" -o ! -f "${pkg_repo_conf_path}" ]; then
|
||||
pkg_repo_conf_path=${default_pkg_repo_conf_path}
|
||||
fi
|
||||
|
||||
if [ -f "${pkg_repo_conf_path}" ]; then
|
||||
if [ -e "${pkg_repo_conf}" -a ! -L "${pkg_repo_conf}" ]; then
|
||||
rm -f ${pkg_repo_conf}
|
||||
ln -sf ${pkg_repo_conf_path} ${pkg_repo_conf}
|
||||
fi
|
||||
|
||||
if [ "$(readlink ${pkg_repo_conf})" != "${pkg_repo_conf_path}" ]; then
|
||||
mkdir -p /usr/local/etc/pkg/repos
|
||||
ln -sf ${pkg_repo_conf_path} ${pkg_repo_conf}
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
export LANG=C
|
||||
|
||||
pid_file="/var/run/$(basename $0).pid"
|
||||
@ -726,28 +754,7 @@ else
|
||||
export HTTP_USER_AGENT="${product}/${product_version}"
|
||||
fi
|
||||
|
||||
# Make sure to use default repo conf when it doesn't exist
|
||||
pkg_repo_conf="/usr/local/etc/pkg/repos/${product}.conf"
|
||||
default_pkg_repo_conf_path="/usr/local/share/${product}/pkg/repos/${product}-repo.conf"
|
||||
|
||||
pkg_repo_conf_path=$(/usr/local/sbin/read_xml_tag.sh string system/pkg_repo_conf_path \
|
||||
${default_pkg_repo_conf_path})
|
||||
|
||||
if [ -z "${pkg_repo_conf_path}" -o ! -f "${pkg_repo_conf_path}" ]; then
|
||||
pkg_repo_conf_path=${default_pkg_repo_conf_path}
|
||||
fi
|
||||
|
||||
if [ -f "${pkg_repo_conf_path}" ]; then
|
||||
if [ -e "${pkg_repo_conf}" -a ! -L "${pkg_repo_conf}" ]; then
|
||||
rm -f ${pkg_repo_conf}
|
||||
ln -sf ${pkg_repo_conf_path} ${pkg_repo_conf}
|
||||
fi
|
||||
|
||||
if [ "$(readlink ${pkg_repo_conf})" != "${pkg_repo_conf_path}" ]; then
|
||||
mkdir -p /usr/local/etc/pkg/repos
|
||||
ln -sf ${pkg_repo_conf_path} ${pkg_repo_conf}
|
||||
fi
|
||||
fi
|
||||
validate_repo_conf
|
||||
|
||||
# Flags used in _exit
|
||||
export delete_annotation=""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user