Created
September 8, 2015 03:13
-
-
Save tychoish/5ea563c7fe41ed31c463 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import os.path | |
from fabric.api import local, puts, cd | |
def _get_dirname(name): | |
return os.path.join(os.path.expanduser("~/abs"), name) | |
def git_package(name): | |
local("git clone https://aur.archlinux.org/{0}.git".format(name)) | |
def get_package(name): | |
dirname = _get_dirname(name) | |
if os.path.exists(os.path.join(dirname, "PKGBUILD")): | |
puts('package name {0} exists'.format(name)) | |
else: | |
if not os.path.isdir(dirname): | |
os.makedirs(dirname) | |
with cd(dirname): | |
local("curl -L 'https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h={0}' | tee {0}/PKGBUILD".format(name)) | |
def build_package(name): | |
get_package(name) | |
dirname = _get_dirname(name) | |
with cd(dirname): | |
local("makepkg -sfi") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment