Skip to content

Commit

Permalink
Update to the new and brighter pkg world
Browse files Browse the repository at this point in the history
  • Loading branch information
bsdphk committed Dec 15, 2012
1 parent 5b93c62 commit 242473b
Showing 1 changed file with 39 additions and 27 deletions.
66 changes: 39 additions & 27 deletions tools/tools/sysbuild/sysbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -225,37 +225,49 @@ ports_build() (
# Now build & install them
for p in `cat /tmp/_.plist`
do
b=`echo $p | tr / _`
t=`echo $p | sed 's,/usr/ports/,,'`
pn=`cd $p && make package-name`
if [ "x${PKG_DIR}" != "x" -a -f ${PKG_DIR}/$pn.tbz ] ; then
if [ "x$use_pkg" = "x-p" ] ; then
log_it "install $p from ${PKG_DIR}/$pn.tbz"
pkg_add ${PKG_DIR}/$pn.tbz
fi

if pkg info $pn > /dev/null 2>&1 ; then
log_it "Already installed: $t ($pn)"
continue
fi
i=`pkg_info -qO $t`
if [ -z "$i" ] ; then
log_it "build $p"
b=`echo $p | tr / _`

if [ "x$p" == "x/usr/ports/ports-mgmt/pkg" ] ; then
log_it "Very Special: $t ($pn)"
(
set -x
cd /usr/ports
cd $p
set +e
make clean ${PORTS_OPTS}
if make install ${PORTS_OPTS} ; then
if [ "x${PKG_DIR}" != "x" ] ; then
make package ${PORTS_OPTS}
mkdir -p ${PKG_DIR}
mv *.tbz ${PKG_DIR}
fi
else
log_it FAIL build $p
fi
make clean
cd $p
make clean all install ${PORTS_OPTS}
) > _.$b 2>&1 < /dev/null
date
continue
fi

if [ "x${PKG_DIR}" != "x" -a -f ${PKG_DIR}/$pn.txz ] ; then
if [ "x$use_pkg" = "x-p" ] ; then
log_it "Install $t ($pn)"
(
set +e
pkg add ${PKG_DIR}/$pn.txz || true
) > _.$b 2>&1 < /dev/null
continue
fi
fi

log_it "build $pn ($p)"
(
set +e
cd $p
make clean ${PORTS_OPTS}
if make install ${PORTS_OPTS} ; then
if [ "x${PKG_DIR}" != "x" ] ; then
make package ${PORTS_OPTS}
fi
else
log_it FAIL build $p
fi
make clean
) > _.$b 2>&1 < /dev/null
done
)

Expand Down Expand Up @@ -463,7 +475,7 @@ export PORTS_OPTS
#######################################################################

log_it Prepare destination partition
newfs -O2 -U /dev/${TARGET_PART} > /dev/null
newfs -t -E -O2 -U /dev/${TARGET_PART} > /dev/null
mount /dev/${TARGET_PART} ${SBMNT}
mkdir -p ${SBMNT}/dev
mount -t devfs devfs ${SBMNT}/dev
Expand Down Expand Up @@ -564,7 +576,7 @@ sed "/[ ]\/[ ]/s;^[^ ]*[ ];/dev/${TARGET_PART} ;" \
/etc/fstab > ${SBMNT}/etc/fstab

log_it build ports
pwd

cp $0 ${SBMNT}/root
cp /tmp/_sb_log ${SBMNT}/tmp
b=`basename $0`
Expand Down

0 comments on commit 242473b

Please sign in to comment.