Tilde~ not converted into $HOME #401

aleixpol opened this Issue Nov 10, 2016 · 2 comments


None yet

3 participants

$ flatpak remote-add kdelocal `pwd`/repo --gpg-import=~/kdeflatpak.gpg
error: The file ~/kdeflatpak.gpg specified for --gpg-import was not found: Error opening file /home/apol/tmp/flatpak-kde-runtime/~/kdeflatpak.gpg: No such file or directory

Hmm, tildes are typically expanded by the shell, so apps don't even see them. I guess this is not actually true unless the tilde is the first element in an argument though:

$ echo ~/foo --bar=~/foo
/home/alex/foo --bar=~/foo

I somewhat dislike doing magic parsing of ~ in the app, because that means we can never handle files that actually have tildes in them (no way to escape the magic). Maybe that is not a huge deal for the particular case of gpg key files though...

@alexlarsson alexlarsson added a commit that referenced this issue Nov 15, 2016
@alexlarsson alexlarsson Support relative pathnames in various --gpg=FILE commandline options
We juse use g_file_new_for_commandline_arg instead of g_file_new_for_path.
This is somewhat related to #401
but doesn't actually handle the specific case of tilde.

I had the same problem myself: #197

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment