rb_installer scripts in progress

Review Request #2460 — Created July 10, 2011 and discarded — Latest diff uploaded

Information

Review Board

Reviewers

The Linux Installer are the older version, The newer version will be posted.
Windows installer are only for the 64bit version OS, but they work with 32bits as well.
Testing was done on 64bit machines.
INSTALLER/rb-install.py
New File
1
#!/usr/local/bin/python
2 1
import commands
3
import time
4
import sys
5
import os
6
import platform
7 1
from subprocess import call
8

   
9 1
apt_platforms = ["Ubuntu","Debian"]
10
yum_platforms = ["Fedora","RedHat Enterprise","Fedora","CentOS"]
11

   
12
PossibleApplications = ["PostgreSQL","MySQL","SQLite","Apache","Memcached","Patch","CVS","GIT","Mercurial","Perforce","Subversion","PyLucene","Amazons3storage","Nose","Pycrypto","Sphinx"]
13

   
14 1
InstallOrGuide=""
15

   
16
positivelist = ["Yes", "yes", "Y", "y"]
17
negativelist = ["No", "no", "N", "n"]
18

   
19 1
OperatingSystem=platform.uname()[0]
20
Version=platform.uname()[2]
21
Arch=platform.uname()[4]
22

   
23
def ListOfApplications():
24
    for Application in PossibleApplications:
25
        print Application
26

   
27

   
28

   
29 1
if OperatingSystem == "Linux":
30
    SystemInfo = platform.linux_distribution()
31
    Platform = SystemInfo[0]
32
    if Platform in apt_platforms:
33
        kind = "Standards"
34 1
#ADD YAM KIND HERE
35

   
36
elif OperatingSystem =="Windows":
37
    if(Arch == "AMD64"):
38
        kind="X64"
39
    else:
40
        kind="X86"
41

   
42

   
43
if len(sys.argv)==1:
44
    empty=raw_input("You need to choose an application to install.(ex: Practice Mysql) for a list of all dependencies press L: \n")
45
    if empty in ["L", "l"]:
46
        ListOfApplications()
47
        sys.exit()
48
else:
49
    if sys.argv[1] not in PossibleApplications:
50
        print "The application does not exist! This is the list of applications supported:"
51
        ListOfApplications()
52
        sys.exit()
53
    else:
54
        ApplicationName=sys.argv[1]
55
        filename = ("%s.%s.%s" % (OperatingSystem,kind,ApplicationName))
56
        Ins=raw_input("Would you like us to install " + ApplicationName  + " for you?(Yes,No)")
57
        if Ins in negativelist:
58
            InstallOrGuide="guide"
59
        elif Ins in positivelist:
60
            if(OperatingSystem=="Linux"):
61
                if(os.getuid() == 0):
62
                    InstallOrGuide="install"
63
                else:
64
                    print "You need to run this application as an administrator in order to install " + ApplicationName
65
                    sys.exit()
66
            else:
67
                InstallOrGuide="install"
68
        else:
69
            print "Please select one of the two"
70
            sys.exit(1)
71

   
72
        responsible_module = __import__(filename, fromlist=[filename])
73
        responsible_function = getattr(responsible_module, InstallOrGuide)
74
        responsible_function()
INSTALLER/Linux/Standards/Amazons3storage.py
INSTALLER/Linux/Standards/CVS.py
INSTALLER/Linux/Standards/GIT.py
INSTALLER/Linux/Standards/Memcached.py
INSTALLER/Linux/Standards/Mercurial.py
INSTALLER/Linux/Standards/MySQL.py
INSTALLER/Linux/Standards/Nose.py
INSTALLER/Linux/Standards/Patch.py
INSTALLER/Linux/Standards/Perforce.py
INSTALLER/Linux/Standards/PostgreSQL.py
INSTALLER/Linux/Standards/PyLucene.py
INSTALLER/Linux/Standards/SQLite.py
INSTALLER/Linux/Standards/Sphinx.py
INSTALLER/Linux/Standards/Subversion.py
INSTALLER/Linux/Yums/Amazons3storage.py
INSTALLER/Linux/Yums/CVS.py
INSTALLER/Linux/Yums/GIT.py
INSTALLER/Linux/Yums/Memcached.py
INSTALLER/Linux/Yums/Mercurial.py
This diff has been split across 6 pages: 1 2 3 4 5 6 >
Loading...