aboutsummaryrefslogtreecommitdiff
blob: 5d01821d8fd6aad2a5a38046cfe8b6137fe7ea42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# Reverse dependency testing for @@JOB@@

trap "echo 'signal captured, exiting the entire script...'; exit" SIGHUP SIGINT SIGTERM 

function tatt_pkg_error
{
  local eout=${2}

  echo "${eout}"

  if [ -n "${USE}" ]; then
    echo -n "USE='${USE}'" >> @@REPORTFILE@@
  fi
  if [ -n "${FEATURES}" ]; then
    echo -n " FEATURES='${FEATURES}'" >> @@REPORTFILE@@
  fi

  if [[ "${eout}" =~ REQUIRED_USE ]] ; then
    echo " : REQUIRED_USE not satisfied (probably) for ${1:?}" >> @@REPORTFILE@@
  elif [[ "${eout}" =~ USE\ changes ]] ; then
    echo " : USE dependencies not satisfied (probably) for ${1:?}" >> @@REPORTFILE@@
  elif [[ "${eout}" =~ keyword\ changes ]]; then
    echo " : unkeyworded dependencies (probably) for ${1:?}" >> @@REPORTFILE@@
  elif [[ "${eout}" =~ Error:\ circular\ dependencies: ]]; then
    echo " : circular dependencies (probably) for ${1:?}" >> @@REPORTFILE@@
  elif [[ "${eout}" =~ Blocked\ Packages ]]; then
    echo " : blocked packages (probably) for ${1:?}" >> @@REPORTFILE@@
  else
    echo " failed for ${1:?}" >> @@REPORTFILE@@
  fi

  CP=${1#=}
  BUILDLOG=/var/tmp/portage/${CP}/temp/build.log
  if [[ -n "@@BUILDLOGDIR@@" && -s "${BUILDLOG}" ]]; then
    LOGNAME=$(mktemp -p "@@BUILDLOGDIR@@" "${CP/\//_}_rdep_XXXXX")
    mv "${BUILDLOG}" "${LOGNAME}"
    echo "    log has been saved as ${LOGNAME}" >> @@REPORTFILE@@
  fi
}

echo -e "revdep tests started on $(date)\n" >> @@REPORTFILE@@