#!/bin/bash
# gentoo world packages

declare -i tries=0
declare -i MAX=2

# 5 tries
while [ $tries -lt $MAX ];
do
  if ! emerge -uDN @world; 
  then
    revdep-rebuild
    tries=$((tries+1))
  else
    exit 0
  fi 
done
