summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2013-03-27 18:36:11 +0000
committererdgeist <erdgeist@erdgeist.org>2013-03-27 18:36:11 +0000
commit2d4d1c759a43a69a0e2007cfe7b5547e1b4c4cf1 (patch)
treec24ba1901bef8bcf874d4bf978754d079f22e271
parente7a889bb091896bdfb759a08b77083f52b5e9747 (diff)
Handle relative paths in packages better
-rwxr-xr-xezjail-admin12
1 files changed, 7 insertions, 5 deletions
diff --git a/ezjail-admin b/ezjail-admin
index 9586cc9..cb871b9 100755
--- a/ezjail-admin
+++ b/ezjail-admin
@@ -1028,6 +1028,7 @@ install)
1028 # for post-install man/src installations 1028 # for post-install man/src installations
1029 [ "${ezjail_basesystem}" ] && DESTDIR="${ezjail_jailfull}" || DESTDIR="${ezjail_jailbase}" 1029 [ "${ezjail_basesystem}" ] && DESTDIR="${ezjail_jailfull}" || DESTDIR="${ezjail_jailbase}"
1030 1030
1031 ezjail_makeabsolute ezjail_jailtemp
1031 rm -rf "${ezjail_jailtemp}" 1032 rm -rf "${ezjail_jailtemp}"
1032 for pkg in ${ezjail_basesystem} ${ezjail_installmanpages} ${ezjail_installsources}; do 1033 for pkg in ${ezjail_basesystem} ${ezjail_installmanpages} ${ezjail_installsources}; do
1033 1034
@@ -1038,13 +1039,12 @@ install)
1038 [ -r "${ezjail_disturi}/${pkg}.txz" ] || exerr "Error: Can not access package file ${ezjail_disturi}/${pkg}.txz" 1039 [ -r "${ezjail_disturi}/${pkg}.txz" ] || exerr "Error: Can not access package file ${ezjail_disturi}/${pkg}.txz"
1039 xzdec ${ezjail_disturi}/${pkg}.txz | tar --unlink -xpJf - -C ${DESTDIR} 1040 xzdec ${ezjail_disturi}/${pkg}.txz | tar --unlink -xpJf - -C ${DESTDIR}
1040 else 1041 else
1041 ezjail_backdir=`pwd -P` 1042 ezjail_makeabsolute ezjail_disturi
1042 cd "${ezjail_disturi}/${pkg}" || exerr "Error: Could not cd to ${ezjail_disturi}." 1043 cd "${ezjail_disturi}/${pkg}" || exerr "Error: Could not cd to ${ezjail_disturi}/${pkg}."
1043 [ "${pkg}" = "base" ] && echo "Ignore the next question, ezjail answers it for you." 1044 [ "${pkg}" = "base" ] && echo "Ignore the next question, ezjail answers it for you."
1044 set -- all 1045 set -- all
1045 [ -f install.sh ] && yes | . install.sh 1046 [ -f install.sh ] && yes | . install.sh
1046 [ $? -eq 0 ] || exerr "Error: Package install script for ${pkg} failed." 1047 [ $? -eq 0 ] || exerr "Error: Package install script for ${pkg} failed."
1047 cd "${ezjail_backdir}"
1048 fi 1048 fi
1049 else 1049 else
1050 # The hard case means, we have to fetch the distribution files from a remote server 1050 # The hard case means, we have to fetch the distribution files from a remote server
@@ -1066,8 +1066,9 @@ install)
1066 if [ ${ezjail_release_major} -ge 9 ]; then 1066 if [ ${ezjail_release_major} -ge 9 ]; then
1067 fetch "${ezjail_proto}://${ezjail_disturi}/${ezjail_path}/${ezjail_installplatform}/${ezjail_installarch}/${ezjail_release}/${pkg}.txz" || continue 1067 fetch "${ezjail_proto}://${ezjail_disturi}/${ezjail_path}/${ezjail_installplatform}/${ezjail_installarch}/${ezjail_release}/${pkg}.txz" || continue
1068 xzdec ${pkg}.txz | tar --unlink -xpJf - -C ${DESTDIR} 1068 xzdec ${pkg}.txz | tar --unlink -xpJf - -C ${DESTDIR}
1069 _res=$?
1069 else 1070 else
1070 [ "${ezjail_proto}" = "ftp" ] || echo "Warning: Ignoring http protocol on FreeBSD pre 9.0" 1071 [ "${ezjail_proto}" = "ftp" ] || echo "Warning: Ignoring ${ezjail_proto} protocol on FreeBSD pre 9.0"
1071 ftp ${ezjail_disturi}:${ezjail_path}/${ezjail_installarch}/${ezjail_release}/${pkg}/* || continue 1072 ftp ${ezjail_disturi}:${ezjail_path}/${ezjail_installarch}/${ezjail_release}/${pkg}/* || continue
1072 # These actions are really ugly: sources want $1 to contain the set 1073 # These actions are really ugly: sources want $1 to contain the set
1073 # of sources to install, base asks the user if he is sure, hence the 1074 # of sources to install, base asks the user if he is sure, hence the
@@ -1075,10 +1076,11 @@ install)
1075 [ "${pkg}" = "base" ] && echo "Ignore the next question, ezjail answers it for you." 1076 [ "${pkg}" = "base" ] && echo "Ignore the next question, ezjail answers it for you."
1076 set -- all 1077 set -- all
1077 [ -f install.sh ] && yes | . install.sh 1078 [ -f install.sh ] && yes | . install.sh
1078 [ $? -eq 0 ] || exerr "Error: Package install script for ${pkg} failed." 1079 _res=$?
1079 fi 1080 fi
1080 1081
1081 rm -rf "${ezjail_jailtemp}" 1082 rm -rf "${ezjail_jailtemp}"
1083 [ ${_res} -eq 0 ] || exerr "Error: Package install script for ${pkg} failed."
1082 break 1084 break
1083 done 1085 done
1084 fi 1086 fi