After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 762762 - Critical warnings when passing relative path to --profile
Critical warnings when passing relative path to --profile
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
git master
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-02-27 03:10 UTC by Michael Catanzaro
Modified: 2016-02-29 23:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
uri-tester: Handle relative profile dirs (1.70 KB, patch)
2016-02-27 03:11 UTC, Michael Catanzaro
none Details | Review
file-helpers: convert profile_dir to absolute path (1.20 KB, patch)
2016-02-27 03:11 UTC, Michael Catanzaro
none Details | Review
file-helpers: convert profile_dir to absolute path (1.20 KB, patch)
2016-02-27 18:06 UTC, Michael Catanzaro
none Details | Review
file-helpers: convert profile_dir to absolute path (1.40 KB, patch)
2016-02-28 19:46 UTC, Michael Catanzaro
committed Details | Review

Description Michael Catanzaro 2016-02-27 03:10:41 UTC
When running 'epiphany --profile=ephytest' everything seems to work properly, except for EphyUriTester which emits a bunch of criticals as it doesn't handle relative paths properly. Two easy solutions: (a) we could normalize it there, or (b) seems nicer to normalize it in ephy_file_helpers_init?
Comment 1 Michael Catanzaro 2016-02-27 03:11:18 UTC
Created attachment 322510 [details] [review]
uri-tester: Handle relative profile dirs

When Epiphany is run with --profile and a relative path to the profile
dir, it mostly works fine, with the exception of a bunch of criticals
coming from EphyUriTester. Fix it.
Comment 2 Michael Catanzaro 2016-02-27 03:11:21 UTC
Created attachment 322511 [details] [review]
file-helpers: convert profile_dir to absolute path

When Epiphany is run with --profile and a relative path to the profile
dir, it mostly works fine, with the exception of a bunch of criticals
coming from EphyUriTester. Fix it here so the rest of the code doesn't
have to worry about relative paths.
Comment 3 Michael Catanzaro 2016-02-27 03:11:31 UTC
(pick one)
Comment 4 Carlos Garcia Campos 2016-02-27 06:22:38 UTC
Review of attachment 322511 [details] [review]:

This one looks simpler and safer. Thanks!

::: lib/ephy-file-helpers.c
@@ +335,3 @@
+		GFile *file = g_file_new_for_path (profile_dir);
+		dot_dir = g_file_get_path (file);
+		g_object_unref (file);

We can avoid the gobject creation/destruction if the path is already absolute which is the most common case. We can do:

if (g_path_is_absolute (path))
    g_strdup()
else
    g_file_new
Comment 5 Michael Catanzaro 2016-02-27 14:39:45 UTC
(In reply to Carlos Garcia Campos from comment #4)
> We can avoid the gobject creation/destruction if the path is already
> absolute which is the most common case. We can do:
> 
> if (g_path_is_absolute (path))
>     g_strdup()
> else
>     g_file_new

Really think that's worth adding a conditional for?
Comment 6 Carlos Garcia Campos 2016-02-27 15:09:46 UTC
(In reply to Michael Catanzaro from comment #5)
> (In reply to Carlos Garcia Campos from comment #4)
> > We can avoid the gobject creation/destruction if the path is already
> > absolute which is the most common case. We can do:
> > 
> > if (g_path_is_absolute (path))
> >     g_strdup()
> > else
> >     g_file_new
> 
> Really think that's worth adding a conditional for?

Yes.
Comment 7 Michael Catanzaro 2016-02-27 18:05:52 UTC
Should also handle the case where g_file_get_path returns NULL (probably if the user passes something weird to --profile).
Comment 8 Michael Catanzaro 2016-02-27 18:06:29 UTC
Created attachment 322545 [details] [review]
file-helpers: convert profile_dir to absolute path

When Epiphany is run with --profile and a relative path to the profile
dir, it mostly works fine, with the exception of a bunch of criticals
coming from EphyUriTester. Fix it here so the rest of the code doesn't
have to worry about relative paths.
Comment 9 Michael Catanzaro 2016-02-28 19:34:19 UTC
(In reply to Michael Catanzaro from comment #8)
> Created attachment 322545 [details] [review] [review]
> file-helpers: convert profile_dir to absolute path
> 
> When Epiphany is run with --profile and a relative path to the profile
> dir, it mostly works fine, with the exception of a bunch of criticals
> coming from EphyUriTester. Fix it here so the rest of the code doesn't
> have to worry about relative paths.

Looks like I forgot to 'git add'
Comment 10 Michael Catanzaro 2016-02-28 19:46:18 UTC
Created attachment 322605 [details] [review]
file-helpers: convert profile_dir to absolute path

When Epiphany is run with --profile and a relative path to the profile
dir, it mostly works fine, with the exception of a bunch of criticals
coming from EphyUriTester. Fix it here so the rest of the code doesn't
have to worry about relative paths.
Comment 11 Michael Catanzaro 2016-02-29 23:33:45 UTC
Attachment 322605 [details] pushed as 27fdc93 - file-helpers: convert profile_dir to absolute path