small cleanups
- Revert 'cannot' --> 'can not' (it's the exception!) - Remove duplicate function - Squelch compiler warnings Closes: #248 Approved by: cgwalters
This commit is contained in:
parent
ddda8e5b8b
commit
41661e47e1
2
cfg.mk
2
cfg.mk
|
|
@ -1,4 +1,4 @@
|
||||||
export VC_LIST_EXCEPT_DEFAULT=^(git.mk|lib/.*|m4/.*|md5/.*|build-aux/.*|src/gettext\.h|.*ChangeLog|buildutil/.*)$$
|
export VC_LIST_EXCEPT_DEFAULT=^(docs/.*|git.mk|lib/.*|m4/.*|md5/.*|build-aux/.*|src/gettext\.h|.*ChangeLog|buildutil/.*)$$
|
||||||
|
|
||||||
local-checks-to-skip = \
|
local-checks-to-skip = \
|
||||||
sc_const_long_option \
|
sc_const_long_option \
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ awareness of BTRFS in dpkg/rpm itself) will be required.
|
||||||
The OSTree author believes that having total freedom at the block
|
The OSTree author believes that having total freedom at the block
|
||||||
storage layer is better for general purpose operating systems. For
|
storage layer is better for general purpose operating systems. For
|
||||||
example, with OSTree, one is free to use BTRFS in any way you like -
|
example, with OSTree, one is free to use BTRFS in any way you like -
|
||||||
you can use a subvolume for `/home`, or you cannot.
|
you may decide to use a subvolume for `/home`, or not.
|
||||||
|
|
||||||
Furthermore, in its most basic incarnation, the rpm/dpkg + BTRFS
|
Furthermore, in its most basic incarnation, the rpm/dpkg + BTRFS
|
||||||
doesn't solve the race conditions that happen when unpacking packages
|
doesn't solve the race conditions that happen when unpacking packages
|
||||||
|
|
|
||||||
|
|
@ -491,7 +491,7 @@ try_metalink_targets (OstreeMetalinkRequest *self,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
SoupURI *target_uri;
|
SoupURI *target_uri = NULL;
|
||||||
|
|
||||||
if (!self->found_a_file_element)
|
if (!self->found_a_file_element)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -745,52 +745,6 @@ query_child_info_dir (OstreeRepo *repo,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
|
||||||
bsearch_in_file_variant (GVariant *variant,
|
|
||||||
const char *name,
|
|
||||||
int *out_pos)
|
|
||||||
{
|
|
||||||
gsize imax, imin;
|
|
||||||
gsize imid;
|
|
||||||
gsize n;
|
|
||||||
|
|
||||||
n = g_variant_n_children (variant);
|
|
||||||
if (n == 0)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
imax = n - 1;
|
|
||||||
imin = 0;
|
|
||||||
while (imax >= imin)
|
|
||||||
{
|
|
||||||
g_autoptr(GVariant) child = NULL;
|
|
||||||
const char *cur;
|
|
||||||
int cmp;
|
|
||||||
|
|
||||||
imid = (imin + imax) / 2;
|
|
||||||
|
|
||||||
child = g_variant_get_child_value (variant, imid);
|
|
||||||
g_variant_get_child (child, 0, "&s", &cur, NULL);
|
|
||||||
|
|
||||||
cmp = strcmp (cur, name);
|
|
||||||
if (cmp < 0)
|
|
||||||
imin = imid + 1;
|
|
||||||
else if (cmp > 0)
|
|
||||||
{
|
|
||||||
if (imid == 0)
|
|
||||||
break;
|
|
||||||
imax = imid - 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
*out_pos = imid;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
*out_pos = imid;
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ostree_repo_file_tree_find_child (OstreeRepoFile *self,
|
ostree_repo_file_tree_find_child (OstreeRepoFile *self,
|
||||||
const char *name,
|
const char *name,
|
||||||
|
|
@ -806,7 +760,7 @@ ostree_repo_file_tree_find_child (OstreeRepoFile *self,
|
||||||
dirs_variant = g_variant_get_child_value (self->tree_contents, 1);
|
dirs_variant = g_variant_get_child_value (self->tree_contents, 1);
|
||||||
|
|
||||||
i = -1;
|
i = -1;
|
||||||
if (bsearch_in_file_variant (files_variant, name, &i))
|
if (ot_variant_bsearch_str (files_variant, name, &i))
|
||||||
{
|
{
|
||||||
*is_dir = FALSE;
|
*is_dir = FALSE;
|
||||||
ret_container = files_variant;
|
ret_container = files_variant;
|
||||||
|
|
@ -814,7 +768,7 @@ ostree_repo_file_tree_find_child (OstreeRepoFile *self,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (bsearch_in_file_variant (dirs_variant, name, &i))
|
if (ot_variant_bsearch_str (dirs_variant, name, &i))
|
||||||
{
|
{
|
||||||
*is_dir = TRUE;
|
*is_dir = TRUE;
|
||||||
ret_container = dirs_variant;
|
ret_container = dirs_variant;
|
||||||
|
|
|
||||||
|
|
@ -319,7 +319,7 @@ ot_variant_bsearch_str (GVariant *array,
|
||||||
int *out_pos)
|
int *out_pos)
|
||||||
{
|
{
|
||||||
gsize imax, imin;
|
gsize imax, imin;
|
||||||
gsize imid;
|
gsize imid = -1;
|
||||||
gsize n;
|
gsize n;
|
||||||
|
|
||||||
n = g_variant_n_children (array);
|
n = g_variant_n_children (array);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue