From: Paul Moore <pmoore@redhat.com>
To: selinux@tycho.nsa.gov
Subject: [PATCH] selinux-testsuite: fix RHEL detection
Date: Fri, 06 Feb 2015 17:34:24 -0500 [thread overview]
Message-ID: <20150206223424.13392.21940.stgit@localhost> (raw)
The redhat-release package is not consistently named across RHEL
releases, use the /etc/redhat-release instead to detect the RHEL
version.
Signed-off-by: Paul Moore <pmoore@redhat.com>
---
tests/Makefile | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tests/Makefile b/tests/Makefile
index 3838e14..7c27787 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,18 +1,19 @@
-REDHAT_RELEASE=$(shell rpm -q redhat-release)
+RHEL_VER=$(shell cat /etc/redhat-release)
+RHEL_VER_PREFIX=Red Hat Enterprise Linux Server release
SUBDIRS_COMMON:=domain_trans entrypoint execshare exectrace execute_no_trans fdreceive inherit link mkdir msg open ptrace readlink relabel rename rxdir sem setattr setnice shm sigkill stat sysctl task_create task_setnice task_setscheduler task_getscheduler task_getsid task_getpgid task_setpgid wait file ioctl capable_file capable_net capable_sys
SUBDIRS:= $(SUBDIRS_COMMON) dyntrans dyntrace bounds nnp
-ifeq (redhat-release-4, $(findstring redhat-release-4, $(REDHAT_RELEASE)))
+ifeq ($(RHEL_VER_PREFIX)4, $(findstring $(RHEL_VER_PREFIX)4, $(RHEL_VER)))
SUBDIRS:=$(SUBDIRS_COMMON)
endif
-ifeq (redhat-release-5, $(findstring redhat-release-5, $(REDHAT_RELEASE)))
+ifeq ($(RHEL_VER_PREFIX)5, $(findstring $(RHEL_VER_PREFIX)5, $(RHEL_VER)))
SUBDIRS:=$(SUBDIRS_COMMON) dyntrace dyntrans
endif
-ifeq (redhat-release-6, $(findstring redhat-release-6, $(REDHAT_RELEASE)))
+ifeq ($(RHEL_VER_PREFIX)6, $(findstring $(RHEL_VER_PREFIX)6, $(RHEL_VER)))
SUBDIRS:=$(SUBDIRS_COMMON) dyntrace dyntrans bounds
endif
next reply other threads:[~2015-02-06 22:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-06 22:34 Paul Moore [this message]
2015-02-09 16:13 ` [PATCH] selinux-testsuite: fix RHEL detection Stephen Smalley
2015-02-09 17:07 ` Paul Moore
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150206223424.13392.21940.stgit@localhost \
--to=pmoore@redhat.com \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.