summaryrefslogblamecommitdiffstats
path: root/root/posodobi.sh
blob: c8d45f0e81338b9ba6c3dbf6cd6795f836f58e35 (plain) (tree)
1
           

















                                                                                                                         
       
  
                                                      
                                



                                                                                                                                                         
                 
#!/bin/bash
if grep "cron" <<<"$@" > /dev/null
then
	i=`sed s,^./,,g <<<$0`
	t=`mktemp -p "" $i.XXX.html`
	status=$?
	if [ ! $status -eq 0 ]
	then
		echo začasne datoteke ni uspelo izdelati. mktemp je končal s $status.
		exit 1
	fi
	$0 --no-ask --colour 2>&1 | aha --black --title "`hostname` $0 cron `date`" > $t
	status=$?
	if [ ! $status -eq 0 ]
	then
		echo posodobitev ni uspela. $0 je končal s $status. izhod je dostopen na http://`hostname`.sijanec.eu/$t
	fi
	exit $status
fi
set -xe
f=
grep "no-sync" <<<"$@" || /usr/sbin/emaint sync --auto
grep "no-ask" <<<"$@" || f=--ask
grep "colo" <<<"$@" || f="$f --color y"
[ `hostname` = varovalka ] && f="$f --exclude=media-libs/mesa"
emerge --tree --verbose --update $f --newuse --changed-use --backtrack 30 --deep --with-bdeps=y --rebuilt-binaries --autounmask --autounmask-write @world
emerge @preserved-rebuild --autounmask-write
emerge --depclean