[SUGGESTION] Get accurate version and location of library

interfasys

Verified User
Joined
Oct 31, 2003
Messages
1,824
Location
Switzerland
doPhp() contains this block
Code:
	if [ ! -e /usr/local/lib/libxslt.so ]; then
		if [ ! -e /usr/lib/libxslt.so ]; then
			doLibxslt;
		fi
	fi
which will trigger the re-installation of unnecessary libraries on FreeBSD for people who get their libraries from ports.

A simple ls command should be enough to get the location in most cases, starting with local libs or on FreeBSD, you could try something like this
Code:
# ldconfig -r | grep libxslt.so.2 | awk '{print $3}' | cut -d/ -f3

As for the version, CB has this
Code:
stat /usr/local/lib/libxslt.so | head -n1 | awk '{print $4}' | cut -d. -f 3,4,5 | cut -d\' -f1
which doesn't return a version number on FreeBSD.
Maybe readelf should be used?

EDIT: On FreeBSD, stat works differently and you could use this to get the version number. But you only the major version most of the time.
Code:
# stat -l /usr/local/lib/libxslt.so | awk '{print $12}' | cut -d. -f3,4,5
2
# stat -l /usr/local/lib/libvpx.so | awk '{print $12}' | cut -d. -f3,4,5
1.3.0
 
Last edited:
Hello,

Thanks for the suggestions.
The versions reported by CustomBuild are only for those libraries that it installs.

However, in regards to preventing the recompile of a library that you don't need, would an options.conf setting like this work for you?
Code:
xml2=yes
xslt=yes
so they can just be shut off completely, if CB is not going to control them anyway.

The other option is to create links to your libraries, from where DA is looking, eg:
Code:
ln -s /path/to/your/libxslt.so /usr/local/lib/libxslt.so
OR anther option is to send us the path where the ports version lives, and we can simply add it into the list to be checked.

John
 
...anther option is to send us the path where the ports version lives, and we can simply add it into the list to be checked.

John
Hello John,

I was thinking the same thing last night...If you can't get accurate versioning on FreeBSD because of the way libs are named or because they're installed via ports, you could use the ports management app to get version numbers this way:
Code:
# pkg info libxslt | head -n1 | cut -d\- -f 2 | cut -d\_ -f 1
1.1.28
and could even have a global switch in options.conf
Code:
libs_from_ports=1
which would turn off library management from within CB.

The key thing is that the script still needs to make sure those libs are installed.
 
Last edited:
Please test it now after "./build update" :) It should fix libxml2/libxslt versions and shouldn't compile libxslt on PHP installation time anymore.
 
Much better :)

There is still one bug
PCRE 8.34 to 8.20 update is available.

Since the installed version is higher than what is offered, CB should just ignore it unless there are known issues with using a higher build on the platform on which the script is run.
 
@interfasys, why don't you set new_pcre=yes in options.conf? Then it will show correct information about pcre version (but not until you run ./build update, pcre 8.35 is newest version, not 8.34).
 
@interfasys, why don't you set new_pcre=yes in options.conf? Then it will show correct information about pcre version (but not until you run ./build update, pcre 8.35 is newest version, not 8.34).
I think that if I do that, then CB will try to install it. Maybe ./build versions should simply ignore all apps and libs which are set to no.
 
Why wouldn't you like to use functionality mentioned in #28 of http://forum.directadmin.com/showthread.php?t=44743 ? That might solve your problems with versions :)
I gave it a go and I think to really work, CB should ignore libs/apps which are in this file and have no version, unless there is another ignore file I don't know about. This is simply to avoid having to run scripts to populate this file every time we update something on the server.

Suggestion
Using this
pcre:

would ignore pcre when running ./build versions
 
Last edited:
The following will do that in revision 918:
Code:
pcre:0:

Thank you for the request :)
 
Other parts of the script need to be updated to take this into consideration

Code:
Downloading             curl-0.tar.gz...
fetch: http://files6.directadmin.com/services/custombuild/curl-0.tar.gz: Not Found
Downloaded file /usr/local/directadmin/custombuild/curl-0.tar.gz does not exist or is empty after download
cwd is: /usr/local/directadmin/custombuild
Fileserver might be down, using the backup file server..
fetch: http://69.162.69.58/services/custombuild/curl-0.tar.gz: Not Found

*** MD5 Checksum for curl-0.tar.gz Failed.  Redownloading...***

Downloading             curl-0.tar.gz...
fetch: http://files6.directadmin.com/services/custombuild/curl-0.tar.gz: Not Found
Downloaded file /usr/local/directadmin/custombuild/curl-0.tar.gz does not exist or is empty after download
cwd is: /usr/local/directadmin/custombuild
Fileserver might be down, using the backup file server..
fetch: http://69.162.69.58/services/custombuild/curl-0.tar.gz: Not Found


*** MD5 Checksum for curl-0.tar.gz failed *again*.***
The md5 checksum value may be incorrect, or a wrong file is being downloaded.
Install continuing with this possibly corrupted file. (it may also be fine)


Downloading             pcre-0.tar.gz...
fetch: http://files6.directadmin.com/services/custombuild/pcre-0.tar.gz: Not Found
Downloaded file /usr/local/directadmin/custombuild/pcre-0.tar.gz does not exist or is empty after download
cwd is: /usr/local/directadmin/custombuild
Fileserver might be down, using the backup file server..
fetch: http://69.162.69.58/services/custombuild/pcre-0.tar.gz: Not Found

*** MD5 Checksum for pcre-0.tar.gz Failed.  Redownloading...***

Downloading             pcre-0.tar.gz...
fetch: http://files6.directadmin.com/services/custombuild/pcre-0.tar.gz: Not Found
Downloaded file /usr/local/directadmin/custombuild/pcre-0.tar.gz does not exist or is empty after download
cwd is: /usr/local/directadmin/custombuild
Fileserver might be down, using the backup file server..
fetch: http://69.162.69.58/services/custombuild/pcre-0.tar.gz: Not Found


*** MD5 Checksum for pcre-0.tar.gz failed *again*.***
The md5 checksum value may be incorrect, or a wrong file is being downloaded.
Install continuing with this possibly corrupted file. (it may also be fine)

etc.

Also, it seems libxml2:0: is ignored


And for a fresh FreeBSD server, a prepopulated file could be created
Code:
pcre:0:
freetype:0:
icu:0:
pigz:0:
iconv:0:
libxslt:0:
libxml2:0:
libmcrypt:0:
mhash:0:
curl:0:
icu4c:0:
 
Last edited:
Thank you for the report, fixed in rev 944, which should be uploaded to DA fileservers soon. As for:
Code:
libxml2:0:

It must be looking for libxml2-current, so please give the following a try:
Code:
libxml2-current:0:
 
Rev 944 is now on files1 :) Please give it a try and let us know the result. Thank you!
 
That was only webalizer ignored, and only in "./build update" :) Thank you for the report, the problem is already fixed.
 
Back
Top