# HG changeset patch # User Aleksej Bobylev # Date 1504138441 -10800 # Node ID bdde5b0fe37039fef168dffcd1a5e1b6e910849b # Parent a73e67901f496c631bb13fbfab1c26b81bd75799 cook: add cook_pick_docs() and COOKOPTS="skip-log-errors"; update doc. diff -r a73e67901f49 -r bdde5b0fe370 cook --- a/cook Tue Aug 29 17:24:54 2017 +0300 +++ b/cook Thu Aug 31 03:14:01 2017 +0300 @@ -816,10 +816,12 @@ if [ ! -d "$WOK/$pkg/install" ] && [ -z "$WANTED" ]; then _ 'ERROR: cook failed' | tee -a $LOGS/$pkg.log fi + + [ "${COOKOPTS/skip-log-errors/}" != "$COOKOPTS" ] && return 0 + # ERROR can be echoed any time in cookit() - lerror=$(_n 'ERROR') if grep -Ev "(conftest|configtest)" $LOGS/$pkg.log | \ - grep -Eq "(^$lerror|undefined reference to)" ; then + grep -Eq "(^ERROR|undefined reference to)" ; then debug_info | tee -a $LOGS/$pkg.log sed -i '$ s|$| [ Failed ]|' $activity rm -f $command @@ -1324,6 +1326,18 @@ } +# Function to use in compile_rules() to copy documentation from $src to $install + +cook_pick_docs() { + local docdir="$install/usr/share/doc/$PACKAGE-$VERSION" + action 'Copying documentation...' + mkdir -p $docdir + cp -r $@ $docdir + chmod -R a+r $docdir + status +} + + # Function to use in genpkg_rules() to copy specified files from $install to $fs cook_copy_files() { @@ -1987,9 +2001,9 @@ clean_log # Exit if any error in packing. - lerror=$(_n 'ERROR') - if grep -Ev "(/root/.cvspass|conftest|df: /|rm: can't remove)" $LOGS/$pkg.log | \ - grep -Eq "(^$lerror|: No such file or directory|not remade because of errors|ake: \*\*\* .* Error)"; then + if [ "${COOKOPTS/skip-log-errors/}" == "$COOKOPTS" ] && + grep -Ev "(/root/.cvspass|conftest|df: /|rm: can't remove)" $LOGS/$pkg.log | \ + grep -Eq "(^ERROR|: No such file or directory|not remade because of errors|ake: \*\*\* .* Error)"; then debug_info | tee -a $LOGS/$pkg.log sed -i '$ s|$| [ Failed ]|' $activity rm -f $command diff -r a73e67901f49 -r bdde5b0fe370 doc/cookopts.txt --- a/doc/cookopts.txt Tue Aug 29 17:24:54 2017 +0300 +++ b/doc/cookopts.txt Thu Aug 31 03:14:01 2017 +0300 @@ -145,3 +145,12 @@ the translation (when string in msgid equals to string in msgstr). The presence of this option overrides the default action (all *.mo files will be left "as is"). + +skip-log-errors + Default behaviour is to end work with error message when certain words occur + in the log: "ERROR" or "undefined reference to". In some cases it may + produce false positives when no error produced during cooking, but these + words occur. For example, next line: + g_simple_async_result_set_error (simple, G_IO_ERROR, G_IO_ERROR_FAILED + The presence of this option overrides the default behaviour (word "ERROR" in + the log will not produce error, etc.)