Fixed a problem where reuse of the ezjail_sourcetree variable led to ezjail-admin update not finding source tree. Thanks to Paul Macdonald.
This commit is contained in:
parent
d90ce7e051
commit
3768472b3a
11
ezjail-admin
11
ezjail-admin
@ -873,14 +873,14 @@ list)
|
|||||||
######################## ezjail-admin UPDATE ########################
|
######################## ezjail-admin UPDATE ########################
|
||||||
setup|update)
|
setup|update)
|
||||||
# Clean variables, prevent pollution
|
# Clean variables, prevent pollution
|
||||||
unset ezjail_provideports ezjail_installaction ezjail_osversion_source ezjail_osversion_destination ezjail_sourcetree
|
unset ezjail_provideports ezjail_installaction ezjail_osversion_source ezjail_osversion_destination ezjail_source
|
||||||
|
|
||||||
shift; while getopts :biuUpPs: arg; do case ${arg} in
|
shift; while getopts :biuUpPs: arg; do case ${arg} in
|
||||||
b) ezjail_installaction="buildworld installworld";;
|
b) ezjail_installaction="buildworld installworld";;
|
||||||
i) ezjail_installaction="installworld";;
|
i) ezjail_installaction="installworld";;
|
||||||
u) ezjail_installaction="freebsd-update";;
|
u) ezjail_installaction="freebsd-update";;
|
||||||
U) ezjail_installaction="freebsd-upgrade";;
|
U) ezjail_installaction="freebsd-upgrade";;
|
||||||
s) ezjail_sourcetree=${OPTARG};;
|
s) ezjail_source=${OPTARG};;
|
||||||
P) ezjail_provideports="YES"; ezjail_installaction="none";;
|
P) ezjail_provideports="YES"; ezjail_installaction="none";;
|
||||||
p) ezjail_provideports="YES";;
|
p) ezjail_provideports="YES";;
|
||||||
?) exerr ${ezjail_usage_update};;
|
?) exerr ${ezjail_usage_update};;
|
||||||
@ -905,10 +905,10 @@ setup|update)
|
|||||||
elif [ "${ezjail_installaction}" = "freebsd-upgrade" ]; then
|
elif [ "${ezjail_installaction}" = "freebsd-upgrade" ]; then
|
||||||
[ -d "${ezjail_jailbase}" ] || exerr "Error: base jail does not exist.\n You cannot update a base jail until it is created.\n Please run '${ezjail_admin} update' or '${ezjail_admin} install' first."
|
[ -d "${ezjail_jailbase}" ] || exerr "Error: base jail does not exist.\n You cannot update a base jail until it is created.\n Please run '${ezjail_admin} update' or '${ezjail_admin} install' first."
|
||||||
|
|
||||||
[ -z "${ezjail_sourcetree}" ] && exerr "Error: Can not (yet automatically) infer the basejail's osversion.\n Please run ${ezjail_admin} update -U -s X.X-RELEASE, with X.X-RELEASE being to osversion currently installed in the basejail in need of an upgrade."
|
[ -z "${ezjail_source}" ] && exerr "Error: Can not (yet automatically) infer the basejail's osversion.\n Please run ${ezjail_admin} update -U -s X.X-RELEASE, with X.X-RELEASE being to osversion currently installed in the basejail in need of an upgrade."
|
||||||
|
|
||||||
# That would be the part where we try to lookup the osversion from a file in the basejail
|
# That would be the part where we try to lookup the osversion from a file in the basejail
|
||||||
ezjail_osversion_source="${ezjail_sourcetree}"
|
ezjail_osversion_source="${ezjail_source}"
|
||||||
|
|
||||||
# Make the host systems os version our target version
|
# Make the host systems os version our target version
|
||||||
# Users can override this by setting the UNAME_r environment variable
|
# Users can override this by setting the UNAME_r environment variable
|
||||||
@ -919,6 +919,9 @@ setup|update)
|
|||||||
|
|
||||||
# Here we should write the file with the new osversion in case of success
|
# Here we should write the file with the new osversion in case of success
|
||||||
else
|
else
|
||||||
|
# If user gave a source tree on command line, use that
|
||||||
|
[ "${ezjail_source}" ] && ezjail_sourcetree="${ezjail_source}"
|
||||||
|
|
||||||
# Bump the user for some of the most common errors
|
# Bump the user for some of the most common errors
|
||||||
[ -d "${ezjail_sourcetree}" ] || exerr "Error: Cannot find your copy of the FreeBSD source tree in ${ezjail_sourcetree}.\n Consider using '${ezjail_admin} install' to create the base jail from an ftp server."
|
[ -d "${ezjail_sourcetree}" ] || exerr "Error: Cannot find your copy of the FreeBSD source tree in ${ezjail_sourcetree}.\n Consider using '${ezjail_admin} install' to create the base jail from an ftp server."
|
||||||
[ -e "${ezjail_sourcetree}/Makefile" ] || exerr "Error: Your source tree in ${ezjail_sourcetree} seems to be incomplete (Makefile is missing)."
|
[ -e "${ezjail_sourcetree}/Makefile" ] || exerr "Error: Your source tree in ${ezjail_sourcetree} seems to be incomplete (Makefile is missing)."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user