summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/pc-sysinstall/backend/functions-installpackages.sh')
-rwxr-xr-xusr.sbin/pc-sysinstall/backend/functions-installpackages.sh150
1 files changed, 75 insertions, 75 deletions
diff --git a/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh b/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh
index e967011..3e0a4ba 100755
--- a/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh
+++ b/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh
@@ -33,93 +33,93 @@
# Recursively determine all dependencies for this package
determine_package_dependencies()
{
- local PKGNAME="${1}"
- local DEPFILE="${2}"
-
- grep "${PKGNAME}" "${DEPFILE}" >/dev/null
- if [ "$?" -ne "0" ]
- then
- echo "${PKGNAME}" >> "${DEPFILE}"
- get_package_dependencies "${PKGNAME}" "1"
- local DEPS="${VAL}"
-
- for d in ${DEPS}
- do
- determine_package_dependencies "${d}" "${DEPFILE}"
- done
- fi
+ local PKGNAME="${1}"
+ local DEPFILE="${2}"
+
+ grep "${PKGNAME}" "${DEPFILE}" >/dev/null
+ if [ "$?" -ne "0" ]
+ then
+ echo "${PKGNAME}" >> "${DEPFILE}"
+ get_package_dependencies "${PKGNAME}" "1"
+
+ local DEPS="${VAL}"
+ for d in ${DEPS}
+ do
+ determine_package_dependencies "${d}" "${DEPFILE}"
+ done
+ fi
};
# Fetch packages dependencies from a file
fetch_package_dependencies()
{
- local DEPFILE
- local DEPS
- local SAVEDIR
+ local DEPFILE
+ local DEPS
+ local SAVEDIR
- DEPFILE="${1}"
- DEPS=`cat "${DEPFILE}"`
- SAVEDIR="${2}"
+ DEPFILE="${1}"
+ DEPS=`cat "${DEPFILE}"`
+ SAVEDIR="${2}"
- for d in ${DEPS}
- do
- get_package_short_name "${d}"
- SNAME="${VAL}"
+ for d in ${DEPS}
+ do
+ get_package_short_name "${d}"
+ SNAME="${VAL}"
- get_package_category "${SNAME}"
- CATEGORY="${VAL}"
+ get_package_category "${SNAME}"
+ CATEGORY="${VAL}"
- fetch_package "${CATEGORY}" "${d}" "${SAVEDIR}"
- done
+ fetch_package "${CATEGORY}" "${d}" "${SAVEDIR}"
+ done
};
# Check for any packages specified, and begin loading them
install_packages()
{
- # First, lets check and see if we even have any packages to install
- get_value_from_cfg installPackages
- if [ ! -z "${VAL}" ]
- then
- HERE=`pwd`
- rc_nohalt "mkdir -p ${FSMNT}/${PKGTMPDIR}"
- rc_nohalt "cd ${FSMNT}/${PKGTMPDIR}"
-
- if [ ! -f "${CONFDIR}/INDEX" ]
- then
- get_package_index
- fi
-
- if [ ! -f "${CONFDIR}/INDEX.parsed" ]
- then
- parse_package_index
- fi
-
- # Lets start by cleaning up the string and getting it ready to parse
- strip_white_space ${VAL}
- PACKAGES=`echo ${VAL} | sed -e "s|,| |g"`
- for i in $PACKAGES
- do
- if get_package_name "${i}"
- then
- PKGNAME="${VAL}"
- DEPFILE="${FSMNT}/${PKGTMPDIR}/.${PKGNAME}.deps"
-
- rc_nohalt "touch ${DEPFILE}"
- determine_package_dependencies "${PKGNAME}" "${DEPFILE}"
- fetch_package_dependencies "${DEPFILE}" "${FSMNT}/${PKGTMPDIR}"
-
- # If the package is not already installed, install it!
- if ! run_chroot_cmd "pkg_info -e ${PKGNAME}"
- then
- rc_nohalt "pkg_add -C ${FSMNT} ${PKGTMPDIR}/${PKGNAME}.tbz"
- fi
-
- rc_nohalt "rm ${DEPFILE}"
- fi
-
- rc_nohalt "cd ${HERE}"
- done
-
- #rm -rf "${FSMNT}/${PKGTMPDIR}"
- fi
+ # First, lets check and see if we even have any packages to install
+ get_value_from_cfg installPackages
+ if [ ! -z "${VAL}" ]
+ then
+ HERE=`pwd`
+ rc_nohalt "mkdir -p ${FSMNT}/${PKGTMPDIR}"
+ rc_nohalt "cd ${FSMNT}/${PKGTMPDIR}"
+
+ if [ ! -f "${CONFDIR}/INDEX" ]
+ then
+ get_package_index
+ fi
+
+ if [ ! -f "${CONFDIR}/INDEX.parsed" ]
+ then
+ parse_package_index
+ fi
+
+ # Lets start by cleaning up the string and getting it ready to parse
+ strip_white_space ${VAL}
+ PACKAGES=`echo ${VAL} | sed -e "s|,| |g"`
+ for i in $PACKAGES
+ do
+ if get_package_name "${i}"
+ then
+ PKGNAME="${VAL}"
+ DEPFILE="${FSMNT}/${PKGTMPDIR}/.${PKGNAME}.deps"
+
+ rc_nohalt "touch ${DEPFILE}"
+ determine_package_dependencies "${PKGNAME}" "${DEPFILE}"
+ fetch_package_dependencies "${DEPFILE}" "${FSMNT}/${PKGTMPDIR}"
+
+ # If the package is not already installed, install it!
+ if ! run_chroot_cmd "pkg_info -e ${PKGNAME}"
+ then
+ rc_nohalt "pkg_add -C ${FSMNT} ${PKGTMPDIR}/${PKGNAME}.tbz"
+ fi
+
+ rc_nohalt "rm ${DEPFILE}"
+ fi
+
+ rc_nohalt "cd ${HERE}"
+ done
+
+ rm -rf "${FSMNT}/${PKGTMPDIR}"
+ fi
};
OpenPOWER on IntegriCloud