bin/commit: Fix --tree=tar with --selinux-policy
authorColin Walters <walters@verbum.org>
Wed, 29 Sep 2021 13:03:24 +0000 (09:03 -0400)
committerColin Walters <walters@verbum.org>
Thu, 30 Sep 2021 15:44:27 +0000 (11:44 -0400)
commitab12e380fc51487672d07ddf47295ee182e62d36
tree353424b101c8649336336f8bb48565e16fcf0b0c
parente8394c755bbbfaf9071baad2c55b3d76a82555ea
bin/commit: Fix --tree=tar with --selinux-policy

The logic for `--selinux-policy` ended up in the `--tree=dir`
path, but there's no reason for that.  Fix the imported
labeling with `--tree=tar`.  Prep for use with containers.

We had this bug because the previous logic was trying to avoid
duplicating the code for generic `--selinux-policy` and
the case of `--selinux-policy-from-base --tree=dir`.

It's a bit more code, but it's cleaner if we dis-entangle them.
src/ostree/ot-builtin-commit.c
tests/kolainst/destructive/itest-label-selinux.sh