Re: [PATCH testsuite] policy: do not rebuild policy package if already built

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 23, 2019 at 11:58 AM Ondrej Mosnacek <omosnace@xxxxxxxxxx> wrote:
> Right now, test_policy.pp is rebuilt on every make invocation. Tweak the
> Makefile so that it is only build when it hasn't been built, it has been
> cleaned, or the source files changed.
>
> Signed-off-by: Ondrej Mosnacek <omosnace@xxxxxxxxxx>
> ---
>  policy/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/policy/Makefile b/policy/Makefile
> index a5942b3..cc0f140 100644
> --- a/policy/Makefile
> +++ b/policy/Makefile
> @@ -86,7 +86,7 @@ ifeq (x$(DISTRO),$(filter x$(DISTRO),xRHEL4 xRHEL5 xRHEL6))
>  TARGETS:=$(filter-out test_overlayfs.te test_mqueue.te test_ibpkey.te, $(TARGETS))
>  endif
>
> -all: build
> +all: test_policy/test_policy.pp
>
>  expand_check:
>         # Test for "expand-check = 0" in /etc/selinux/semanage.conf
> @@ -94,7 +94,7 @@ expand_check:
>                 (echo "ERROR: set 'expand-check = 0' in /etc/selinux/semanage.conf"; \
>                  /bin/false)
>
> -build: $(TARGETS)
> +test_policy/test_policy.pp: $(TARGETS) test_policy.if
>         # General policy build
>         @if [ -d $(POLDEV) ]; then \
>                 mkdir -p test_policy; \
> --
> 2.21.0
>

This doesn't make much of a difference performance-wise, but the
behavior is more logical this way.

-- 
Ondrej Mosnacek <omosnace at redhat dot com>
Software Engineer, Security Technologies
Red Hat, Inc.





[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux