Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 524456

Summary: sys-apps/baselayout-java - /etc/profile.d/java-config-2.sh: user_id is not set
Product: Gentoo Linux Reporter: Fabian Henze <flyser42>
Component: [OLD] JavaAssignee: Java team <java>
Status: UNCONFIRMED ---    
Severity: normal CC: martin
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Fix this and other set -u issues

Description Fabian Henze 2014-10-04 13:32:08 UTC
/etc/profile.d/java-config-2.sh fails to handle the case when $UID is already set.
Adding an else branch to the first if clause with
  user_id="${UID}"
fixes the problem.



Reproducible: Always
Comment 1 Martin Väth 2015-07-24 09:00:35 UTC
Created attachment 407502 [details, diff]
Fix this and other set -u issues

This problem is not only cosmetical if the profile is sourced with set -u: Then it gives an error and stops further sourcing.

The attached patch fixes this and some other issues with set -u

(Note that working with set -u makes sense, since it is the only available form of a "strict" syntax checking in shell code.)

The attached patch also fixes some (more theoretical) quoting problems and does not append ":" to MANPATH is MANPATH was previously empty or unset.