centos - comparing multiple decimal numbers (versions) - centos

So I'm trying to think of a way to do the following
I have the following sample data.
"0.86-6.el6" vs "0.86-6.el6_4" > VALUE1 is less than value2"
"2.6.32-754.9.1.el6" vs 2.6.32-754.15.3.el6 > VALUE1 is less than value2"
These are centos package version. So i'm trying to figure out how the packages itself can be compared. Basically find out if the package installed is greater than the package available in the repo?
thanks

$ rpmdev-vercmp 0.86-6.el6 0.86-6.el6_4
0.86-6.el6 < 0.86-6.el6_4

Related

Yoctoproject - include newer coreutils (stat)

I am trying to build a custom distribution for an embedded device. I need the 'stat'-command (which is part of GNU coreutils) to support long-options, e.g. stat --printf.
The stat-version the build currently includes is ancient and does not support long-options.
root#target:/# stat -v
stat version 3.0
The receipe for stat is located at sources/poky/meta/recipes-extended/stat_3.3.bb which points to http://www.ibiblio.org/pub/Linux/utils/file/stat-3.3.tar.gz as its SRC_URI.
The coreutils receipe is located at sources/poky/meta/recipes-core/coreutils/coreutils_8.27.bb which points to https://ftp.gnu.org/gnu/coreutils/coreutils-8.27.tar.xz as its SRC_URI.
How I understand it, bitbake uses ALTERNATIVE_PRIORITY[stat] which is defined in both recipes to decide which version is to be included. Since the coreutils_8.27 should be new enough, I tried to simply delete the stat_3.3-receipe. This didn't work, the old 3.3 version of stat is still included.
What would be the best way to include a newer version or coreutils (or stat) which supports long-options?
To fix this I had to include the 'coreutils'-package (IMAGE_INSTALL_append += " coreutils") in my local.conf and raise the ALTERNATIVE_PRIORITY for the coreutils-package.

SchemaCrawler 16.12 version command line not creating my htmlx output

I am using the latest version of schemacrawler (16.1.2) to generate SVG diagrams embedded in HTML output. However it is not creating the diagrams but only printing the table information in text form. If I use an older version of schemacrawler, it works fine. I have Graphviz installed on my machine. What am I doing wrong that is not outputting the diagram?
For Version 16.1.2 this version of the command line I use is not working
source schemacrawler.sh --server=postgresql --host=hostname --database=db_name --user=username --password=password_name --info-level=standard --schemas=schema_name --command=schema --outputformat=htmlx --log-level=CONFIG > schemaGraph.html
For Version 14.17, this version of the command works fine for me
source schemacrawler.sh -server=postgresql -host=hostname -database=db_name -user=username -password=password_name -infolevel=minimum -command=schema -outputformat=htmlx -loglevel=CONFIG > schemaGraph.html
Please try --output-format and see if it works.

Porting Newlib with current autotools

