From: Nicolas Boisselier Date: Fri, 1 Jul 2016 08:41:41 +0000 (+0100) Subject: bytes2h X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=722f1a1f288f4b589c2e894ed8936a9e6d2fc51a;p=nb.git bytes2h --- diff --git a/etc/dbs/ui.php b/etc/dbs/ui.php index 8da2799f..d7a32161 100644 --- a/etc/dbs/ui.php +++ b/etc/dbs/ui.php @@ -170,7 +170,7 @@ $CONF['ui-mysql'] = array( 'type' => 'mysql', 'name' => 'ui', 'pdo' => '', - '_import' => array('_ui'), + '_import' => array('_ui','_semadm'), ); #bye(realpath(dirname(__FILE__).'/../../lib/php/db.php')); #require_once(realpath(dirname(__FILE__).'/../../lib/php/db/types/sqlite.php')); diff --git a/etc/profile.d/functions b/etc/profile.d/functions index 35311c02..ccf8a71a 100644 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -144,14 +144,14 @@ bytes2h() { [ -z "$@" ] || in="echo $@" $in | perl -pe 'BEGIN{ - use NB::Functions qw/&oct2h/; + use NB::Functions qw/&bytes2h/; $exp = "([\\d\\.]+)"; if (@ARGV and $ARGV[0] =~ /regex=(\S+)/) { shift @ARGV; $exp = $1; } }; -s/$exp/oct2h($1*1024)/ge; +s/$exp/bytes2h($1)/ge; ' $args } diff --git a/lib/perl/NB/Functions.pm b/lib/perl/NB/Functions.pm index 24e33792..e89eda02 100644 --- a/lib/perl/NB/Functions.pm +++ b/lib/perl/NB/Functions.pm @@ -167,7 +167,7 @@ our %CHAR_ENTITIES = ( &epoch2date &price_from_to &sec2h - &oct2h + &bytes2h &mysql_exec &table_get_no_primaries &table_get_primaries @@ -274,7 +274,7 @@ sub sec2h { } -sub oct2h { +sub bytes2h { my $o = shift @_;