From patchwork Sat Jan 5 19:37:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Iooss X-Patchwork-Id: 10749385 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB19313B5 for ; Sat, 5 Jan 2019 19:38:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D3D0287EF for ; Sat, 5 Jan 2019 19:38:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9198D2880F; Sat, 5 Jan 2019 19:38:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EAED287EF for ; Sat, 5 Jan 2019 19:38:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726303AbfAETiN (ORCPT ); Sat, 5 Jan 2019 14:38:13 -0500 Received: from mx1.polytechnique.org ([129.104.30.34]:59416 "EHLO mx1.polytechnique.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726286AbfAETiN (ORCPT ); Sat, 5 Jan 2019 14:38:13 -0500 Received: from localhost.localdomain (89-156-252-9.rev.numericable.fr [89.156.252.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ssl.polytechnique.org (Postfix) with ESMTPSA id 931315647FE for ; Sat, 5 Jan 2019 20:38:11 +0100 (CET) From: Nicolas Iooss To: selinux@vger.kernel.org Subject: [PATCH 4/5] python/sepolgen: refpolicy installs its Makefile in include/Makefile Date: Sat, 5 Jan 2019 20:37:58 +0100 Message-Id: <20190105193759.3333-5-nicolas.iooss@m4x.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190105193759.3333-1-nicolas.iooss@m4x.org> References: <20190105193759.3333-1-nicolas.iooss@m4x.org> MIME-Version: 1.0 X-AV-Checked: ClamAV using ClamSMTP at svoboda.polytechnique.org (Sat Jan 5 20:38:11 2019 +0100 (CET)) X-Org-Mail: nicolas.iooss.2010@polytechnique.org Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When running "make install-headers" on refpolicy, /usr/share/selinux/refpolicy/Makefile does not exist but /usr/share/selinux/refpolicy/include/Makefile does. Use it when available. Signed-off-by: Nicolas Iooss --- python/sepolgen/src/sepolgen/defaults.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/sepolgen/src/sepolgen/defaults.py b/python/sepolgen/src/sepolgen/defaults.py index 533a90412475..6e800695b60f 100644 --- a/python/sepolgen/src/sepolgen/defaults.py +++ b/python/sepolgen/src/sepolgen/defaults.py @@ -70,7 +70,10 @@ def attribute_info(): def refpolicy_makefile(): chooser = PathChooser("/etc/selinux/sepolgen.conf") - return chooser("Makefile") + result = chooser("Makefile") + if not os.path.exists(result): + result = chooser("include/Makefile") + return result def headers(): chooser = PathChooser("/etc/selinux/sepolgen.conf")