Skip to content

Commit

Permalink
Upgrade cffi before install other pip dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
viyatb committed Dec 7, 2015
1 parent 7ac6d90 commit fb72333
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
36 changes: 20 additions & 16 deletions install/install.py
Expand Up @@ -112,27 +112,31 @@ def install(self, cmd_arguments):
print("Upgrading pip to the latest version ...")
# Upgrade pip before install required libraries
self.run_command("sudo pip2 install --upgrade pip")
# mitigate cffi errors by upgrading it first
self.run_command("sudo pip2 install --upgrade cffi")

if args.no_user_input:
fixsetuptools = 'n'
else:
# ask the user if they really want to delete the symlink
fixsetuptools = raw_input("Delete /usr/lib/python2.7/dist-packages/setuptools.egg-info? (y/n)\n(recommended, solves some issues in Kali 1.xx)")

if fixsetuptools == 'y':
# backup the original symlink
print("Backing up the original symlink...")
ts = time.time()
human_timestamp = datetime.fromtimestamp(ts).strftime('%Y-%m-%d-%H:%M:%S')
# check kali major release number 0.x, 1.x, 2.x
kali_version = os.popen("cat /etc/issue", "r").read().split(" ")[2][0]
if kali_version == '1':
if args.no_user_input:
fixsetuptools = 'n'
else:
# ask the user if they really want to delete the symlink
fixsetuptools = raw_input("Delete /usr/lib/python2.7/dist-packages/setuptools.egg-info? (y/n)\n(recommended, solves some issues in Kali 1.xx)")

# backup the original symlink
self.run_command("mv /usr/lib/python2.7/dist-packages/setuptools.egg-info /usr/lib/python2.7/dist-packages/setuptools.egg-info" + "-BACKUP-" + human_timestamp)
if fixsetuptools == 'y':
# backup the original symlink
print("Backing up the original symlink...")
ts = time.time()
human_timestamp = datetime.fromtimestamp(ts).strftime('%Y-%m-%d-%H:%M:%S')

print("The original symlink exists at /usr/lib/python2.7/dist-packages/setuptools.egg-info-BACKUP-" + human_timestamp)
# backup the original symlink
self.run_command("mv /usr/lib/python2.7/dist-packages/setuptools.egg-info /usr/lib/python2.7/dist-packages/setuptools.egg-info" + "-BACKUP-" + human_timestamp)

# Finally owtf python libraries installed using pip
self.install_using_pip(self.owtf_pip)
print("The original symlink exists at /usr/lib/python2.7/dist-packages/setuptools.egg-info-BACKUP-" + human_timestamp)

# Finally owtf python libraries installed using pip
self.install_using_pip(self.owtf_pip)
else:
print("Moving on with the installation but you were warned: there may be some errors!")
# Finally owtf python libraries installed using pip
Expand Down
1 change: 0 additions & 1 deletion install/owtf.pip
Expand Up @@ -4,7 +4,6 @@
# the latest version and add it here
# - The casing of names is critical for dependency checks, eg. pyOpenSSL and not pyopenssl
# required for cryptography package
cffi==1.3.1
beautifulsoup4==4.3.2
lxml==3.4.0
Markdown==2.5.1
Expand Down

0 comments on commit fb72333

Please sign in to comment.