Blame SOURCES/scap-security-guide-0.1.49-max-path-len-skip-logs.patch

05062e
From 840fb94f9b371f6555536de2c32953c967c1122a Mon Sep 17 00:00:00 2001
05062e
From: Watson Sato <wsato@redhat.com>
05062e
Date: Tue, 21 Jan 2020 14:17:00 +0100
05062e
Subject: [PATCH 1/2] Don't check for path len of logs directory
05062e
05062e
The logs are not part of the tarball, nor used to build the content.
05062e
---
05062e
 tests/ensure_paths_are_short.py | 4 ++++
05062e
 1 file changed, 4 insertions(+)
05062e
05062e
diff --git a/tests/ensure_paths_are_short.py b/tests/ensure_paths_are_short.py
05062e
index 5d4e27cb91..18d4c662ff 100755
05062e
--- a/tests/ensure_paths_are_short.py
05062e
+++ b/tests/ensure_paths_are_short.py
05062e
@@ -13,6 +13,10 @@ def main():
05062e
     ssg_root = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
05062e
     max_path = ""
05062e
     for dir_, _, files in os.walk(ssg_root):
05062e
+        # Don't check for path len of log files
05062e
+        # They are not shipped nor used during build
05062e
+        if "tests/logs/" in dir_:
05062e
+            continue
05062e
         for file_ in files:
05062e
             path = os.path.relpath(os.path.join(dir_, file_), ssg_root)
05062e
             if len(path) > len(max_path):
05062e
05062e
From 8d29c78efc51cc2c2da0e436b3cd9a2edb5342bc Mon Sep 17 00:00:00 2001
05062e
From: Watson Sato <wsato@redhat.com>
05062e
Date: Tue, 21 Jan 2020 15:05:17 +0100
05062e
Subject: [PATCH 2/2] Skip only only tests/logs/ from project root
05062e
05062e
---
05062e
 tests/ensure_paths_are_short.py | 3 ++-
05062e
 1 file changed, 2 insertions(+), 1 deletion(-)
05062e
05062e
diff --git a/tests/ensure_paths_are_short.py b/tests/ensure_paths_are_short.py
05062e
index 18d4c662ff..b9e985fea0 100755
05062e
--- a/tests/ensure_paths_are_short.py
05062e
+++ b/tests/ensure_paths_are_short.py
05062e
@@ -15,7 +15,8 @@ def main():
05062e
     for dir_, _, files in os.walk(ssg_root):
05062e
         # Don't check for path len of log files
05062e
         # They are not shipped nor used during build
05062e
-        if "tests/logs/" in dir_:
05062e
+        current_relative_path = os.path.relpath(dir_, ssg_root)
05062e
+        if current_relative_path.startswith("tests/logs/"):
05062e
             continue
05062e
         for file_ in files:
05062e
             path = os.path.relpath(os.path.join(dir_, file_), ssg_root)