Bug 156146 - app-portage/euses-2.5.2: only prints "Do you Gentoo?" - problems in getportdir
Bug#: 156146 Product:  Gentoo Linux Version: 2006.1 Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: jer@gentoo.org Reported By: Martin.vGagern@gmx.net
Component: Applications
URL: 
Summary: app-portage/euses-2.5.2: only prints "Do you Gentoo?" - problems in getportdir
Keywords:  
Status Whiteboard: 
Opened: 2006-11-24 10:16 0000
Description:   Opened: 2006-11-24 10:16 0000
Whenever I try to use euses to find information about some USE flag, I only get
a single line saying "Do you Gentoo?".

A little ltrace reveals that euses checks PORTDIR and continues with "(null)"
as value for PORTDIR. Looking at the source, the result from getenv is
unconditionally passed to snprintf, and later on only its lengh is checked to
be nonzero. So a nonexistant environment variable becoms a NULL pointer
returned from getenv becomes the string "(null)" becomes euses idea of a valid
PORTDIR.

------- Comment #1 From Martin von Gagern 2006-11-24 10:48:35 0000 -------
Created an attachment (id=102671) [details]
euses-2.5.2-getportdir.patch

This at least lets getportdir check if the environment variable is set. If so,
use it, if not, check make.globales and make.conf.

------- Comment #2 From Jeroen Roovers 2006-11-24 14:19:29 0000 -------
Sorry, I thought I had already fixed that. Seems I didn't publish the fixed
version yet. 2.5.3 is in the tree with a fix similar to your patch. Thank you
very much for the bug report.

------- Comment #3 From Jeroen Roovers 2006-11-24 14:20:01 0000 -------
Forgot an option.