I'm trying to build a toolchain for my hobby kernel, but I'm running into problems when building Newlib. Whenever I try to run autoreconf in my kernels directory under newlib/libc/sys/ I get an error:
configure.in:5: error: support for Cygnus-style trees has been removed
Here is the content of configure.in (basically, taken from the below tutorial):
AC_PREREQ(2.59)
AC_INIT([newlib], [NEWLIB_VERSION])
AC_CONFIG_SRCDIR([crt0.S])
AC_CONFIG_AUX_DIR(../../../..)
NEWLIB_CONFIGURE(../../..)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
and the source for Makefile.am (again mostly from tutorial):
AUTOMAKE_OPTIONS = cygnus
INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
AM_CCASFLAGS = $(INCLUDES)
noinst_LIBRARIES = lib.a
if MAY_SUPPLY_SYSCALLS
extra_objs = $(lpfx)syscalls.o
else
extra_objs =
endif
lib_a_SOURCES =
lib_a_LIBADD = $(extra_objs)
EXTRA_lib_a_SOURCES = syscalls.c crt0.S
lib_a_DEPENDENCIES = $(extra_objs)
lib_a_CCASFLAGS = $(AM_CCASFLAGS)
lib_a_CFLAGS = $(AM_CFLAGS)
if MAY_SUPPLY_SYSCALLS
all: crt0.o
endif
ACLOCAL_AMFLAGS = -I ../../..
CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
Yes, I have tried removing the AUTOMAKE_OPTIONS=cygnus.
I've Googled around and been trying to understand this, and as far as I can tell, it is because of the version of autotools I'm using. According to the tutorial I used originally (OSDev - OS Specific Toolchain), I need an older version. My problem is that I'm using Kubuntu, which uses the apt package manager, and that version is not available to fall back to even temporarily. There has to be some fix for this. Either Newlib is outdated (this release is from December of 2013...) or the developers are crazy for depending on an outdated autotools version.
The only other thing I can think is that this is a message from the newlib configuration scheme itself in which case I have no idea how to modify my configure.in and Makefile.am to align with the new newlib configure format. That tutorial is the only one I've found that didn't use libgloss (which I'd prefer not to do) so far and the documentation of adding a new target is rather lacking in the documentation for newlib (or I missed something).
Here is some version information:
System: Kubuntu 14.04
Automake: 1.14.1
Autoconf: 2.69
Newlib: 2.1.0
Unfortunately I'm afraid using automake 1.12 or earlier is your only choice. Ubuntu has an Automake1.11 separate package to help you there, if I'm not mistaken, since the compatibility between 1.12 and 1.14 is generally good, but before that it was spotty.
I am writing this answer for people struggling with the tutorial described here.
I am in the same situation you are (or were), I am building a kernel from scratch and I wanted to port newlib to my toolchain. Unfortunately I think the tutorial has become out of date because I followed the instructions EXACTLY, even installing the correct software with the proper versions (including the correct newlib version). The accepted solution above didn't work for me but I found another solution that might work for others:
Step 1 - get the correct software
Acquire Automake (v1.12) and Autoconf (v2.65) from here:
http://ftp.gnu.org/gnu/automake/automake-1.12.tar.gz
http://ftp.gnu.org/gnu/autoconf/autoconf-2.65.tar.gz
Step 2 - build process
Untar both of the archives:
tar xf automake-1.12.tar.gz
tar xf autoconf-2.65.tar.gz
Create a destination folder:
mkdir ~/bin
Create a build folder:
mkdir build
cd build
Configure automake first:
../automake-1.12/configure --prefix="~/bin"
Make and install
make && make install
Now lets configure autoconf
../autoconf-2.65/configure --prefix=~/bin
Then make and install:
make && make install
You should now have the proper binaries in ~/bin!
Step 3 - update PATH
To add these binaries to your path temporarily (recommended):
export PATH=~/bin:$PATH
Once you update your path, rerun autoconf and autoreconf and it should complete.

Building a perl extension module on OpenBSD

How ought I build an XS perl module on OpenBSD when the requisite .so files are missing?
Background: On a vanilla OpenBSD 5.3 vm install, I'm unable to build a perl module which needs to link against -lpthread. pthread.a and pthread.so.Maj.Min do exist on the system.
However Makefile.PL is looking for pthread.so, which is absent. Is this ordinary for OpenBSD? (I can coerce the Makefile to link against pthread.a and things work just fine, as it happens.)
In a Redhat-ish Linux environment, I'd just install the right -devel RPM and go again. On OpenBSD, however, I'm missing something very basic about the development environment.
UPDATE The core problem was Dynaloader mis-detection of libraries inside Makefile.PL.
The Makefile is wrong, report the bug to the upstream. It never should look for a specific file. Look this example:
$ cat test.c
int main(){
return 0;
}
$ gcc -lpthread -o test test.c
$ ldd test
test:
Start End Type Open Ref GrpRef Name
00000c4321600000 00000c4321a02000 exe 1 0 0 test
00000c4521f63000 00000c4522374000 rlib 0 2 0 /usr/lib/libpthread.so.17.1
00000c4524c1c000 00000c4525103000 rlib 0 1 0 /usr/lib/libc.so.68.2
00000c452a100000 00000c452a100000 rtld 0 1 0 /usr/libexec/ld.so
Also, in OpenBSD you don't need install a -devel package. OpenBSD has the batteries included.
While editing your Makefile.PL is one way to go, I generally see folks use link files to point generic library/executable names to version specific names.
For Example:
pthread.so -> pthread.so.maj.min
pthread.so.maj -> pthread.so.maj.min
This way things that want the 'latest' version can get it via the link & thinks that just care about major version can grab the most recent release of it's major version...

How do I get boost-bjam to properly id my libraries when they build?

On Debian/squeeze in /usr/lib I have:
/usr/lib/libboost_python-py25.so /usr/lib/libboost_python-py26.so
I'm trying to build
/usr/lib/libboost_python-py27.so
to go with a pythonbrewed version of python 2.7 by specifying --buildID=py27. But bjam keeps generating only
libboost_python.so.1.42.0
and then a link to
libboost_python.so
How do I get bjam and the Jamroot of boost to give me an appropriately named .so? I'm guessing the package maintainers managed to do it......
The command lines I have tried are:
bjam --layout=tagged --buildID=py27 --with-python
bjam --buildID=py27 --with-python
At least with the latest Boost version you should be able to do:
b2 --python-buildid=py27 --with-python
But if you must use 1.42 the syntax would be:
bjam --buildid=py27 --with-python
In other words.. The options are in lower case and are case sensitive.