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

Tree @ee9ae37 (Download .tar.gz)

cleanup-setup.patch @ee9ae37raw · history · blame

Description: Cleanup setup.py
 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
Author: Sophie Brun <[email protected]>
Last-Update: 2017-09-04
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/setup.py
+++ b/setup.py
@@ -37,15 +37,15 @@ NEW_VERSION = osrframework.__version__
 import osrframework.utils.configuration as configuration
 
 # Depending on the place in which the project is going to be upgraded
-try:
-    raise Exception('Trying to load the markdown manually!')
-    from pypandoc import convert
-    read_md = lambda f: convert(f, 'rst')
-except ImportError:
-    print("[!] pypandoc module not found, could not convert Markdown to RST")
-    read_md = lambda f: open(f, 'r').read()
-except Exception:
-    read_md = lambda f: open(f, 'r').read()
+#try:
+#    raise Exception('Trying to load the markdown manually!')
+#    from pypandoc import convert
+#    read_md = lambda f: convert(f, 'rst')
+#except ImportError:
+#    print("[!] pypandoc module not found, could not convert Markdown to RST")
+#    read_md = lambda f: open(f, 'r').read()
+#except Exception:
+#    read_md = lambda f: open(f, 'r').read()
 
 # Reading the .md file
 try:
@@ -149,49 +149,49 @@ setup(
 ############################
 ### Creating other files ###
 ############################
-print("[*] Changing permissions of the user folders...")
-try:
-    configuration.changePermissionsRecursively(paths["appPath"], int(os.getenv('SUDO_UID')), int(os.getenv('SUDO_GID')))
-except:
+#print("[*] Changing permissions of the user folders...")
+#try:
+#    configuration.changePermissionsRecursively(paths["appPath"], int(os.getenv('SUDO_UID')), int(os.getenv('SUDO_GID')))
+#except:
     # Something happened with the permissions... We omit this.
-    pass
+#    pass
 
-print("[*] Copying relevant files...")
-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"),
-    ],
-    paths["appPathPatterns"] : [
-        os.path.join("config", "plugins", "pattern.py.sample"),
-    ]
-}
+#print("[*] Copying relevant files...")
+#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"),
+#    ],
+#    paths["appPathPatterns"] : [
+#        os.path.join("config", "plugins", "pattern.py.sample"),
+#    ]
+#}
 
 # Iterating through all destinations to write the info
-for destiny in files_to_copy.keys():
-    # Grabbing each source file to be moved
-    for sourceFile in files_to_copy[destiny]:
-        fileToMove = os.path.join(HERE,sourceFile)
-
-        cmd = ""
-        # Choosing the command depending on the SO
-        if sys.platform == 'win32':
-            if os.path.isdir(fileToMove):
-                cmd = "echo d | xcopy \"" + fileToMove + "\" \"" + destiny + "\" /s /e"
-            else:
-                cmd = "copy \"" + fileToMove + "\" \"" + destiny + "\""
-        elif sys.platform == 'linux2' or sys.platform == 'darwin':
-            if not os.geteuid() == 0:
-                cmd = "cp -r -- \"" + fileToMove + "\" \"" + destiny + "\""
-            else:
-                cmd = "sudo cp -r -- \"" + fileToMove + "\" \"" + destiny + "\""
-        output = os.popen(cmd).read()
+#for destiny in files_to_copy.keys():
+#    # Grabbing each source file to be moved
+#    for sourceFile in files_to_copy[destiny]:
+#        fileToMove = os.path.join(HERE,sourceFile)
+#
+#        cmd = ""
+#        # Choosing the command depending on the SO
+#        if sys.platform == 'win32':
+#            if os.path.isdir(fileToMove):
+#                cmd = "echo d | xcopy \"" + fileToMove + "\" \"" + destiny + "\" /s /e"
+#            else:
+#                cmd = "copy \"" + fileToMove + "\" \"" + destiny + "\""
+#        elif sys.platform == 'linux2' or sys.platform == 'darwin':
+#            if not os.geteuid() == 0:
+#                cmd = "cp -r -- \"" + fileToMove + "\" \"" + destiny + "\""
+#            else:
+#                cmd = "sudo cp -r -- \"" + fileToMove + "\" \"" + destiny + "\""
+#        output = os.popen(cmd).read()