Repository navigation
Conversation
Use the correct NONE flag, although both are 0 so this change won't make any functional difference.
It's an error to call g_set_error() on an error that's already set, and flatpak_dir_get_deploy_data() already sets FLATPAK_ERROR_NOT_INSTALLED for us when necessary, so just pass on any errors to the caller of flatpak_dir_get_origin(). In the case that the error is something else, that should be treated as an error, because we never expect the deploy directory to exist but not have a deploy file (see the implementations of flatpak_dir_deploy() and flatpak_dir_undeploy()).
Unfortunately in commit 253fcc6 I broke the build-bundle command so that it is unable to resolve remote refs (as opposed to local ones). This means in the normal case of building a bundle for an app installed from a remote it fails: $ flatpak build-bundle /var/lib/flatpak/repo gnome-calculator.flatpak org.gnome.Calculator stable error: Refspec 'app/org.gnome.Calculator/x86_64/stable' not found This is because flatpak_repo_resolve_rev() interprets a NULL remote name to mean the ref is local (in refs/heads/) but in this case we just don't know which remote it's from. This commit fixes the issue by using ostree_repo_resolve_rev() directly which searches refs/heads/ and refs/remotes/, and if that fails falling back to iterating over refs returned by ostree_repo_list_collection_refs() to catch collection-refs that may be in refs/mirrors/. Also, add a unit test that fails without this patch. Fixes flatpak#3026
wjt
reviewed
Jul 31, 2019
wjt
left a comment
Contributor
There was a problem hiding this comment.
I don't exactly follow the ref-resolution logic but I do have one question about an assertion.
| } | ||
| } | ||
|
|
||
| g_assert (*out_rev == NULL); |
Contributor
There was a problem hiding this comment.
Shouldn't this be a g_return_val_if_fail at the top of the function? It is not under this function's (direct) control.
Contributor
Author
There was a problem hiding this comment.
Yeah you're right. Pushed a fixup
Member
|
📌 Commit 5a22e08 has been approved by |
rh-atomic-bot
pushed a commit
that referenced
this pull request
Aug 15, 2019
It's an error to call g_set_error() on an error that's already set, and flatpak_dir_get_deploy_data() already sets FLATPAK_ERROR_NOT_INSTALLED for us when necessary, so just pass on any errors to the caller of flatpak_dir_get_origin(). In the case that the error is something else, that should be treated as an error, because we never expect the deploy directory to exist but not have a deploy file (see the implementations of flatpak_dir_deploy() and flatpak_dir_undeploy()). Closes: #3032 Approved by: alexlarsson
rh-atomic-bot
pushed a commit
that referenced
this pull request
Aug 15, 2019
Unfortunately in commit 253fcc6 I broke the build-bundle command so that it is unable to resolve remote refs (as opposed to local ones). This means in the normal case of building a bundle for an app installed from a remote it fails: $ flatpak build-bundle /var/lib/flatpak/repo gnome-calculator.flatpak org.gnome.Calculator stable error: Refspec 'app/org.gnome.Calculator/x86_64/stable' not found This is because flatpak_repo_resolve_rev() interprets a NULL remote name to mean the ref is local (in refs/heads/) but in this case we just don't know which remote it's from. This commit fixes the issue by using ostree_repo_resolve_rev() directly which searches refs/heads/ and refs/remotes/, and if that fails falling back to iterating over refs returned by ostree_repo_list_collection_refs() to catch collection-refs that may be in refs/mirrors/. Also, add a unit test that fails without this patch. Fixes #3026 Closes: #3032 Approved by: alexlarsson
|
☀️ Test successful - status-papr |
mwleeds
added a commit
to mwleeds/flatpak
that referenced
this pull request
Sep 16, 2019
Use the correct NONE flag, although both are 0 so this change won't make any functional difference. Closes: flatpak#3032 Approved by: alexlarsson (cherry picked from commit 9a258e8)
mwleeds
added a commit
to mwleeds/flatpak
that referenced
this pull request
Sep 16, 2019
It's an error to call g_set_error() on an error that's already set, and flatpak_dir_get_deploy_data() already sets FLATPAK_ERROR_NOT_INSTALLED for us when necessary, so just pass on any errors to the caller of flatpak_dir_get_origin(). In the case that the error is something else, that should be treated as an error, because we never expect the deploy directory to exist but not have a deploy file (see the implementations of flatpak_dir_deploy() and flatpak_dir_undeploy()). Closes: flatpak#3032 Approved by: alexlarsson (cherry picked from commit b44c1a5)
mwleeds
added a commit
to mwleeds/flatpak
that referenced
this pull request
Sep 16, 2019
Unfortunately in commit 253fcc6 I broke the build-bundle command so that it is unable to resolve remote refs (as opposed to local ones). This means in the normal case of building a bundle for an app installed from a remote it fails: $ flatpak build-bundle /var/lib/flatpak/repo gnome-calculator.flatpak org.gnome.Calculator stable error: Refspec 'app/org.gnome.Calculator/x86_64/stable' not found This is because flatpak_repo_resolve_rev() interprets a NULL remote name to mean the ref is local (in refs/heads/) but in this case we just don't know which remote it's from. This commit fixes the issue by using ostree_repo_resolve_rev() directly which searches refs/heads/ and refs/remotes/, and if that fails falling back to iterating over refs returned by ostree_repo_list_collection_refs() to catch collection-refs that may be in refs/mirrors/. Also, add a unit test that fails without this patch. Fixes flatpak#3026 Closes: flatpak#3032 Approved by: alexlarsson (cherry picked from commit 5e65174)
alexlarsson
pushed a commit
to alexlarsson/flatpak
that referenced
this pull request
Sep 18, 2019
It's an error to call g_set_error() on an error that's already set, and flatpak_dir_get_deploy_data() already sets FLATPAK_ERROR_NOT_INSTALLED for us when necessary, so just pass on any errors to the caller of flatpak_dir_get_origin(). In the case that the error is something else, that should be treated as an error, because we never expect the deploy directory to exist but not have a deploy file (see the implementations of flatpak_dir_deploy() and flatpak_dir_undeploy()). Closes: flatpak#3032 Approved by: alexlarsson (cherry picked from commit b44c1a5)
alexlarsson
pushed a commit
to alexlarsson/flatpak
that referenced
this pull request
Sep 18, 2019
Unfortunately in commit 253fcc6 I broke the build-bundle command so that it is unable to resolve remote refs (as opposed to local ones). This means in the normal case of building a bundle for an app installed from a remote it fails: $ flatpak build-bundle /var/lib/flatpak/repo gnome-calculator.flatpak org.gnome.Calculator stable error: Refspec 'app/org.gnome.Calculator/x86_64/stable' not found This is because flatpak_repo_resolve_rev() interprets a NULL remote name to mean the ref is local (in refs/heads/) but in this case we just don't know which remote it's from. This commit fixes the issue by using ostree_repo_resolve_rev() directly which searches refs/heads/ and refs/remotes/, and if that fails falling back to iterating over refs returned by ostree_repo_list_collection_refs() to catch collection-refs that may be in refs/mirrors/. Also, add a unit test that fails without this patch. Fixes flatpak#3026 Closes: flatpak#3032 Approved by: alexlarsson (cherry picked from commit 5e65174)
rh-atomic-bot
pushed a commit
that referenced
this pull request
Sep 18, 2019
It's an error to call g_set_error() on an error that's already set, and flatpak_dir_get_deploy_data() already sets FLATPAK_ERROR_NOT_INSTALLED for us when necessary, so just pass on any errors to the caller of flatpak_dir_get_origin(). In the case that the error is something else, that should be treated as an error, because we never expect the deploy directory to exist but not have a deploy file (see the implementations of flatpak_dir_deploy() and flatpak_dir_undeploy()). Closes: #3032 Approved by: alexlarsson (cherry picked from commit b44c1a5) Closes: #3111 Approved by: alexlarsson
rh-atomic-bot
pushed a commit
that referenced
this pull request
Sep 18, 2019
Unfortunately in commit 253fcc6 I broke the build-bundle command so that it is unable to resolve remote refs (as opposed to local ones). This means in the normal case of building a bundle for an app installed from a remote it fails: $ flatpak build-bundle /var/lib/flatpak/repo gnome-calculator.flatpak org.gnome.Calculator stable error: Refspec 'app/org.gnome.Calculator/x86_64/stable' not found This is because flatpak_repo_resolve_rev() interprets a NULL remote name to mean the ref is local (in refs/heads/) but in this case we just don't know which remote it's from. This commit fixes the issue by using ostree_repo_resolve_rev() directly which searches refs/heads/ and refs/remotes/, and if that fails falling back to iterating over refs returned by ostree_repo_list_collection_refs() to catch collection-refs that may be in refs/mirrors/. Also, add a unit test that fails without this patch. Fixes #3026 Closes: #3032 Approved by: alexlarsson (cherry picked from commit 5e65174) Closes: #3111 Approved by: alexlarsson
alexlarsson
pushed a commit
that referenced
this pull request
Sep 18, 2019
It's an error to call g_set_error() on an error that's already set, and flatpak_dir_get_deploy_data() already sets FLATPAK_ERROR_NOT_INSTALLED for us when necessary, so just pass on any errors to the caller of flatpak_dir_get_origin(). In the case that the error is something else, that should be treated as an error, because we never expect the deploy directory to exist but not have a deploy file (see the implementations of flatpak_dir_deploy() and flatpak_dir_undeploy()). Closes: #3032 Approved by: alexlarsson (cherry picked from commit b44c1a5)
alexlarsson
pushed a commit
that referenced
this pull request
Sep 18, 2019
Unfortunately in commit 253fcc6 I broke the build-bundle command so that it is unable to resolve remote refs (as opposed to local ones). This means in the normal case of building a bundle for an app installed from a remote it fails: $ flatpak build-bundle /var/lib/flatpak/repo gnome-calculator.flatpak org.gnome.Calculator stable error: Refspec 'app/org.gnome.Calculator/x86_64/stable' not found This is because flatpak_repo_resolve_rev() interprets a NULL remote name to mean the ref is local (in refs/heads/) but in this case we just don't know which remote it's from. This commit fixes the issue by using ostree_repo_resolve_rev() directly which searches refs/heads/ and refs/remotes/, and if that fails falling back to iterating over refs returned by ostree_repo_list_collection_refs() to catch collection-refs that may be in refs/mirrors/. Also, add a unit test that fails without this patch. Fixes #3026 Closes: #3032 Approved by: alexlarsson (cherry picked from commit 5e65174)
alexlarsson
pushed a commit
to alexlarsson/flatpak
that referenced
this pull request
Sep 19, 2019
It's an error to call g_set_error() on an error that's already set, and flatpak_dir_get_deploy_data() already sets FLATPAK_ERROR_NOT_INSTALLED for us when necessary, so just pass on any errors to the caller of flatpak_dir_get_origin(). In the case that the error is something else, that should be treated as an error, because we never expect the deploy directory to exist but not have a deploy file (see the implementations of flatpak_dir_deploy() and flatpak_dir_undeploy()). Closes: flatpak#3032 Approved by: alexlarsson (cherry picked from commit b44c1a5) (cherry picked from commit 8ed03ef)
rh-atomic-bot
pushed a commit
that referenced
this pull request
Sep 19, 2019
It's an error to call g_set_error() on an error that's already set, and flatpak_dir_get_deploy_data() already sets FLATPAK_ERROR_NOT_INSTALLED for us when necessary, so just pass on any errors to the caller of flatpak_dir_get_origin(). In the case that the error is something else, that should be treated as an error, because we never expect the deploy directory to exist but not have a deploy file (see the implementations of flatpak_dir_deploy() and flatpak_dir_undeploy()). Closes: #3032 Approved by: alexlarsson (cherry picked from commit b44c1a5) (cherry picked from commit 8ed03ef) Closes: #3115 Approved by: alexlarsson
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.