Example #1
0
#!/usr/bin/env python
# encoding: utf-8

import argparse
import subprocess

from install import GitRepository, apt

if __name__ == "__main__":
    parser = argparse.ArgumentParser(
        description="""
    Clone libgit2, configure, build, and install.
    """,
        formatter_class=argparse.RawDescriptionHelpFormatter,
    )
    args = parser.parse_args()

    apt(["cmake"])

    with GitRepository("libgit2/libgit2") as repo:
        subprocess.call("cmake .".split())
        subprocess.call("cmake --build .".split())
        subprocess.call("sudo cmake --build . --target install".split())
Example #2
0
cabal_packages = ["xmonad", "xmonad-contrib"]

pacman_packages = ["xmonad", "xmonad-contrib", "xorg-xmessage"]


if __name__ == "__main__":
    if os.getuid() != 0:
        sys.exit("This script needs to be run as root.")

    print("Xmonad install script.")
    print("")

    if platform.linux_distribution()[0] == "arch":
        install.pacman(pacman_packages)
    else:
        install.apt(apt_packages)
        print("")
        install.cabal(cabal_packages)
    print("")

    print("Creating symlinks...")
    print("")
    for fs, fd, d in files:
        basename = os.path.basename(fs)
        src = os.path.join("/home/sergey/.mcf/.xmonad", fs)
        dest = os.path.join(fd, basename) if basename else fd
        install.link(src, dest, d)
    print("")

    print("Installation ALMOST completed.")
    print("You will need to install xmonad panel manually:")