How to update OpenGrok indices - opengrok

The OpenGrok wrapper script has an update option, but when I run it without any options (as echoed in the usage), I get
Loading the default instance configuration ...
FATAL ERROR: OpenGrok Source Path /var/opengrok/src doesn't exist - Aborting!
I have also tried specifying the SRC_ROOT, but continue to get the same error.

This might not be the right answer, but I have been able to update by re-running the index job itself. It doesn't take as long as the initial indexing.

from https://github.com/OpenGrok/OpenGrok
E.g. if opengrok data directory is /tank/opengrok and source root is
in /tank/source then to get more verbosity run the indexer as:
$ OPENGROK_VERBOSE=true OPENGROK_INSTANCE_BASE=/tank/opengrok \
./OpenGrok index /tank/source

SRC_ROOT is a variable in the OpenGrok wrapper (normally in /usr/opengrok/bin/OpenGrok), this variable is to say OpenGrok where you have your src code to be indexed. So you need to edit it:
SRC_ROOT="your/src/path"
Also, after that maybe you'll se an error for the Data location... and you have to set also the variable DATA_ROOT (index location)
DATA_ROOT="you/data"

Related

Working with defaults-group-suffix in MariaDB/MySQL if it's empty

According to the documentation it's possible to add the parameter --defaults-group-suffix to a mysql command, for it to "In addition to the default option groups, also read option groups with the given suffix".
So in case I use:
--defaults-group-suffix=.sample
A mariadb-Server started with this option will read both, the following blocks:
[mariadbd]
…
[mariadbd.sample]
…
So I can put options which should apply to the specific instance to the second block.
My question is: Is there a way to add an option group, which is only evaluated, when the parameter --defaults-group-suffix is not provided, in other words empty?
The default block [mariadbd] obviously can't be used, since it is read by all instances with a defined suffix.
Additional question, since I can't find it in the documentation: If one option is specified multiple times in one (or more) configuration files: Is it the first, or the last match, that applies?
According to the stackoverflow guidelines, next time please only ask one question per posting.
1st question: No, it is not possible - the suffix option is an additional option, there are no conditions which check suffix and other options.
2nd question: If multiple configuration files with same options but different values are used, the option/value from last read configuration file will be used. Check the read order of configuration files by executing
mysqld --help --verbose | grep -C1 "Default options"
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf

Cannot connect to MySQL with Weka

