Added update and upgrade commands

This commit is contained in:
Jake Howard 2016-02-07 16:39:18 +00:00
parent d8c05814df
commit 55015a1e66

19
wscript
View file

@ -1,18 +1,24 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import json, os import json, os, shutil
DIR = os.getcwd() DIR = os.getcwd()
def update_and_upgrade(ctx):
os.system('apt-get update -y')
os.system('apt-get upgrade -y')
os.system('apt-get dist-upgrade -y')
def apt_install_core(ctx): def apt_install_core(ctx):
packages = json.load(open(DIR + '/apt/apt-installs-core.json')) packages = json.load(open(DIR + '/apt/apt-installs-core.json'))
for package in packages: for package in packages:
print("apt-get install {} -y".format(package)) os.system("apt-get install {} -y".format(package))
def add_apt_keys(ctx): def add_apt_keys(ctx):
keys = json.load(open(DIR + '/apt/apt-keys.json')) keys = json.load(open(DIR + '/apt/apt-keys.json'))
for key in keys: for key in keys:
print("wget -O - {} | apt-key add -".format(key)) os.system("wget -O - {} | apt-key add -".format(key))
def add_apt_sources(ctx): def add_apt_sources(ctx):
@ -22,13 +28,13 @@ def add_apt_sources(ctx):
def add_apt_repos(ctx): def add_apt_repos(ctx):
repos = json.load(open(DIR + '/apt/apt-repos.json')) repos = json.load(open(DIR + '/apt/apt-repos.json'))
for repo in repos: for repo in repos:
print("add-apt-repository {} -y".format(repo)) os.system("add-apt-repository {} -y".format(repo))
def apt_install_extras(ctx): def apt_install_extras(ctx):
packages = json.load(open(DIR + '/apt/apt-installs-extra.json')) packages = json.load(open(DIR + '/apt/apt-installs-extra.json'))
for package in packages: for package in packages:
print("apt-get install {} -y".format(package)) os.system("apt-get install {} -y".format(package))
def install_atom(ctx): def install_atom(ctx):
FILENAME = "atom.deb" FILENAME = "atom.deb"
@ -42,6 +48,9 @@ def install_atom_packages(ctx):
os.system("apm install {}".format(packages)) os.system("apm install {}".format(packages))
def install_configs(ctx):
shutil.copyfile(DIR + "/config/terminator.conf", "~/.config/terminator/config")
if __name__ == '__main__': if __name__ == '__main__':
print("Please run this file using waf, not directly.") print("Please run this file using waf, not directly.")
exit(1) exit(1)