#!/bin/bash
# gentoo system packages

declare -i tries=0
declare -i MAX=1

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