-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libarchive: Add support for translating paths during commit #1105
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,8 @@ | |
|
||
#pragma once | ||
|
||
#include <sys/stat.h> | ||
|
||
#include "ostree-core.h" | ||
#include "ostree-types.h" | ||
#include "ostree-async-progress.h" | ||
|
@@ -688,6 +690,31 @@ gboolean ostree_repo_write_archive_to_mtree (OstreeRepo * | |
GCancellable *cancellable, | ||
GError **error); | ||
|
||
/** | ||
* OstreeRepoImportArchiveTranslatePathname: | ||
* @repo: Repo | ||
* @stbuf: Stat buffer | ||
* @src_path: Path in the archive | ||
* @user_data: User data | ||
* | ||
* Possibly change a pathname while importing an archive. If %NULL is returned, | ||
* then @src_path will be used unchanged. Otherwise, return a new pathname which | ||
* will be freed via `g_free()`. | ||
* | ||
* This pathname translation will be performed *before* any processing from an | ||
* active `OstreeRepoCommitModifier`. Will be invoked for all directory and file | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should document how this relates to |
||
* types, first with outer directories, then their sub-files and directories. | ||
* | ||
* Note that enabling pathname translation will always override the setting for | ||
* `use_ostree_convention`. | ||
* | ||
* Since: 2017.11 | ||
*/ | ||
typedef char *(*OstreeRepoImportArchiveTranslatePathname) (OstreeRepo *repo, | ||
const struct stat *stbuf, | ||
const char *src_path, | ||
gpointer user_data); | ||
|
||
/** | ||
* OstreeRepoImportArchiveOptions: (skip) | ||
* | ||
|
@@ -703,7 +730,9 @@ typedef struct { | |
guint reserved : 28; | ||
|
||
guint unused_uint[8]; | ||
gpointer unused_ptrs[8]; | ||
OstreeRepoImportArchiveTranslatePathname translate_pathname; | ||
gpointer translate_pathname_user_data; | ||
gpointer unused_ptrs[6]; | ||
} OstreeRepoImportArchiveOptions; | ||
|
||
_OSTREE_PUBLIC | ||
|
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say we add an
else
here. I.e. iftranslate_pathname
is active,use_ostree_convention
has no effect. Otherwise, it's odd thinking that there's a difference between returningNULL
and returning the exact same string.