Bug 240139

Summary: xdg-user-dirs-update doesn't keep local changes
Product: [Fedora] Fedora Reporter: Josh Boyer <jwboyer>
Component: xdg-user-dirsAssignee: Alexander Larsson <alexl>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-05-17 03:06:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 150225    

Description Josh Boyer 2007-05-15 14:00:03 UTC
Description of problem:

xdg-user-dirs-update keeps creating the stupid Download, Pictures, Video, etc
directories in my home directory even if I manually edit .config/user-dirs.dirs

Version-Release number of selected component (if applicable):

xdg-user-dirs-0.6-1.fc7

How reproducible:

Always

Steps to Reproduce:
1. Delete the Pictures, Download, Documents, Video, Templates directories
2. Edit .config/user-dirs.dirs
3. Run xdg-user-dirs-update
  
Actual results:

Local changes are removed and the directories are recreated

Expected results:

Local changes are honored.

Additional info:

According to .config/user-dirs.dirs:

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 

However this isn't keeping the local changes at all.

Comment 1 Matthias Clasen 2007-05-15 15:22:42 UTC
Can you explain step 2 in more detail ?

Comment 2 Josh Boyer 2007-05-15 15:34:35 UTC
(In reply to comment #1)
> Can you explain step 2 in more detail ?

Sure.  I change this:

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"
XDG_DOWNLOAD_DIR="$HOME/Download"

to this:

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_TEMPLATES_DIR="$HOME"
XDG_PUBLICSHARE_DIR="$HOME"
XDG_DOCUMENTS_DIR="$HOME"
XDG_MUSIC_DIR="$HOME"
XDG_PICTURES_DIR="$HOME"
XDG_VIDEOS_DIR="$HOME"
XDG_DOWNLOAD_DIR="$HOME"

and xdg-user-dirs-update changes it back (while also reordering them in the file
for some reason)



Comment 3 Matthias Clasen 2007-05-15 16:44:42 UTC
ah, I can confirm that. 

Comment 4 Matthias Clasen 2007-05-15 16:48:45 UTC
It seems not happy if you set things back to $HOME. You can set it to 
$HOME/. as a workaround for now.

Comment 5 Matthias Clasen 2007-05-15 16:55:00 UTC
Alex, can you have a look at this ?

It looks like it may be enough to remove the *value == 0 check in load_user_dirs().

Comment 6 Josh Boyer 2007-05-15 17:23:01 UTC
(In reply to comment #4)
> It seems not happy if you set things back to $HOME. You can set it to 
> $HOME/. as a workaround for now.

Yep, this workaround works for me.  Thanks for responding so quickly.


Comment 7 Alexander Larsson 2007-05-16 08:39:05 UTC
Fix in xdg-user-dirs-0.8-1.fc7


Comment 8 Matthias Clasen 2007-05-17 03:06:59 UTC
This has been tagged for F7.