Aaron Walker ha scritto:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Francesco Riosa wrote:


Mike Frysinger ha scritto:



On Tuesday 15 February 2005 03:14 pm, Francesco Riosa wrote:




Is safe / portable use the $(hostname) inside an ebuild ?


you should have a good reason for why you need it ... building a
package on a machine shouldnt build a package which is specific to
that machine ... afterall, a lot of people build on one but deploy on
another ...

now if you used said function in pkg_config(), that's a different
story ...
-mike




it's a different story ;)
I'm rewriting the  pkg_config() of the mysql ebuild to allow the user
insert a password,
and bypass some problem that happens with bitkeeper sources builds.
The hostname is needed to insert some users in the initial database.

http://www.francesco-riosa.com/gentoo/mysql-base.ebuild.html



Also keep in mind that Linux is not the only operating system Gentoo runs on nowadays. hostname on Linux is not the same as hostname on BSD (which by default prints the fully qualified hostname not the short hostname). I believe using 'hostname -s' should produce the same output on both operating systems.



   hostname="$(hostname -s)"
   if [[ -z "${hostname}" ]] ; then
       hostname=$(uname -n 2>/dev/null)
       if [[ -z "${hostname}" ]] ; then
           hostname="noname"
       fi
   fi

# thanks

--
[email protected] mailing list



Reply via email to