Permalink
Browse files

Improve error handling in use and revdep snippets.

  • Loading branch information...
1 parent afa35b8 commit cde2471417947782f037b2e8df8125d597820fb7 @tom111 tom111 committed Nov 12, 2012
Showing with 16 additions and 3 deletions.
  1. +12 −3 templates/revdep-snippet
  2. +4 −0 templates/use-snippet
View
@@ -1,4 +1,13 @@
-if @@FEATURES@@ @@USE@@ emerge -1 @@EMERGEOPTS@@ @@CPV@@; then
-echo "@@FEATURES@@ @@USE@@ emerge -1 @@EMERGEOPTS@@ @@CPV@@ succeeded" >> @@REPORTFILE@@;
-else echo "@@FEATURES@@ @@USE@@ emerge -1 @@EMERGEOPTS@@ @@CPV@@ failed" >> @@REPORTFILE@@;
+eout=$( @@FEATURES@@ @@USE@@ emerge -1 @@EMERGEOPTS@@ @@CPV@@ 2>&1 1>/dev/tty )
+if [[ $? == 0 ]] ; then
+ echo "@@FEATURES@@ @@USE@@ succeeded for @@CPV@@" >> @@REPORTFILE@@;
+elif [[ "${eout}" =~ REQUIRED_USE ]] ; then
+ echo "${eout}";
+ echo "@@CPV@@ : REQUIRED_USE not satisfied (probably) for " >> @@REPORTFILE@@;
+elif [[ "${eout}" =~ USE_CHANGES ]] ; then
+ echo "${eout}";
+ echo "@@CPV@@ : USE dependencies not satisfied (probably)" >> @@REPORTFILE@@;
+else
+ echo "${eout}";
+ echo "@@FEATURES@@ failed for @@CPV@@" >> @@REPORTFILE@@;
fi;
View
@@ -2,7 +2,11 @@ eout=$( @@USE@@ @@FEATURES@@ emerge -1 @@EMERGEOPTS@@ @@CPV@@ 2>&1 1>/dev/tty )
if [[ $? == 0 ]] ; then
echo "@@USE@@ @@FEATURES@@ succeeded for @@CPV@@" >> @@REPORTFILE@@;
elif [[ "${eout}" =~ REQUIRED_USE ]] ; then
+ echo "${eout}";
echo "@@USE@@ : REQUIRED_USE not satisfied (probably)" >> @@REPORTFILE@@;
+elif [[ "${eout}" =~ USE_CHANGES ]] ; then
+ echo "${eout}";
+ echo "@@USE@@ : USE dependencies not satisfied (probably)" >> @@REPORTFILE@@;
else
echo "${eout}";
echo "@@USE@@ @@FEATURES@@ failed for @@CPV@@" >> @@REPORTFILE@@;

0 comments on commit cde2471

Please sign in to comment.