Bug 240139 - xdg-user-dirs-update doesn't keep local changes
xdg-user-dirs-update doesn't keep local changes
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: xdg-user-dirs (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Alexander Larsson
:
Depends On:
Blocks: FC7Target
  Show dependency treegraph
 
Reported: 2007-05-15 10:00 EDT by Josh Boyer
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-05-16 23:06:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Josh Boyer 2007-05-15 10:00:03 EDT
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 11:22:42 EDT
Can you explain step 2 in more detail ?
Comment 2 Josh Boyer 2007-05-15 11:34:35 EDT
(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 12:44:42 EDT
ah, I can confirm that. 
Comment 4 Matthias Clasen 2007-05-15 12:48:45 EDT
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 12:55:00 EDT
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 13:23:01 EDT
(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 04:39:05 EDT
Fix in xdg-user-dirs-0.8-1.fc7
Comment 8 Matthias Clasen 2007-05-16 23:06:59 EDT
This has been tagged for F7.

Note You need to log in before you can comment on or make changes to this bug.