Commit e933e92b authored by Bernhard Landauer's avatar Bernhard Landauer
Browse files

fix prepare_chroot option k

parent c87d1c46
# Author: Bernhard Landauer <bernhard@manjaro.org>
pkgname=manjaro-chrootbuild
pkgver=r197.g07dd6a7
pkgver=r198.gc87d1c4
pkgrel=1
pkgdesc="Build packages and buildlists in a chroot filesystem."
arch=('any')
......
......@@ -12,7 +12,7 @@ trap 'abort "Aborted."' INT
check_root
get_default_branch
while getopts "b:chmku" arg; do
while getopts "b:chk:mu" arg; do
case "${arg}" in
b) BRANCH="${OPTARG}" ;;
c) CLEAN=true ;;
......
......@@ -72,7 +72,7 @@ update_chroot() {
conf_pacman
set_branch $2
msg "Update chroot file system"
sudo chroot ${CHROOT_DIR} pacman -Syu --noconfirm || abort "Failed to update chroot."
sudo chroot $1 pacman -Syu --noconfirm || abort "Failed to update chroot."
}
create_chroot() {
......@@ -134,13 +134,13 @@ prepare_chroot() {
if [ -e $1/.lock ]; then
err_choice "Chroot is busy. Force unmount? [y/N]"
read choice
if [ $choice = y 2>/dev/null ] ;then
if [[ "$choice" = "y" 2>/dev/null ]]; then
cleanup "Re-mounting chroot filesystem."
else
exit 1
fi
fi
if [ ${CLEAN} = true ]; then
if [[ "${CLEAN}" = "true" ]]; then
msg "Delete old chroot file system"
rm -rf $1/*
create_chroot $1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment