From patchwork Tue Nov 7 14:49:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 835291 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BqESqWii"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yWXPx2vT7z9s7c for ; Wed, 8 Nov 2017 01:49:25 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id ABF8688330; Tue, 7 Nov 2017 14:49:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0ypT6YeX53RE; Tue, 7 Nov 2017 14:49:22 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 326A9884E9; Tue, 7 Nov 2017 14:49:22 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 6F03C1C0679 for ; Tue, 7 Nov 2017 14:49:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 685D9884E9 for ; Tue, 7 Nov 2017 14:49:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6UN5L-7W0kLG for ; Tue, 7 Nov 2017 14:49:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-yw0-f176.google.com (mail-yw0-f176.google.com [209.85.161.176]) by whitealder.osuosl.org (Postfix) with ESMTPS id 9D39888330 for ; Tue, 7 Nov 2017 14:49:19 +0000 (UTC) Received: by mail-yw0-f176.google.com with SMTP id q126so11044859ywq.10 for ; Tue, 07 Nov 2017 06:49:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=U4XtuZICHoixrHNwEkiJ+N20PMFmln71q72ykRs/8Xk=; b=BqESqWiiYOoC844Juw8C/HQKINabdexVqhO3DuwrUa1H74QawkBrbKs2LWMoKDHO6X aJE08qx0ikFpAFei42l8z07va4EV7qui3pSY/F+dyzVr7EslRQwmLzdCoK689vRy8rhc dicLzNXlOyvQ83TjinnOqBjs9pyyWYPFGZIbECT848eCcDxrJgY918bHIfgyKGSPffcs ZC9PRICnSKUYlINkpt2GNfG+kTCVRxrNeBKX+pzHXx55q2wxW4hxFuYSvF7tsoQ0kMd3 tzPNr7gSR8hrj9mdyMBxfnYI9V2uEZDg/QjQVdBlKUz1N5MuUz0ClW7lDbo2fGQ3bj5C PxGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=U4XtuZICHoixrHNwEkiJ+N20PMFmln71q72ykRs/8Xk=; b=K57zNpNBHSAgz42d6pPyrK3K3HSDCw3sC3A7ZhGCCC2N0DLbZF2EzTgV7ihk9FAS6h Obq4/WQeECNjCOjTI6i5oETbGceopaD4O3fWc/qomwndC6TcvCBEO7buuWq+f3gpRVwd 9HKnn4u/BJofKW6i0e2sH7PWBHctye/cS2+Oq34JfscukufKDEb6q2Mdnc+Vu7f8kOEk kYm2+iE7Re6SOq+Kbv7OMP8gR2tk/3gUMaUZE2ahkKsTt3D2AcISYoIlbGLhpcg5b73t j+Nsaq9dctUIk3ydJf0oPED5YzX7hijyNdQptEczVOn3zYSSY8uOfJ7vtcPiJRfwgKGe wU4Q== X-Gm-Message-State: AMCzsaVJVD5IxXgEzW8bvErJwaRlNfa8xQU2XD7HXGgt+yo/6/aMLM8B aLDUttS8XpmIlem24sY0lhXhICBz X-Google-Smtp-Source: ABhQp+S4GCcESStAUoJmit2/GZzgADKbuX1WHaJ8dZlRpECT6yd+Ct4aT7YMj/RbjDPsz5dAlFCmzg== X-Received: by 10.37.45.25 with SMTP id t25mr11263876ybt.319.1510066158274; Tue, 07 Nov 2017 06:49:18 -0800 (PST) Received: from aduskett.duskett (2600-6c4a-767f-ff91-be5f-f4ff-feef-f9a2.dhcp6.chtrptr.net. [2600:6c4a:767f:ff91:be5f:f4ff:feef:f9a2]) by smtp.gmail.com with ESMTPSA id u134sm722105ywg.11.2017.11.07.06.49.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Nov 2017 06:49:17 -0800 (PST) From: Adam Duskett X-Google-Original-From: Adam Duskett To: buildroot@buildroot.org Date: Tue, 7 Nov 2017 09:49:15 -0500 Message-Id: <20171107144915.32423-1-Adamduskett@outlook.com> X-Mailer: git-send-email 2.13.6 Subject: [Buildroot] [PATCH v3 1/1] refpolicy: bump to 2.20170805 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Adam Duskett MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" In addition to a simple bump, the following extra changes have occured: - Change the refpolicy site to the official release URL. - Remove REFPOLICY_SITE_METHOD and REFPOLICY_GIT_SUBMODULES as the contrib submodule is included in the release tarball. - Refpolicy is now compatible with python3, as such, remove host-python. from the dependencies and add a check for python3 or python in it's place. - Add upstreamed 0001-fix-regex-escape-sequence-error.patch to fix building against python3.6. - Add sha256 license hash to hash file. Signed-off-by: Adam Duskett Tested-by: Matt Weber --- Changes v1 -> v2: - removed REFPOLICY_PYTHON variable from refpolicy.mk (Thomas) Changes v2 -> v3: - Removed PYTHON= from REFPOLICY_MAKE, as it's no longer needed. .../0001-fix-regex-escape-sequence-error.patch | 59 ++++++++++++++++++++++ package/refpolicy/refpolicy.hash | 7 ++- package/refpolicy/refpolicy.mk | 17 ++++--- 3 files changed, 73 insertions(+), 10 deletions(-) create mode 100644 package/refpolicy/0001-fix-regex-escape-sequence-error.patch diff --git a/package/refpolicy/0001-fix-regex-escape-sequence-error.patch b/package/refpolicy/0001-fix-regex-escape-sequence-error.patch new file mode 100644 index 0000000000..1aa01892d0 --- /dev/null +++ b/package/refpolicy/0001-fix-regex-escape-sequence-error.patch @@ -0,0 +1,59 @@ +From 6c9cc47e6cc9c6e67b1b822f7a1a2e1f6d836118 Mon Sep 17 00:00:00 2001 +From: Adam Duskett +Date: Tue, 10 Oct 2017 18:00:30 -0400 +Subject: [PATCH] fix regex escape sequence error. + +python3.6 will error out with the message "invalid escape sequence" +in genhomedircon.py. This patch fixes these errors by turning the string +in the into a raw string. + +Upstream status: accepted + +Signed-off-by: Adam Duskett +--- + support/genhomedircon.py | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/support/genhomedircon.py b/support/genhomedircon.py +index 036f5cc9..6662f412 100644 +--- a/support/genhomedircon.py ++++ b/support/genhomedircon.py +@@ -189,13 +189,13 @@ def oldgenhomedircon(filecontextdir, filecontext): + addme = 1 + for regex in prefix_regex: + #match a trailing (/*)? which is actually a bug in rpc_pipefs +- regex = re.sub("\(/\*\)\?$", "", regex) ++ regex = re.sub(r"\(/\*\)\?$", "", regex) + #match a trailing .+ +- regex = re.sub("\.+$", "", regex) ++ regex = re.sub(r"\.+$", "", regex) + #match a trailing .* +- regex = re.sub("\.\*$", "", regex) ++ regex = re.sub(r"\.\*$", "", regex) + #strip a (/.*)? which matches anything trailing to a /*$ which matches trailing /'s +- regex = re.sub("\(\/\.\*\)\?", "", regex) ++ regex = re.sub(r"\(\/\.\*\)\?", "", regex) + regex = regex + "/*$" + if re.search(regex, potential, 0): + addme = 0 +@@ -391,13 +391,13 @@ class selinuxConfig: + exists=1 + for regex in prefix_regex: + #match a trailing (/*)? which is actually a bug in rpc_pipefs +- regex = re.sub("\(/\*\)\?$", "", regex) ++ regex = re.sub(r"\(/\*\)\?$", "", regex) + #match a trailing .+ +- regex = re.sub("\.+$", "", regex) ++ regex = re.sub(r"\.+$", "", regex) + #match a trailing .* +- regex = re.sub("\.\*$", "", regex) ++ regex = re.sub(r"\.\*$", "", regex) + #strip a (/.*)? which matches anything trailing to a /*$ which matches trailing /'s +- regex = re.sub("\(\/\.\*\)\?", "", regex) ++ regex = re.sub(r"\(\/\.\*\)\?", "", regex) + regex = regex + "/*$" + if re.search(regex, home, 0): + exists = 0 +-- +2.13.6 + diff --git a/package/refpolicy/refpolicy.hash b/package/refpolicy/refpolicy.hash index 7aeac4113d..905ac88542 100644 --- a/package/refpolicy/refpolicy.hash +++ b/package/refpolicy/refpolicy.hash @@ -1,2 +1,5 @@ -#From https://github.com/TresysTechnology/refpolicy/wiki/DownloadRelease -sha256 08f9e2afc5e4939c23e56deeec7c47da029d7b85d82fb4ded01a36eb5da0651e refpolicy-RELEASE_2_20170204.tar.gz +# From https://github.com/TresysTechnology/refpolicy/wiki/DownloadRelease +sha256 045709f5e44199f402149b31c6aab9666bdb1540a5c5ed0312a46c90dedfa52d refpolicy-2.20170805.tar.bz2 + +# Locally computed +sha256 204d8eff92f95aac4df6c8122bc1505f468f3a901e5a4cc08940e0ede1938994 COPYING diff --git a/package/refpolicy/refpolicy.mk b/package/refpolicy/refpolicy.mk index 2da151f321..1e2180b2cb 100644 --- a/package/refpolicy/refpolicy.mk +++ b/package/refpolicy/refpolicy.mk @@ -4,12 +4,9 @@ # ################################################################################ -REFPOLICY_VERSION = RELEASE_2_20170204 - -# Do not use GitHub helper as git submodules are needed for refpolicy-contrib -REFPOLICY_SITE = https://github.com/TresysTechnology/refpolicy.git -REFPOLICY_SITE_METHOD = git -REFPOLICY_GIT_SUBMODULES = y # Required for refpolicy-contrib +REFPOLICY_VERSION = 2.20170805 +REFPOLICY_SOURCE = refpolicy-$(REFPOLICY_VERSION).tar.bz2 +REFPOLICY_SITE = https://raw.githubusercontent.com/wiki/TresysTechnology/refpolicy/files REFPOLICY_LICENSE = GPL-2.0 REFPOLICY_LICENSE_FILES = COPYING REFPOLICY_INSTALL_STAGING = YES @@ -19,13 +16,17 @@ REFPOLICY_DEPENDENCIES = \ host-policycoreutils \ host-setools \ host-gawk \ - host-python \ policycoreutils +ifeq ($(BR2_PACKAGE_PYTHON3),y) +REFPOLICY_DEPENDENCIES += host-python3 +else +REFPOLICY_DEPENDENCIES += host-python +endif + # Cannot use multiple threads to build the reference policy REFPOLICY_MAKE = \ TEST_TOOLCHAIN=$(HOST_DIR) \ - PYTHON="$(HOST_DIR)/bin/python2" \ $(TARGET_MAKE_ENV) \ $(MAKE1)