summaryrefslogtreecommitdiff
path: root/ezjail-admin
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2012-09-20 11:26:45 +0000
committererdgeist <erdgeist@erdgeist.org>2012-09-20 11:26:45 +0000
commit3768472b3a7659c742ab37d7abf00a52e0e263de (patch)
tree6c09ecea0fa9674acc39cd7fa4cf8fae16953f7a /ezjail-admin
parentd90ce7e0517db4e7012313667b9c8d675b1ff5d6 (diff)
Fixed a problem where reuse of the ezjail_sourcetree variable led to ezjail-admin update not finding source tree. Thanks to Paul Macdonald.RELEASE_3_2_3
Diffstat (limited to 'ezjail-admin')
-rwxr-xr-xezjail-admin11
1 files changed, 7 insertions, 4 deletions
diff --git a/ezjail-admin b/ezjail-admin
index 89497b6..8727c41 100755
--- a/ezjail-admin
+++ b/ezjail-admin
@@ -873,14 +873,14 @@ list)
873######################## ezjail-admin UPDATE ######################## 873######################## ezjail-admin UPDATE ########################
874setup|update) 874setup|update)
875 # Clean variables, prevent pollution 875 # Clean variables, prevent pollution
876 unset ezjail_provideports ezjail_installaction ezjail_osversion_source ezjail_osversion_destination ezjail_sourcetree 876 unset ezjail_provideports ezjail_installaction ezjail_osversion_source ezjail_osversion_destination ezjail_source
877 877
878 shift; while getopts :biuUpPs: arg; do case ${arg} in 878 shift; while getopts :biuUpPs: arg; do case ${arg} in
879 b) ezjail_installaction="buildworld installworld";; 879 b) ezjail_installaction="buildworld installworld";;
880 i) ezjail_installaction="installworld";; 880 i) ezjail_installaction="installworld";;
881 u) ezjail_installaction="freebsd-update";; 881 u) ezjail_installaction="freebsd-update";;
882 U) ezjail_installaction="freebsd-upgrade";; 882 U) ezjail_installaction="freebsd-upgrade";;
883 s) ezjail_sourcetree=${OPTARG};; 883 s) ezjail_source=${OPTARG};;
884 P) ezjail_provideports="YES"; ezjail_installaction="none";; 884 P) ezjail_provideports="YES"; ezjail_installaction="none";;
885 p) ezjail_provideports="YES";; 885 p) ezjail_provideports="YES";;
886 ?) exerr ${ezjail_usage_update};; 886 ?) exerr ${ezjail_usage_update};;
@@ -905,10 +905,10 @@ setup|update)
905 elif [ "${ezjail_installaction}" = "freebsd-upgrade" ]; then 905 elif [ "${ezjail_installaction}" = "freebsd-upgrade" ]; then
906 [ -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." 906 [ -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."
907 907
908 [ -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." 908 [ -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."
909 909
910 # That would be the part where we try to lookup the osversion from a file in the basejail 910 # That would be the part where we try to lookup the osversion from a file in the basejail
911 ezjail_osversion_source="${ezjail_sourcetree}" 911 ezjail_osversion_source="${ezjail_source}"
912 912
913 # Make the host systems os version our target version 913 # Make the host systems os version our target version
914 # Users can override this by setting the UNAME_r environment variable 914 # Users can override this by setting the UNAME_r environment variable
@@ -919,6 +919,9 @@ setup|update)
919 919
920 # Here we should write the file with the new osversion in case of success 920 # Here we should write the file with the new osversion in case of success
921 else 921 else
922 # If user gave a source tree on command line, use that
923 [ "${ezjail_source}" ] && ezjail_sourcetree="${ezjail_source}"
924
922 # Bump the user for some of the most common errors 925 # Bump the user for some of the most common errors
923 [ -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." 926 [ -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."
924 [ -e "${ezjail_sourcetree}/Makefile" ] || exerr "Error: Your source tree in ${ezjail_sourcetree} seems to be incomplete (Makefile is missing)." 927 [ -e "${ezjail_sourcetree}/Makefile" ] || exerr "Error: Your source tree in ${ezjail_sourcetree} seems to be incomplete (Makefile is missing)."