diff options
author | Thomas Kahle <tomka@gentoo.org> | 2012-11-12 14:21:49 -0800 |
---|---|---|
committer | Thomas Kahle <tomka@gentoo.org> | 2012-11-12 14:21:49 -0800 |
commit | cde2471417947782f037b2e8df8125d597820fb7 (patch) | |
tree | 23bbb56239f5c156c7e2c9ef5ed32602567d018c /templates | |
parent | In case of error, let USE script print error messages. (diff) | |
download | tatt-cde2471417947782f037b2e8df8125d597820fb7.tar.gz tatt-cde2471417947782f037b2e8df8125d597820fb7.tar.bz2 tatt-cde2471417947782f037b2e8df8125d597820fb7.zip |
Improve error handling in use and revdep snippets.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/revdep-snippet | 15 | ||||
-rw-r--r-- | templates/use-snippet | 4 |
2 files changed, 16 insertions, 3 deletions
diff --git a/templates/revdep-snippet b/templates/revdep-snippet index f008864..13368dd 100644 --- a/templates/revdep-snippet +++ b/templates/revdep-snippet @@ -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; diff --git a/templates/use-snippet b/templates/use-snippet index 828320a..d32fa12 100644 --- a/templates/use-snippet +++ b/templates/use-snippet @@ -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@@; |