Make P2P API public (no longer experimental)
Currently the API that allows P2P operations (e.g. pulling an ostree ref from a LAN or USB source) is hidden behind the configure flag --enable-experimental-api. This commit makes the API public and makes that flag essentially a no-op (leaving it in place in case we want to use it again in the future). The P2P API has been tested over the last several months and proven to work. This means that since we're no longer using the "experimental" feature flag, P2P builds of Flatpak will fail when using versions of OSTree from this commit onwards, until Flatpak is patched in the near future. If you want to build Flatpak < 0.11.8 with P2P enabled and link against OSTree 2018.6, you'll have to patch Flatpak. However, since Flatpak won't yet have a hard dependency on OSTree 2018.6, it needs a new way to determine if the P2P API in OSTree is available, so this commit adds a "p2p" feature flag. This way the feature set is more semantically correct than if we had continued to use the "experimental" feature flag. In addition to making the P2P API public, this commit makes the P2P unit tests run by default, removes the f27-experimental CI instance that's no longer needed, changes a few man pages to reflect the changes, and updates the bash completion script to accept the new commands and options. Closes: #1596 Approved by: cgwalters
This commit is contained in:
1 parent
f1d9196076
commit
8fbf19c9f5
48 files changed
+347
-513
No files matched your search
+111
@@ -120,12 +120,25 @@ __ostree_compreply_oses() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Find refs associated with the given collection ID under $repo_path.
|
||||
__ostree_compreply_collection_refs() {
|
||||
local collection_id=( $1 )
|
||||
refs=$( ostree refs --repo $repo_path --collections $collection_id 2>/dev/null | cut -d ' ' -f 2 | sed -e 's/)$//' )
|
||||
COMPREPLY+=( $( compgen -W "$refs" -- "$cur" ) )
|
||||
}
|
||||
|
||||
# Find refs under $repo_path.
|
||||
__ostree_compreply_refs() {
|
||||
refs=$( ostree refs --repo $repo_path 2>/dev/null )
|
||||
COMPREPLY+=( $( compgen -W "$refs" -- "$cur" ) )
|
||||
}
|
||||
|
||||
# Find collection IDs under $repo_path.
|
||||
__ostree_compreply_collection_ids() {
|
||||
collection_ids=$( ostree refs --repo $repo_path --collections 2>/dev/null | cut -d ',' -f 1 | sed -e 's/^(//' | sort | uniq )
|
||||
COMPREPLY+=( $( compgen -W "$collection_ids" -- "$cur" ) )
|
||||
}
|
||||
|
||||
# Find remotes under $repo_path.
|
||||
__ostree_compreply_remotes() {
|
||||
remotes=$( ostree remote list --repo $repo_path 2> /dev/null )
|
||||
@@ -410,6 +423,49 @@ _ostree_config() {
|
||||
return 0
|
||||
}
|
||||
|
||||
_ostree_create_usb() {
|
||||
local boolean_options="
|
||||
$main_boolean_options
|
||||
--disable-fsync
|
||||
"
|
||||
|
||||
local options_with_args="
|
||||
--destination-repo
|
||||
--repo
|
||||
"
|
||||
|
||||
local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" )
|
||||
|
||||
case "$prev" in
|
||||
--destination-repo|--repo)
|
||||
__ostree_compreply_dirs_only
|
||||
return 0
|
||||
;;
|
||||
$options_with_args_glob )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
local all_options="$boolean_options $options_with_args"
|
||||
__ostree_compreply_all_options
|
||||
;;
|
||||
*)
|
||||
local argpos=$( __ostree_pos_first_nonflag $( __ostree_to_alternatives "$options_with_args" ) )
|
||||
|
||||
if [ $cword -eq $argpos ]; then
|
||||
__ostree_compreply_dirs_only
|
||||
elif [ $cword -gt $argpos ] && [ $(((cword - argpos) % 2)) -eq 1 ]; then
|
||||
__ostree_compreply_collection_ids
|
||||
elif [ $cword -gt $argpos ] && [ $(((cword - argpos) % 2)) -eq 0 ]; then
|
||||
__ostree_compreply_collection_refs "${words[$cword - 1]}"
|
||||
fi
|
||||
esac
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
_ostree_diff() {
|
||||
local boolean_options="
|
||||
$main_boolean_options
|
||||
@@ -495,6 +551,56 @@ _ostree_export() {
|
||||
return 0
|
||||
}
|
||||
|
||||
_ostree_find_remotes() {
|
||||
local boolean_options="
|
||||
$main_boolean_options
|
||||
--disable-fsync
|
||||
--pull
|
||||
"
|
||||
|
||||
local options_with_args="
|
||||
--finders
|
||||
--repo
|
||||
"
|
||||
|
||||
local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" )
|
||||
|
||||
case "$prev" in
|
||||
--finders)
|
||||
local choices="config lan mount"
|
||||
local config_first="config,lan config,mount config,lan,mount config,mount,lan"
|
||||
local lan_first="lan,config lan,mount lan,config,mount lan,mount,config"
|
||||
local mount_first="mount,config mount,lan mount,lan,config mount,config,lan"
|
||||
COMPREPLY+=( $( compgen -W "$choices $config_first $lan_first $mount_first" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
--repo)
|
||||
__ostree_compreply_dirs_only
|
||||
return 0
|
||||
;;
|
||||
$options_with_args_glob )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
local all_options="$boolean_options $options_with_args"
|
||||
__ostree_compreply_all_options
|
||||
;;
|
||||
*)
|
||||
local argpos=$( __ostree_pos_first_nonflag $( __ostree_to_alternatives "$options_with_args" ) )
|
||||
|
||||
if [ $cword -ge $argpos ] && [ $(((cword - argpos) % 2)) -eq 0 ]; then
|
||||
__ostree_compreply_collection_ids
|
||||
elif [ $cword -ge $argpos ] && [ $(((cword - argpos) % 2)) -eq 1 ]; then
|
||||
__ostree_compreply_collection_refs "${words[$cword - 1]}"
|
||||
fi
|
||||
esac
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
_ostree_fsck() {
|
||||
local boolean_options="
|
||||
$main_boolean_options
|
||||
@@ -576,6 +682,7 @@ _ostree_init() {
|
||||
"
|
||||
|
||||
local options_with_args="
|
||||
--collection-id
|
||||
--mode
|
||||
--repo
|
||||
"
|
||||
@@ -839,6 +946,7 @@ _ostree_refs() {
|
||||
local boolean_options="
|
||||
$main_boolean_options
|
||||
--alias -A
|
||||
--collections -c
|
||||
--delete
|
||||
--list
|
||||
"
|
||||
@@ -878,6 +986,7 @@ _ostree_remote_add() {
|
||||
"
|
||||
|
||||
local options_with_args="
|
||||
--collection-id
|
||||
--contenturl
|
||||
--gpg-import
|
||||
--repo
|
||||
@@ -1615,8 +1724,10 @@ _ostree() {
|
||||
checksum
|
||||
commit
|
||||
config
|
||||
create-usb
|
||||
diff
|
||||
export
|
||||
find-remotes
|
||||
fsck
|
||||
gpg-sign
|
||||
init
|
||||
|
||||
Reference in new issue
Block a user