Bug 14290

Summary: xdg-utils should provide a --destdir option
Product: Portland Reporter: Diego Elio Pettenò <flameeyes>
Component: xdg-utilsAssignee: Portland Bugs <portland-bugs>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium CC: webmaster
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Diego Elio Pettenò 2008-01-29 05:06:21 UTC
Most distributors, when preparing a binary package from a source one, don't install directly on the live filesystem, as that would make it difficult to track down which files belong to who, and they instead use a DESTDIR variable (usually passed to the make install phase) to install in a different tree.

Right now packages using xdg-utils to install data only try to write on the live filesystem, which they might not be able to write to (either through permissions, or through the use of sandbox software).

Having a --destdir option, that still searches the directories on the live filesystem, but writes in a different tree would be a good deal for most distributions. It would still require modifying the packages' build system to add the option, but then it would be a one-time upstreamable change.

Just remember that DESTDIR is allowed to be empty, so --destdir '' should still be allowed.

Also, as it should check for presence of directories on live filesystem (to see what the system already is using), it would be a good idea to _create_ the target directories if they don't exist, as that's likely what a distributor would want.
Comment 1 Diego Elio Pettenò 2008-01-29 05:46:32 UTC
Also, update-desktop-database and update-mime-database should _not_ be ran when using --destdir as otherwise they'll create colliding files.
Comment 2 Sebastian Pipping 2009-03-29 12:51:56 UTC
I second Diego's request.  Would be great if it would be accompanied by a variable XDG_DESTDIR as done with XDG_DATA_DIR and friends.

I would try hacking a patch together myself provided that you want such an extension upstream conceptually.  What do you say?
Comment 3 Sebastian Pipping 2009-04-21 18:29:26 UTC
As I said that I'm willing to help either "yes please" or "no thanks" would be nice to hear.  Thank you.
Comment 4 Sebastian Pipping 2009-05-17 19:29:33 UTC
ping
Comment 5 GitLab Migration User 2019-02-16 13:28:54 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xdg/xdg-utils/issues/22.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.