Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 56263 - Change Uname Call in Emerge Info to Support *BSD
Summary: Change Uname Call in Emerge Info to Support *BSD
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
: 56600 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-07-06 11:26 UTC by Daniel Hurt
Modified: 2004-08-16 11:08 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Hurt 2004-07-06 11:26:57 UTC
The call to /bin/uname is not supported on some of the *BSDs.  I wrote a patch that instead uses the platform.uname call in python that is more compatible across platform removing the errors that occur when emerge info is called.

Reproducible: Always
Steps to Reproduce:
1. Install *BSD according the the gentoo/BSD docs ;-)
2. # emerge info

Actual Results:  
Portage 2.0.49 (unavailable, gcc-3.3.3, glibc-2.3.2-r0, 5.2.1-RELEASE)
=================================================================
System uname: /bin/uname: not found
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -pipe"
CHOST="i386-unknown-freebsd"
COMPILER="gcc"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config
/usr/kde/2/share/config /usr/kde/3/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="-sandbox -sandbox buildpkg noauto ccache"
GENTOO_MIRRORS=" http://gentoo.mirrors.pair.com/
http://cudlug.cudenver.edu/gentoo/ http://mirrors.tds.net/gentoo/
ftp://mirrors.tds.net/gentoo http://gentoo.mirrors.pair.com/
ftp://gentoo.mirrors.pair.com/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://xenophobia/gentoo-portage"
USE="bsd"

Expected Results:  
Portage 2.0.49 (unavailable, gcc-3.3.3, glibc-2.3.2-r0, 5.2.1-RELEASE)
=================================================================
System uname: 5.2.1-RELEASE i386 i386
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -pipe"
CHOST="i386-unknown-freebsd"
COMPILER="gcc"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config
/usr/kde/2/share/config /usr/kde/3/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="-sandbox -sandbox buildpkg noauto ccache"
GENTOO_MIRRORS=" http://gentoo.mirrors.pair.com/
http://cudlug.cudenver.edu/gentoo/ http://mirrors.tds.net/gentoo/
ftp://mirrors.tds.net/gentoo http://gentoo.mirrors.pair.com/
ftp://gentoo.mirrors.pair.com/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://xenophobia/gentoo-portage"
USE="bsd"


Since Emerge Info is Pasted in the above, I will paste the patch here:

For Portage 2.0.50-r8 (default-x86-2004.0, gcc-3.4.1, glibc-2.3.4.20040605-r1,
2.6.7-gentoo-r8):

--- /usr/lib/portage/bin/emerge 2004-06-28 14:29:07.000000000 -0700
+++ emerge      2004-07-06 11:03:38.694278352 -0700
@@ -3,7 +3,7 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Header: /home/cvsroot/gentoo-src/portage/bin/emerge,v 1.264 2004/02/08
21:24:15 nakano Exp $
 
-import os,sys
+import os,sys,platform
 os.environ["PORTAGE_CALLER"]="emerge"
 sys.path = ["/usr/lib/portage/pym"]+sys.path
 
@@ -2281,7 +2281,7 @@
        print
 # INFO action
 elif "info"==myaction:
-       unameout=commands.getstatusoutput("/bin/uname -mrp")[1]
+       unameout=platform.uname()[2]+" "+platform.uname()[4]+" "+platform.uname()[5]
        print getportageversion()
        print "================================================================="
        print "System uname: "+unameout


For BSD Portage 2.0.49 (unavailable, gcc-3.3.3, glibc-2.3.2-r0, 5.2.1-RELEASE):

--- /usr/lib/portage/bin/emerge 2004-07-06 11:22:32 -0700
+++ emerge      2004-07-06 11:23:25 -0700
@@ -3,7 +3,7 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Header: /home/cvsroot/gentoo-src/portage/bin/emerge,v 1.224 2003/08/21
01:01:26 carpaski Exp $
 
-import os
+import os,platform
 os.environ["PORTAGE_CALLER"]="emerge"
 
 import sys,emergehelp,xpak,string,re,commands,time,shutil,traceback,atexit,signal
@@ -1806,7 +1806,7 @@
        print
 # INFO action
 elif "info"==myaction:
-       unameout=commands.getstatusoutput("/bin/uname -mrp")[1]
+       unameout=platform.uname()[2]+" "+platform.uname()[4]+" "+platform.uname()[5]
        print getportageversion()
        print "================================================================="
        print "System uname: "+unameout
Comment 1 Daniel Hurt 2004-07-06 11:30:59 UTC
Just a note, this fix produces the exact same output for emerge info on normal gentoo/linux machines.  I have tested on three of my machines here.
Comment 2 Marius Mauch (RETIRED) gentoo-dev 2004-07-10 08:47:29 UTC
*** Bug 56600 has been marked as a duplicate of this bug. ***
Comment 3 Brian Harring (RETIRED) gentoo-dev 2004-08-16 11:08:31 UTC
Made the emerge changes, same for repoman.