From 2765fde112341a274eb385385f29189fbb932859 Mon Sep 17 00:00:00 2001 From: brent s Date: Sat, 12 Nov 2016 16:44:26 -0500 Subject: [PATCH] checkin, plus new package- python-gitpython --- .gitmodules | 3 +++ _bin/new.package.py | 23 ++++++++++++++++++++--- python-gitpython | 1 + 3 files changed, 24 insertions(+), 3 deletions(-) create mode 160000 python-gitpython diff --git a/.gitmodules b/.gitmodules index 1c33440..1b036a6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -148,3 +148,6 @@ [submodule "python-menu3"] path = python-menu3 url = aur@aur.archlinux.org:python-menu3 +[submodule "python-gitpython"] + path = python-gitpython + url = aur@aur.archlinux.org:python-gitpython diff --git a/_bin/new.package.py b/_bin/new.package.py index 3462d11..e0dc072 100755 --- a/_bin/new.package.py +++ b/_bin/new.package.py @@ -2,9 +2,13 @@ import re import os +import shutil import subprocess -import pygit2 -import menu3 +import git # python-gitpython in AUR +import menu3 # python-menu3 in AUR +from tempfile import gettempdir + +import pprint ## SETTINGS ## gpgkey = '748231EBCBD808A14F5E85D28C004C2F93481F6B' # https://wiki.archlinux.org/index.php/PKGBUILD#validpgpkeys @@ -79,7 +83,20 @@ def gui_init(): pkg['conflicts'] = list(map(str, conflicts_raw.split())) return(pkg) -import pprint +## MAKE SURE SOME PREREQS HAPPEN ## +def sanity_checks(pkg): + try: + os.makedirs(pkgbuild_dir) + except OSError as exception: + if exception.errno != errno.EEXIST: + raise + +def aur_create(pkg): + tmpcheckout = os.path.join(gettempdir(), '.aur_pkgs.{}'.format(pkg['name'])) + pygit2.clone_repository('aur@aur.archlinux.org:' + pkg['name'], tmpcheckout, bare=False, repository=None, remote=None, checkout_branch=None, callbacks=None) + shutil.copy2(aur_pkgs_dir + "/_docs/PKGBUILD.templates.d/gitignore", tmpcheckout + "/.gitignore") + + pprint.pprint(gui_init()) diff --git a/python-gitpython b/python-gitpython new file mode 160000 index 0000000..0b75644 --- /dev/null +++ b/python-gitpython @@ -0,0 +1 @@ +Subproject commit 0b756440a8600ac3026de2e84e0039ef565c8ff6