Bug 95339 - xdg-app run requires ~/config/user-dirs.dirs
Summary: xdg-app run requires ~/config/user-dirs.dirs
Status: RESOLVED FIXED
Alias: None
Product: xdg-app
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Alexander Larsson
QA Contact: Alexander Larsson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-10 17:43 UTC by Tristan Van Berkom
Modified: 2016-05-12 06:46 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Tristan Van Berkom 2016-05-10 17:43:37 UTC
If xdg-user-dirs-update has never run on the host, then xdg-app run bails out with the following error:

  "Can't find source path /home/builder/.config/user-dirs.dirs: No such file or directory"

The following change in (pre-flatpak) common/xdg-app-run.c:xdg_app_run_add_environment_args() seems to address the issue:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- a/common/xdg-app-run.c
+++ b/common/xdg-app-run.c
@@ -1785,9 +1785,11 @@ xdg_app_run_add_environment_args (GPtrArray     *argv_array,
                                                     NULL);
       g_autofree char *path = g_build_filename (gs_file_get_path_cached (app_id_dir),
                                                 "config/user-dirs.dirs", NULL);
-      add_args (argv_array,
-                "--ro-bind", src_path, path,
-                NULL);
+
+      if (g_file_test (src_path, G_FILE_TEST_EXISTS))
+       add_args (argv_array,
+                 "--ro-bind", src_path, path,
+                 NULL);
     }
   else if (xdg_dirs_conf != NULL && app_id_dir != NULL)
     {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

But I cant say if that is correct, perhaps a more informative error message would be nice if the user-dirs.dirs is expected in the runtime environment.
Comment 1 Alexander Larsson 2016-05-12 06:46:44 UTC
Not sure we can do better, pushed this.


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.