neuron Advocate
Joined: 28 May 2002 Posts: 2371
|
Posted: Fri Dec 26, 2003 10:30 pm Post subject: |
|
|
Code: |
#!/bin/bash
#original script from cschwede on forums.gentoo.org
/usr/bin/emerge sync > /dev/null
upd=0
for i in ` /usr/bin/emerge -pUD world | grep ebuild | cut -f 2- -d "/" | cut -f
1 -d " " ` ;
do
upd=1
new_pkg=$(echo $i | cut -f 1 -d "-" )
pkg="$pkg $new_pkg"
if [ -f /usr/portage/packages/All/$i.tbz2 ]
then echo "Binary package $i existing, but it's not installed."
else echo "Binary package $i doen't exist, emerging... "; /usr/bin/nice
-n +19 /usr/bin/emerge -B =$i > /var/log/update.log
fi
done
if [ "$upd" -eq "1" ]
then
echo Done.. to update system:
echo emerge -k $pkg
spaceused=$(du -h -s /usr/portage/distfiles | awk '{print $1}')
spaceused2=$(du -h -s /usr/portage/packages | awk '{print $1}')
echo Space used by distfiles : $spaceused, and packages $spaceused2
fi
|
this is the script I use, doesen't work great, but it's functional. (the mail it sends is sometimes a bit wrong, but it generates the right packages anyway)
note, this doesen't install anything, but compiles binary packages, so you can emerge -kDU world. And as you can see the original script is made by cschwede, I just added the mail stuff on the bottom. |
|