Codebase list osrframework / aa2a4db debian / patches / cleanup-setup.patch
aa2a4db

Tree @aa2a4db (Download .tar.gz)

cleanup-setup.patch @aa2a4dbraw · history · blame

From: Sophie Brun <[email protected]>
Date: Thu, 23 Jan 2020 10:21:00 +0100
Subject: Cleanup setup.py

Last-Update: 2017-09-04

The setup.py makes changes that should not be done in a setup:
  - change the bin path: there is no need for Kali
  - install config files is the home user directory: should be done at
    first launch
  - configure maltego: should be done at first launch
Last-Update: 2017-09-04
---
 setup.py | 90 ++++++++++++++++++++++++++++++++--------------------------------
 1 file changed, 45 insertions(+), 45 deletions(-)

diff --git a/setup.py b/setup.py
index 0f05c1c..8ed4965 100644
--- a/setup.py
+++ b/setup.py
@@ -113,52 +113,52 @@ setup(
 ############################
 ### Creating other files ###
 ############################
-print("[*] OSRFramework > Changing permissions of the user folders...")
-try:
-    configuration.change_permissions_recursively(paths["appPath"], int(os.getenv('SUDO_UID')), int(os.getenv('SUDO_GID')))
-except:
+#print("[*] OSRFramework > Changing permissions of the user folders...")
+#try:
+#    configuration.change_permissions_recursively(paths["appPath"], int(os.getenv('SUDO_UID')), int(os.getenv('SUDO_GID')))
+#except:
     # Something happened with the permissions... We omit this.
-    pass
-
-print("[*] OSRFramework > Population OSRFramework's configuration folder...")
-files_to_copy= {
-    paths["appPath"] : [
-        os.path.join("config", "browser.cfg"),
-        os.path.join("config", "general.cfg"),
-    ],
-    paths["appPathDefaults"] : [
-        os.path.join("config", "accounts.cfg"),
-        os.path.join("config", "api_keys.cfg"),
-        os.path.join("config", "browser.cfg"),
-        os.path.join("config", "general.cfg"),
-    ],
-    paths["appPathWrappers"] : [
-        os.path.join("config", "plugins", "wrapper.py.sample"),
-        os.path.join("config", "plugins", "wrapper_v2.py.sample"),
-    ]
-}
+#    pass
+
+#print("[*] OSRFramework > Population OSRFramework's configuration folder...")
+#files_to_copy= {
+#    paths["appPath"] : [
+#        os.path.join("config", "browser.cfg"),
+#        os.path.join("config", "general.cfg"),
+#    ],
+#    paths["appPathDefaults"] : [
+#        os.path.join("config", "accounts.cfg"),
+#        os.path.join("config", "api_keys.cfg"),
+#        os.path.join("config", "browser.cfg"),
+#        os.path.join("config", "general.cfg"),
+#    ],
+#    paths["appPathWrappers"] : [
+#        os.path.join("config", "plugins", "wrapper.py.sample"),
+#        os.path.join("config", "plugins", "wrapper_v2.py.sample"),
+#    ]
+#}
 
 # Iterating through all destinations to write the info
-for destiny in files_to_copy.keys():
+#for destiny in files_to_copy.keys():
     # Grabbing each source file to be moved
-    for source_file in files_to_copy[destiny]:
-        file_to_move = os.path.join(HERE, source_file)
-        cmd = ""
-        # Choosing the command depending on the SO
-        if sys.platform == 'win32':
-            if os.path.isdir(file_to_move):
-                cmd = "echo d | xcopy \"" + file_to_move + "\" \"" + destiny + "\" /s /e"
-            else:
-                cmd = "copy \"" + file_to_move + "\" \"" + destiny + "\""
-        elif sys.platform == 'linux' or sys.platform == 'darwin':
-            if not os.geteuid() == 0:
-                cmd = "cp -r -- \"" + file_to_move + "\" \"" + destiny + "\""
-            else:
-                cmd = "sudo cp -r -- \"" + file_to_move + "\" \"" + destiny + "\""
-        else:
-            print("File '{file_to_move}' could not be copied in a {sys.platform.title()} system.")
-            continue
-        print(f"\t> {cmd}")
-        output = os.popen(cmd).read()
-
-print("[*] OSRFramework > Installation ended. If you don't know where to start, run `osrf` to start working on it.")
+#    for source_file in files_to_copy[destiny]:
+#        file_to_move = os.path.join(HERE, source_file)
+#        cmd = ""
+#        # Choosing the command depending on the SO
+#        if sys.platform == 'win32':
+#            if os.path.isdir(file_to_move):
+#                cmd = "echo d | xcopy \"" + file_to_move + "\" \"" + destiny + "\" /s /e"
+#            else:
+#                cmd = "copy \"" + file_to_move + "\" \"" + destiny + "\""
+#        elif sys.platform == 'linux' or sys.platform == 'darwin':
+#            if not os.geteuid() == 0:
+#                cmd = "cp -r -- \"" + file_to_move + "\" \"" + destiny + "\""
+#            else:
+#                cmd = "sudo cp -r -- \"" + file_to_move + "\" \"" + destiny + "\""
+#        else:
+#            print("File '{file_to_move}' could not be copied in a {sys.platform.title()} system.")
+#            continue
+#        print(f"\t> {cmd}")
+#        output = os.popen(cmd).read()
+#
+#print("[*] OSRFramework > Installation ended. If you don't know where to start, run `osrf` to start working on it.")