I am trying to connect a database to Weka 3.6.13 in Linux Elementary OS.
First, I had a problem with JDBC connection, solved by this answer changing the /usr/bin/weka file.
Now, when I load the database, this error comes:
Unknown data type: INT. Add entry in weka/experiment/DatabaseUtils.props.
However, I am trying to use explorer only, this file doesn't even exists in my installation.
I installed via sudo apt install weka.
What should I do?
Look inside the directory where your weka.jar file resides, and check if there exists a file called DatabaseUtils.props.
The Weka wiki says:
Weka only looks for the DatabaseUtils.props file. If you take one of
the example files listed above, you need to rename it first.
My file is different I think the actual name does not really matter, it's the filename extension that matters.
In my version of this file there is a section that looks like this:
... (snip...
# mysql-conversion / type-mappings
CHAR=0
TEXT=0
VARCHAR=0
STRING=0
LONGVARCHAR=9
BINARY=0
VARBINARY=0
LONGVARBINARY=9
BIT=1
BOOL=1
NUMERIC=2
DECIMAL=2
FLOAT=2
DOUBLE=2
TINYINT=3
SMALLINT=4
#SHORT=4
SHORT=5
INTEGER=5
INT=5
BIGINT=6
LONG=6
REAL=7
DATE=8
TIME=10
TIMESTAMP=11
#mappings for table creation
CREATE_STRING=TEXT
CREATE_INT=INT
CREATE_DOUBLE=DOUBLE
CREATE_DATE=DATETIME
DateFormat=yyyy-MM-dd HH:mm:ss
#database flags
checkUpperCaseNames=false
checkLowerCaseNames=false
checkForTable=true
setAutoCommit=true
createIndex=false
# All the reserved keywords for this database
Keywords=\
AND,\
ASC,\
BY,\
DESC,\
FROM,\
GROUP,\
INSERT,\
ORDER,\
SELECT,\
UPDATE,\
WHERE
# The character to append to attribute names to avoid exceptions due to
# clashes between keywords and attribute names
KeywordsMaskChar=_
#flags for loading and saving instances using DatabaseLoader/Saver
nominalToStringLimit=50
idColumn=auto_generated_id
If you do a google search for this file, another guy has posted his on github. The weka Wiki or SVN/Git-Repo might also list an offfical version somewhere (cannot find it right now), or you can open your weka.jar file as a zip file and extract the .props file (/src/main/java/weka/experiment/DatabaseUtils.props.mysql).
In any case, Mysql exists in many different versions, and I think you can even switch the query engine inside mysql. So I cannot express any guarantees that any of these 2 .props files shown here really work for you. You should experiment a bit.

Cmake compiler "not found" warnings, cause for concern? (MySQL)

Can I safely ignore these cmake compiler warnings?
I'm learning to compile packages from source and practicing on MySQL.
Should I be searching for and installing dev libraries when I see "notices" like this (referencing specific "not found" files):
$ cmake . -LA
...
-- Looking for include file cxxabi.h
-- Looking for include file cxxabi.h - not found.
-- Looking for include file dirent.h
-- Looking for include file dirent.h - found
-- Looking for include file dlfcn.h
-- Looking for include file dlfcn.h - found
And what should I do about notices referencing these "not found" messages:
-- Looking for bmove
-- Looking for bmove - not found
-- Looking for bsearch
-- Looking for bsearch - found
-- Looking for index
-- Looking for index - found
For example, cxxabi.h can be found in libstdc++6-4.7-dev on Debian. Do I need to install libstdc++6-4.7-dev to have a proper compile of MySQL?
I also have some (constant?) warnings that I'm unsure of:
-- Performing Test TIME_T_UNSIGNED
-- Performing Test TIME_T_UNSIGNED - Failed
-- Performing Test HAVE_GETADDRINFO
-- Performing Test HAVE_GETADDRINFO - Success
Overall, my build seems to work good, but I want to be sure.
If CMake configuration process doesn't fail, it means these headers are optional and there are workarounds in the MySQL code for these cases.
It might be also, that when some headers aren't present some features are silently turned off. It make sense to provide MySQL as many optional headers as you can.
Beware that some headers are OS-specific, so you can't and don't have to provide them.

mysql - set ~/.my.cnf location?

Is it possible to specify which .my.cnf file mysql client should use? I have 2 mysql instances running on different ports and want to only need to specify a filename with credentials.
As documented under Command-Line Options that Affect Option-File Handling:
When specifying file names, you should avoid the use of the “~” shell metacharacter because it might not be interpreted as you expect.
--defaults-extra-file=file_name
Read this option file after the global option file but (on Unix) before the user option file. If the file does not exist or is otherwise inaccessible, the program exits with an error. file_name is interpreted relative to the current directory if given as a relative path name rather than a full path name.
--defaults-file=file_name
Use only the given option file. If the file does not exist or is otherwise inaccessible, the program exits with an error. file_name is interpreted relative to the current directory if given as a relative path name rather than a full path name.
--defaults-group-suffix=str
If this option is given, the program reads not only its usual option groups, but also groups with the usual names and a suffix of str. For example, the mysql client normally reads the [client] and [mysql] groups. If the --defaults-group-suffix=_other option is given, mysql also reads the [client_other] and [mysql_other] groups.
Note that "to work properly, each of these options must be given before other options".

dpkg-shlibdeps: error: no dependency information found for

I'm compiling a deb package and when I run dpkg-buildpackage I get:
dpkg-shlibdeps: error: no dependency information found for /usr/local/lib/libopencv_highgui.so.2.3
...
make: *** [binary-arch] Error 2
This happens because I installed the dependency manually. I know that the problem will be fixed if I install the dependency (or use checkinstall), and I want to generate the package anyway because I'm not interested on dependency checking. I know that I can give to dpkg-shlibdeps the option --ignore-missing-info which prevents a fail if dependency information can't be found. But I don't know how to pass this option to dpkg-shlibdeps since I'm using dpkg-buildpackage and dpkg-buildpackage calls dpkg-shlibdeps...
I have already tried:
sudo dpkg-buildpackage -rfakeroot -d -B
And with:
export DEB_DH_MAKESHLIBS_ARG=--ignore-missing-info
as root.
Any ideas?
use:
override_dh_shlibdeps:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
if your rule file hasn't the dh_shlibdeps call in it. That's usually the case if you've
%:
dh $#
as only rule in it ... in above you must use a tab and not spaces in front of the dh_shlibdeps
If you want it to just ignore that flag, change the debian/rules line from:
dh_shlibdeps
to:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
Yet another way, without modifying build scripts, just creating one file.
You can specify local shlib overrides by creating debian/shlibs.local with the following format: library-name soname-version dependencies
For example, given the following (trimmed) ldd /path/to/binary output
libevent-2.0.so.5 => /usr/lib/libevent-2.0.so.5 (0x00007fc9e47aa000)
libgcrypt.so.20 => /usr/lib/libgcrypt.so.20 (0x00007fc9e4161000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007fc9e3b1a000)
The contents of debian/shlibs.local would be:
libevent-2.0 5 libevent-2.0
libgcrypt 20 libgcrypt
libpthread 0 libpthread
The "dependencies" list (third column) doesn't need to be 100% accurate - I just use the library name itself again.
Of course this isn't needed in a sane debian system which has this stuff defined in /var/lib/dpkg/info (which can be used as inspiration for these overrides). Mine isn't a sane debian system.
Instead of merely ignoring the error, you might also want to fix the source of the error, which is usually either a missing or an incorrect package.shlibs or package.symbols file in package which contains the shared library triggering the error.
[1] documents how dpkg-shlibdeps uses the package.shlibs resp. package.symbols, files, [2] documents the format of the package.shlibs and package.symbols files.
[1] https://manpages.debian.org/jessie/dpkg-dev/dpkg-shlibdeps.1.en.html
[2] https://www.debian.org/doc/debian-policy/ch-sharedlibs.html
You've just misspelled your export. It should be like this:
export DEB_DH_SHLIBDEPS_ARGS_ALL=--dpkg-shlibdeps-params=--ignore-missing-info
dpkg-buildpackage uses make to process debian/rules. in this process, dpkg-buildpackage it might call dpkg-shlibdeps.
thus, the proper way to pass modify a part of the package building process is to edit debian/rules.
it's hard to give you any more hints, without seeing the actual debian/rules.
Finally I did it in the brute way:
I edited the script /usr/bin/dpkg-shlibdeps, changing this :
my $ignore_missing_info = 0;
to
my $ignore_missing_info = 1;
You can use this:
dh_makeshlibs -a -n
exactly after dh_install