Blame SOURCES/1002-Do-not-export-use-setools.InfoFlowAnalysis-and-setoo.patch

6e0e92
From b960869bcbcb58f2ce9af598484f209935c096b0 Mon Sep 17 00:00:00 2001
6e0e92
From: Vit Mojzis <vmojzis@redhat.com>
6e0e92
Date: Fri, 26 Apr 2019 15:27:25 +0200
6e0e92
Subject: [PATCH 3/3] Do not export/use setools.InfoFlowAnalysis and
44fb84
 setools.DomainTransitionAnalysis
44fb84
44fb84
dta and infoflow modules require networkx which brings lot of dependencies.
44fb84
These dependencies are not necessary for setools module itself as it's
44fb84
used in policycoreutils.
44fb84
44fb84
Therefore it's better to use setools.infoflow.InfoFlowAnalysis and
44fb84
setools.dta.DomainTransitionAnalysis and let the package containing
44fb84
sedta and seinfoflow to require python3-networkx
44fb84
---
44fb84
 sedta                       | 4 ++--
44fb84
 seinfoflow                  | 4 ++--
6e0e92
 setools/__init__.py         | 4 ----
44fb84
 setoolsgui/apol/dta.py      | 2 +-
44fb84
 setoolsgui/apol/infoflow.py | 2 +-
44fb84
 tests/dta.py                | 2 +-
44fb84
 tests/infoflow.py           | 2 +-
6e0e92
 7 files changed, 8 insertions(+), 12 deletions(-)
44fb84
44fb84
diff --git a/sedta b/sedta
6e0e92
index 60861ca..41e38a2 100755
44fb84
--- a/sedta
44fb84
+++ b/sedta
6e0e92
@@ -22,7 +22,7 @@ import argparse
44fb84
 import logging
6e0e92
 import signal
44fb84
 
44fb84
-import setools
44fb84
+import setools.dta
44fb84
 
44fb84
 
44fb84
 def print_transition(trans):
6e0e92
@@ -114,7 +114,7 @@ else:
44fb84
 
44fb84
 try:
44fb84
     p = setools.SELinuxPolicy(args.policy)
44fb84
-    g = setools.DomainTransitionAnalysis(p, reverse=args.reverse, exclude=args.exclude)
44fb84
+    g = setools.dta.DomainTransitionAnalysis(p, reverse=args.reverse, exclude=args.exclude)
44fb84
 
44fb84
     if args.shortest_path or args.all_paths:
44fb84
         if args.shortest_path:
44fb84
diff --git a/seinfoflow b/seinfoflow
6e0e92
index 97b14ba..e7f965d 100755
44fb84
--- a/seinfoflow
44fb84
+++ b/seinfoflow
44fb84
@@ -17,7 +17,7 @@
44fb84
 # along with SETools.  If not, see <http://www.gnu.org/licenses/>.
44fb84
 #
44fb84
 
44fb84
-import setools
44fb84
+import setools.infoflow
44fb84
 import argparse
44fb84
 import sys
44fb84
 import logging
6e0e92
@@ -81,7 +81,7 @@ else:
44fb84
 try:
44fb84
     p = setools.SELinuxPolicy(args.policy)
44fb84
     m = setools.PermissionMap(args.map)
44fb84
-    g = setools.InfoFlowAnalysis(p, m, min_weight=args.min_weight, exclude=args.exclude)
44fb84
+    g = setools.infoflow.InfoFlowAnalysis(p, m, min_weight=args.min_weight, exclude=args.exclude)
44fb84
 
44fb84
     if args.shortest_path or args.all_paths:
44fb84
         if args.shortest_path:
44fb84
diff --git a/setools/__init__.py b/setools/__init__.py
6e0e92
index 7b70f5e..5a5f7fe 100644
44fb84
--- a/setools/__init__.py
44fb84
+++ b/setools/__init__.py
6e0e92
@@ -73,12 +73,8 @@ from .pcideviceconquery import PcideviceconQuery
44fb84
 from .devicetreeconquery import DevicetreeconQuery
44fb84
 
44fb84
 # Information Flow Analysis
44fb84
-from .infoflow import InfoFlowAnalysis
44fb84
 from .permmap import PermissionMap
44fb84
 
6e0e92
-# Domain Transition Analysis
44fb84
-from .dta import DomainTransitionAnalysis
6e0e92
-
44fb84
 # Policy difference
44fb84
 from .diff import PolicyDifference
6e0e92
 
44fb84
diff --git a/setoolsgui/apol/dta.py b/setoolsgui/apol/dta.py
44fb84
index 4608b9d..2cde44c 100644
44fb84
--- a/setoolsgui/apol/dta.py
44fb84
+++ b/setoolsgui/apol/dta.py
44fb84
@@ -23,7 +23,7 @@ from PyQt5.QtCore import pyqtSignal, Qt, QStringListModel, QThread
44fb84
 from PyQt5.QtGui import QPalette, QTextCursor
44fb84
 from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog, \
44fb84
     QTreeWidgetItem
44fb84
-from setools import DomainTransitionAnalysis
44fb84
+from setools.dta import DomainTransitionAnalysis
44fb84
 
44fb84
 from ..logtosignal import LogHandlerToSignal
44fb84
 from .analysistab import AnalysisTab
44fb84
diff --git a/setoolsgui/apol/infoflow.py b/setoolsgui/apol/infoflow.py
44fb84
index 7bca299..7fee277 100644
44fb84
--- a/setoolsgui/apol/infoflow.py
44fb84
+++ b/setoolsgui/apol/infoflow.py
44fb84
@@ -26,7 +26,7 @@ from PyQt5.QtCore import pyqtSignal, Qt, QStringListModel, QThread
44fb84
 from PyQt5.QtGui import QPalette, QTextCursor
44fb84
 from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog, \
44fb84
     QTreeWidgetItem
44fb84
-from setools import InfoFlowAnalysis
44fb84
+from setools.infoflow import InfoFlowAnalysis
44fb84
 from setools.exception import UnmappedClass, UnmappedPermission
44fb84
 
44fb84
 from ..logtosignal import LogHandlerToSignal
44fb84
diff --git a/tests/dta.py b/tests/dta.py
44fb84
index a0cc938..177e6fb 100644
44fb84
--- a/tests/dta.py
44fb84
+++ b/tests/dta.py
44fb84
@@ -18,7 +18,7 @@
44fb84
 import os
44fb84
 import unittest
44fb84
 
44fb84
-from setools import DomainTransitionAnalysis
44fb84
+from setools.dta import DomainTransitionAnalysis
44fb84
 from setools import TERuletype as TERT
44fb84
 from setools.exception import InvalidType
44fb84
 from setools.policyrep import Type
44fb84
diff --git a/tests/infoflow.py b/tests/infoflow.py
44fb84
index aa0e44a..fca2848 100644
44fb84
--- a/tests/infoflow.py
44fb84
+++ b/tests/infoflow.py
44fb84
@@ -18,7 +18,7 @@
44fb84
 import os
44fb84
 import unittest
44fb84
 
44fb84
-from setools import InfoFlowAnalysis
44fb84
+from setools.infoflow import InfoFlowAnalysis
44fb84
 from setools import TERuletype as TERT
44fb84
 from setools.exception import InvalidType
44fb84
 from setools.permmap import PermissionMap
44fb84
-- 
6e0e92
2.17.2
44fb84