Browse files

Do cleanup of old pourdiere ports trees

  • Loading branch information...
1 parent 278b8da commit 9d9ca002d86fcd81641d610c600f737b9e37e07e @kmoore134 kmoore134 committed Nov 20, 2013
Showing with 8 additions and 21 deletions.
  1. +8 −21 scripts/portbuild.sh
View
29 scripts/portbuild.sh
@@ -18,27 +18,6 @@ sh ${PROGDIR}/scripts/checkprogs.sh
cStat=$?
if [ $cStat -ne 0 ] ; then exit $cStat; fi
-exit_trap()
-{
- echo -e "Cleaning up poudriere build...\c"
- if [ -z "$1" ] ; then
- status="99"
- else
- status="$1"
- fi
- if [ -e "$ans" ] ; then
- rm ${ans}
- fi
- if [ -n "$pCleanup" ] ; then
- sleep 10
- poudriere jail -k $pCleanup
- fi
- echo -e "Done"
- exit 0
-}
-
-trap exit_trap 1 2 3 9 15
-
merge_pcbsd_src_ports()
{
local mcwd=`pwd`
@@ -159,13 +138,21 @@ do_portsnap()
echo "Updating ports collection..."
poudriere -l | grep -q "^{POUDPORTS"
if [ $? -eq 0 ] ; then
+ if [ -d "$PJPORTSDIR" ] ; then
+ echo "Removing old $PJPORTSDIR"
+ rm -rf $PJPORTSDIR
+ fi
poudriere ports -u -m git -p "$POUDPORTS"
if [ $? -ne 0 ] ; then
echo "Failed to update ports $POUDPORTS"
mv /tmp/.poudriere.conf.$$ /usr/local/etc/poudriere.conf
exit 1
fi
else
+ if [ -d "$PJPORTSDIR" ] ; then
+ echo "Removing old $PJPORTSDIR"
+ rm -rf $PJPORTSDIR
+ fi
poudriere ports -c -m git -p "$POUDPORTS"
if [ $? -ne 0 ] ; then
echo "Failed to create ports $POUDPORTS"

0 comments on commit 9d9ca00

Please sign in to comment.