[PC-BSD Commits] r7844 - pcbsd/current/src-sh/pbi-manager
svn at pcbsd.org
svn at pcbsd.org
Sat Oct 16 06:32:45 PDT 2010
Author: kris
Date: 2010-10-16 06:32:45 -0700 (Sat, 16 Oct 2010)
New Revision: 7844
Modified:
pcbsd/current/src-sh/pbi-manager/pbi-manager
Log:
Cleanup build.log when doing auto-builds, and added flag for removing wrkdirs
when starting new builds
Modified: pcbsd/current/src-sh/pbi-manager/pbi-manager
===================================================================
--- pcbsd/current/src-sh/pbi-manager/pbi-manager 2010-10-16 13:20:53 UTC (rev 7843)
+++ pcbsd/current/src-sh/pbi-manager/pbi-manager 2010-10-16 13:32:45 UTC (rev 7844)
@@ -112,6 +112,7 @@
-k -- Keep build files, don't delete when finished
-o outdir -- Where to place the finished PBI file
-p prefix -- Specify alternate PBI Compile PREFIX
+ --delbuild -- Delete existing build dirs if they exist
--mkdebug -- Drop to debug shell if port make fails
--no-prune -- Do not prune non REQUIREDBY ports
--sign key -- Sign the PBI with specified openssl key
@@ -594,6 +595,8 @@
-k) PBI_KEEPBUILDFILES="YES"
;;
+ --delbuild) MKDELBUILD="YES"
+ ;;
--no-prune) PBI_PRUNEBUILDPORTS="NO"
;;
--mkdebug) MKDEBUG="YES"
@@ -748,6 +751,7 @@
PBI_UNINS_PATHSCRIPT="uninstall-pathlinks.sh"
# User overridable variables
+ MKDELBUILD=""
MKDEBUG=""
PBI_AB_ARCHIVENUM=""
PBI_AB_CONFDIR=""
@@ -928,7 +932,15 @@
PREFIX="${PBI_PROGDIRPATH}" ; export PREFIX
WRKDIRPREFIX="${PBI_PROGDIRPATH}.wrkdir" ; export WRKDIRPREFIX
if [ -e "${PREFIX}" ] ; then
- exit_err "${PREFIX} already exists! Delete it before doing a rebuild"
+ if [ "$MKDELBUILD" != "YES" ] ; then
+ exit_err "${PREFIX} already exists! Delete it before doing a rebuild"
+ else
+ if [ -z "${PREFIX}" -o -z "$WRKDIRPREFIX" ] ; then
+ exit_err "null PREFIX, this shouldn't happen"
+ fi
+ rm -rf "${PREFIX}"
+ rm -rf "${WRKDIRPREFIX}"
+ fi
fi
mkdir -p ${PREFIX}
@@ -3399,7 +3411,7 @@
_cd="${4}"
_od="${5}/${_cd}"
_flags=""
- _flags="-c ${_cd} -d ${PORTSDIR} -o ${_od}"
+ _flags="-c ${_cd} -d ${PORTSDIR} -o ${_od} --delbuild"
if [ ! -z "${PBI_AB_SSLPRIVKEY}" ] ; then
_flags="${_flags} --sign ${PBI_AB_SSLPRIVKEY}"
fi
@@ -3409,6 +3421,15 @@
if [ ! -d "${_od}" ] ; then mkdir -p "${_od}" ; fi
oldpbi="`ls ${_od}/*.pbi 2>/dev/null`"
+ # Clean old log files
+ if [ -e "${_od}/build.log" ] ; then
+ rm "${_od}/build.log"
+ fi
+ if [ -e "${_od}/build.log.bz2" ] ; then
+ rm "${_od}/build.log.bz2"
+ fi
+
+ # Star the build now
pbi_makeport ${_flags} ${_mp} >>${_od}/build.log 2>>${_od}/build.log
if [ "$?" = "0" ] ; then
More information about the Commits
mailing list