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

Bug 486938

Summary: dev-perl/File-HomeDir-1.0.0 should (optionally?) depend on x11-misc/xdg-user-dirs
Product: Gentoo Linux Reporter: Kent Fredric (IRC: kent\n) (RETIRED) <kentnl>
Component: [OLD] DevelopmentAssignee: Gentoo Perl team <perl>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2013-10-04 06:31:10 UTC
I discovered after a bit of hacking, that File::HomeDir has very different behaviour in the presence of the script 'xdg-user-dir', provided by x11-misc/xdg-user-dirs

This makes a rather critical logic change, here: https://metacpan.org/source/ADAMK/File-HomeDir-1.00/lib/File/HomeDir.pm#L74 

And this basically means the presence of that one script radically changes from generic Unix filesystem layout semantics, to FreeDesktop file system semantics.

Under FreeDesktop style semantics, paths for various things consult XDG controlled variables, and respect XDG specific ENV flags: 

https://metacpan.org/source/ADAMK/File-HomeDir-1.00/lib/File/HomeDir/FreeDesktop.pm

Under Unix style semantics, $HOME and $LOGDIR are the ONLY ENV variables that have any impact: 

https://metacpan.org/source/ADAMK/File-HomeDir-1.00/lib/File/HomeDir/Unix.pm 

Given that people running Gentoo Linux are running a "FreeDesktop" platform, I consider it an error that File::HomeDir uses Unix instead of FreeDesktop semantics.

So, I suggest:

IUSE="+xdg"
RDEPEND="
    ...
    xdg? ( x11-misc/xdg-user-dirs )
"

and use.description = "Ensure XDG Semantics for returned paths via x11-misc/xdg-user-dirs"

Or something like that.

I'm tempted to suggest a block on that too if the user USE="-xdg", because there's otherwise going to be magical action happening if they don't want xdg semantics, because that package being installed will magically turn them on, despite the USE

Alternatively, the conditional could be patched to always fallback to Unix w/ USE="-xdg".
Comment 1 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2013-12-22 10:22:02 UTC
+*File-HomeDir-1.0.0-r1 (22 Dec 2013)
+
+  22 Dec 2013; Mikle Kolyada <zlogene@gentoo.org> +File-HomeDir-1.0.0-r1.ebuild,
+  metadata.xml:
+  Revision bump: EAPI=5; Implement new 'xdg' use flag wrt bug #486938. Thanks to
+  Kent Fredric for discovering this issue.
+