wrong value of XDG_DATA_DIRS

Asked by Italo Canepa on 2008-03-30

Hi
In a ubuntu 7.10 32bit or amd64 bit architecture I find this problem:
If I with synaptic install on my system Xubuntu and I digit:
icanepa@JtLaptop1:~$ echo $XDG_DATA_DIRS
I find:
etc/xdg/xubuntu:/usr/local/share/:/usr/share/:/usr/share/gdm/:/usr/share
icanepa@JtLaptop1:~$
instead of /etc/xdg/xubuntu:/usr/local/share/:/usr/share/:/usr/share/gdm/:/usr/share
(missing first slash)

This, for example, make impossible to install some program that use it, like NetBeans 6.1.
NetBeans fixed the problem in a new buid with a patch that put a slash if there insn't.

I try even in ubuntu 8.04 with a post installation of Xubuntu and I find the some problem with XDG_DATA_DIRS.

I'dont' know if I do something wrong or if it is a little problem of Xubuntu or XFCE.

Thanks
Italo Canepa

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu xfce4-utils Edit question
Assignee:
No assignee Edit question
Solved by:
Italo Canepa
Solved:
2008-03-31
Last query:
2008-03-31
Last reply:
2008-03-31
Italo Canepa (italoc) said : #1

If I start a normal Gnome session the problem is not present.

Peter Clifton (pcjc2) said : #2

On my gutsy box, the file: /etc/X11/Xsession.d/20desktop-profiles_activateDesktopProfiles has something to do with setting XDG_DATA_DIRS. Its a complicated script though, so I can't help much myself.

It might be a relevant piece of information though, when looking for somewhere to file a bug.. that file belongs to the package "desktop-profiles"

Peter Clifton (pcjc2) said : #3

Scratch that, its unlikely desktop-profiles is your problem.

For gnome, GDM sets the variable. What display manager do you use?

Peter Clifton (pcjc2) said : #4

Ok, if its XFCE4 in question, I think the bug is coming from xfce4-utils. That variable code is set by an Ubuntu patch:

diff -Nur xfce4-utils-4.4.1/scripts/startxfce4.in xfce4-utils-4.4.1.new/scripts/startxfce4.in
--- xfce4-utils-4.4.1/scripts/startxfce4.in 2007-04-02 07:34:54.000000000 +0200
+++ xfce4-utils-4.4.1.new/scripts/startxfce4.in 2007-10-04 23:16:56.000000000 +0200
@@ -28,9 +28,9 @@

 if test "x$XDG_DATA_DIRS" = "x"
 then
- XDG_DATA_DIRS="usr/local/share:/usr/share:/@datadir@"
+ XDG_DATA_DIRS="etc/xdg/xubuntu:usr/local/share:/usr/share"
 else
- XDG_DATA_DIRS="$XDG_DATA_DIRS:@datadir@"
+ XDG_DATA_DIRS="etc/xdg/xubuntu:$XDG_DATA_DIRS:@datadir@"
 fi
 export XDG_DATA_DIRS

Does the file:

/usr/bin/startxfce4 contain this statement? XDG_DATA_DIRS=.... ?

Take a backup copy, then try modifying it to include the "/" Does it work?

Italo Canepa (italoc) said : #5

Peter Clifton ha scritto:
> Your question #28448 on Launchpad itself changed:
> https://answers.edge.launchpad.net/launchpad/+question/28448
>
> Peter Clifton requested for more information:
> Ok, if its XFCE4 in question, I think the bug is coming from
> xfce4-utils. That variable code is set by an Ubuntu patch:
>
> diff -Nur xfce4-utils-4.4.1/scripts/startxfce4.in xfce4-utils-4.4.1.new/scripts/startxfce4.in
> --- xfce4-utils-4.4.1/scripts/startxfce4.in 2007-04-02 07:34:54.000000000 +0200
> +++ xfce4-utils-4.4.1.new/scripts/startxfce4.in 2007-10-04 23:16:56.000000000 +0200
> @@ -28,9 +28,9 @@
>
> if test "x$XDG_DATA_DIRS" = "x"
> then
> - XDG_DATA_DIRS="usr/local/share:/usr/share:/@datadir@"
> + XDG_DATA_DIRS="etc/xdg/xubuntu:usr/local/share:/usr/share"
> else
> - XDG_DATA_DIRS="$XDG_DATA_DIRS:@datadir@"
> + XDG_DATA_DIRS="etc/xdg/xubuntu:$XDG_DATA_DIRS:@datadir@"
> fi
> export XDG_DATA_DIRS
>
>
> Does the file:
>
> /usr/bin/startxfce4 contain this statement? XDG_DATA_DIRS=.... ?
>
> Take a backup copy, then try modifying it to include the "/" Does it
> work?
>
>
Hi
I modified the script, and now works right:

if test "x$XDG_DATA_DIRS" = "x"
then
  XDG_DATA_DIRS="/etc/xdg/xubuntu:usr/local/share:/usr/share"
else
  XDG_DATA_DIRS="/etc/xdg/xubuntu:$XDG_DATA_DIRS:/usr/share"
fi
export XDG_DATA_DIRS

thank you very much!
Italo Canepa

Italo Canepa (italoc) said : #6

I have now the correct path:
icanepa@JtLaptop1:~$ echo $XDG_DATA_DIRS
/etc/xdg/xubuntu:/usr/local/share/:/usr/share/:/usr/share/gdm/:/usr/share
icanepa@JtLaptop1:~$