summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuta SATOH <nigoro@gentoo.gr.jp>2015-07-13 21:38:31 +0900
committerYuta SATOH <nigoro@gentoo.gr.jp>2015-07-13 21:38:31 +0900
commit3e4b2faf25edc29cd6194fbb202b5e1271d9e856 (patch)
treef38c64cd3b1752e137b0c939bff26dfa231e50e7 /scripts
parentautomatic_updater.sh: fixed perl issue, amd64/clang profile support. (diff)
downloadgentoo-bsd-3e4b2faf25edc29cd6194fbb202b5e1271d9e856.tar.gz
gentoo-bsd-3e4b2faf25edc29cd6194fbb202b5e1271d9e856.tar.bz2
gentoo-bsd-3e4b2faf25edc29cd6194fbb202b5e1271d9e856.zip
create_forcestage3.sh: fixed some issues. tested amd64/10.1, amd64/10.1/clang, x86/10.1.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mkstages/create_forcestage3.sh26
1 files changed, 22 insertions, 4 deletions
diff --git a/scripts/mkstages/create_forcestage3.sh b/scripts/mkstages/create_forcestage3.sh
index 515aae2..e0aff8c 100644
--- a/scripts/mkstages/create_forcestage3.sh
+++ b/scripts/mkstages/create_forcestage3.sh
@@ -14,6 +14,15 @@ prepare(){
local distdir="$(emerge --info | grep DISTDIR | sed s:DISTDIR=::g | sed 's:"::g')"
if [[ ! -d "${WORKDIR}" ]]; then
mkdir -p "${WORKDIR}"
+ else
+ echo "${WORKDIR} exists."
+ echo "Please remove the following steps."
+ echo ""
+ echo "kill -9 $(ps auxw | grep ebuild-helpers/ecompressdir | grep -v grep | awk '{ print $2 }' | xargs)"
+ echo "umount $(mount | grep ${WORKDIR} | awk '{print $3}' | xargs)"
+ echo "umount $(mount | grep ${WORKDIR} | awk '{print $3}' | xargs)"
+ echo "chflags -R noschg \"${WORKDIR}\" && rm -rf \"${WORKDIR}\""
+ exit 1
fi
if [[ "${OLDSTAGE3}" =~ ^http ]]; then
@@ -56,6 +65,9 @@ chroot_update(){
export EMERGE_DEFAULT_OPTS="-q"
chroot "${WORKDIR}" bash /automatic_updater.sh ${TARGETVER} kernel
chroot "${WORKDIR}" bash /automatic_updater.sh ${TARGETVER} freebsd_userland
+ if [[ -e "${WORKDIR}"/usr/bin/git ]]; then
+ chroot "${WORKDIR}" emerge -C dev-vcs/git
+ fi
REMOVEPERL=1 chroot "${WORKDIR}" bash /automatic_updater.sh ${TARGETVER} world
unset EMERGE_DEFAULT_OPTS
}
@@ -74,8 +86,13 @@ check_ecompressdir() {
}
cleanup(){
+ local distdir="$(emerge --info | grep DISTDIR | sed s:DISTDIR=::g | sed 's:"::g')"
+
check_ecompressdir
- umount "${WORKDIR}"/usr/portage/distfiles
+ if [[ ! "${distdir}" =~ ${PORTDIR}.* ]]; then
+ echo "unmount DISTDIR"
+ umount "${WORKDIR}"/usr/portage/distfiles
+ fi
umount "${WORKDIR}"/usr/portage
if [[ "${TMPFS}" -ne 0 ]] ; then
umount "${WORKDIR}"/var/tmp/portage
@@ -91,12 +108,13 @@ create_stage3(){
mkdir -p /var/tmp/catalyst/builds/default
fi
if [[ ${CLANG} -ne 0 ]]; then
- tarfile="stage3-${TARGETARCH}-fbsd-${TAGETVER}-forcestage3-cl"
+ tarfile="stage3-${TARGETARCH}-fbsd-${TARGETVER}-forcestage3-cl"
else
- tarfile="stage3-${TARGETARCH}-fbsd-${TAGETVER}-forcestage3"
+ tarfile="stage3-${TARGETARCH}-fbsd-${TARGETVER}-forcestage3"
fi
- tar cjpf /var/tmp/catalyst/builds/default/"${tarfile}".tar.bz2 .
+ echo "Compress with tar."
+ LANG="en_US.UTF-8" tar cjpf /var/tmp/catalyst/builds/default/"${tarfile}".tar.bz2 .
echo "Complete !"
echo "Set FORCESTAGE3=${tarfile}"