log buildUpgradePackages to syslog
This commit is contained in:
parent
cf84281d6c
commit
483be827ce
1 changed files with 12 additions and 1 deletions
|
@ -2,11 +2,20 @@
|
|||
|
||||
. /etc/portage/make.conf
|
||||
|
||||
script="$0"
|
||||
|
||||
function mylog() {
|
||||
logger -t "$script" "${*}"
|
||||
}
|
||||
|
||||
mylog "testing if other instances are running"
|
||||
|
||||
if [[ $(pgrep -f -c $(basename $0)) -gt 1 ]] ; then
|
||||
# echo other instance still running
|
||||
mylog "other instance still running"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mylog "start building packages"
|
||||
for atom in $(emerge -uDN --pretend --quiet world | grep ^'\[ebuild' | sed -e 's/.* \b\([a-z0-9\-]\+\/[\_A-Za-z\.0-9\-]\+\)\b.*/\1/g');
|
||||
do
|
||||
PACKAGE_FILE="$PKGDIR/$atom.tbz2"
|
||||
|
@ -27,9 +36,11 @@ done
|
|||
if [[ -n "${SUCCESS}" ]]
|
||||
then
|
||||
echo "Successfully build: ${SUCCESS}"
|
||||
mylog "Successfully build: ${SUCCESS}"
|
||||
fi
|
||||
|
||||
if [[ -n "${FAILURE}" ]]
|
||||
then
|
||||
echo "Build Failures: ${FAILURE}"
|
||||
mylog "Build Failures: ${FAILURE}"
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue