]> git.nbdom.net Git - nb.git/commitdiff
bin/dbq-dir2sqlite
authorNicolas Boisselier <nicolas.boisselier@semantico.com>
Fri, 2 Sep 2016 09:45:58 +0000 (10:45 +0100)
committerNicolas Boisselier <nicolas.boisselier@semantico.com>
Fri, 2 Sep 2016 09:45:58 +0000 (10:45 +0100)
bin/dbq
bin/dbq-dir2sqlite
lib/php/config.php

diff --git a/bin/dbq b/bin/dbq
index cd1e71872f442e7221e705c8dceb03e50ce2264d..402fb84c35bad13685806c80c30990d3906bce07 100755 (executable)
--- a/bin/dbq
+++ b/bin/dbq
@@ -218,9 +218,10 @@ if (-e $url) {
 #################################################################################
 
 warn "$NAME: Command: ",join(" ",map{/\s+/ ? '"'.$_.'"' : $_} @cmd),"\n" if $VERBOSE;
-system @cmd;
+$_ = system(@cmd);
+my $ex = ($? == 0 and $_ == 0) ? 0 : 1;
 close STDOUT;
-exit 0;
+exit $ex;
 
 #################################################################################
 #
index 275d95de9f19bc5c439b27a062e660cbc14a7ec1..198b24efecd5afb24039693df69bbf5b7b32f4d7 100755 (executable)
@@ -121,9 +121,9 @@ for vars in $(dbq a=ls type='!sqlite' out=sh); do
        [ -w "${id}.db" ] || continue
        [ "$VERBOSE" -gt 0 ] && printf '%s : ' "$id"
 
-       dbq f=text a=db.dump db.type=sqlite db="$id" 2>/dev/null > "$TMP_DB" || continue
+       dbq f=text a=db.dump db.type=sqlite db="$id" > "$TMP_DB" 2>/dev/null
   ret=$?
-       if [ ! -s "$TMP_DB" -o "$ret" != "0" ];then
+       if [ "$ret" != "0" -o ! -s "$TMP_DB" ];then
          [ "$VERBOSE" -gt 0 ] && echo "failed"
     continue
   fi
index c76926a2db5ab339879742b2f820dc0de2f59adc..324f5ee9a3bf74bf2005338a12182230e19efda1 100644 (file)
@@ -14,7 +14,7 @@ if (nb::php_cli()) argv2request();
 if (!empty($_SERVER['PROD'])) return;
 
 error_reporting(E_ALL | E_STRICT | E_NOTICE);
-ini_set('display_errors', 1);
+if (!nb::php_cli()) ini_set('display_errors', 1);
 if (nb::php_cli() or nb::p('txt_errors')) ini_set('html_errors', false);
 
 // Should be done in php.ini for performance