cookutils rev 962
cook: add cook_pick_docs() and COOKOPTS="skip-log-errors"; update doc.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Thu Aug 31 03:14:01 2017 +0300 (2017-08-31) |
parents | a73e67901f49 |
children | 96304f0412ca |
files | cook doc/cookopts.txt |
line diff
1.1 --- a/cook Tue Aug 29 17:24:54 2017 +0300 1.2 +++ b/cook Thu Aug 31 03:14:01 2017 +0300 1.3 @@ -816,10 +816,12 @@ 1.4 if [ ! -d "$WOK/$pkg/install" ] && [ -z "$WANTED" ]; then 1.5 _ 'ERROR: cook failed' | tee -a $LOGS/$pkg.log 1.6 fi 1.7 + 1.8 + [ "${COOKOPTS/skip-log-errors/}" != "$COOKOPTS" ] && return 0 1.9 + 1.10 # ERROR can be echoed any time in cookit() 1.11 - lerror=$(_n 'ERROR') 1.12 if grep -Ev "(conftest|configtest)" $LOGS/$pkg.log | \ 1.13 - grep -Eq "(^$lerror|undefined reference to)" ; then 1.14 + grep -Eq "(^ERROR|undefined reference to)" ; then 1.15 debug_info | tee -a $LOGS/$pkg.log 1.16 sed -i '$ s|$| [ Failed ]|' $activity 1.17 rm -f $command 1.18 @@ -1324,6 +1326,18 @@ 1.19 } 1.20 1.21 1.22 +# Function to use in compile_rules() to copy documentation from $src to $install 1.23 + 1.24 +cook_pick_docs() { 1.25 + local docdir="$install/usr/share/doc/$PACKAGE-$VERSION" 1.26 + action 'Copying documentation...' 1.27 + mkdir -p $docdir 1.28 + cp -r $@ $docdir 1.29 + chmod -R a+r $docdir 1.30 + status 1.31 +} 1.32 + 1.33 + 1.34 # Function to use in genpkg_rules() to copy specified files from $install to $fs 1.35 1.36 cook_copy_files() { 1.37 @@ -1987,9 +2001,9 @@ 1.38 clean_log 1.39 1.40 # Exit if any error in packing. 1.41 - lerror=$(_n 'ERROR') 1.42 - if grep -Ev "(/root/.cvspass|conftest|df: /|rm: can't remove)" $LOGS/$pkg.log | \ 1.43 - grep -Eq "(^$lerror|: No such file or directory|not remade because of errors|ake: \*\*\* .* Error)"; then 1.44 + if [ "${COOKOPTS/skip-log-errors/}" == "$COOKOPTS" ] && 1.45 + grep -Ev "(/root/.cvspass|conftest|df: /|rm: can't remove)" $LOGS/$pkg.log | \ 1.46 + grep -Eq "(^ERROR|: No such file or directory|not remade because of errors|ake: \*\*\* .* Error)"; then 1.47 debug_info | tee -a $LOGS/$pkg.log 1.48 sed -i '$ s|$| [ Failed ]|' $activity 1.49 rm -f $command
2.1 --- a/doc/cookopts.txt Tue Aug 29 17:24:54 2017 +0300 2.2 +++ b/doc/cookopts.txt Thu Aug 31 03:14:01 2017 +0300 2.3 @@ -145,3 +145,12 @@ 2.4 the translation (when string in msgid equals to string in msgstr). 2.5 The presence of this option overrides the default action (all *.mo files 2.6 will be left "as is"). 2.7 + 2.8 +skip-log-errors 2.9 + Default behaviour is to end work with error message when certain words occur 2.10 + in the log: "ERROR" or "undefined reference to". In some cases it may 2.11 + produce false positives when no error produced during cooking, but these 2.12 + words occur. For example, next line: 2.13 + g_simple_async_result_set_error (simple, G_IO_ERROR, G_IO_ERROR_FAILED 2.14 + The presence of this option overrides the default behaviour (word "ERROR" in 2.15 + the log will not produce error, etc.)