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

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