From fe6f5f2f453804dc3559a0c46c27634bb79fa54c Mon Sep 17 00:00:00 2001 From: brent s Date: Sun, 13 Nov 2016 18:44:59 -0500 Subject: [PATCH] adding changes- adding a new package functionality is done but entirely untested. still missing __main__ --- _bin/new_package.py | 18 +++++++++++++++++- .../pre-commit.hook.sh | 7 +++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100755 _docs/PKGBUILD.templates.d.python/pre-commit.hook.sh diff --git a/_bin/new_package.py b/_bin/new_package.py index d9e0a6b..2a25367 100755 --- a/_bin/new_package.py +++ b/_bin/new_package.py @@ -47,7 +47,10 @@ def gui_init(): "Bazaar (bzr)"] vcs_menu = m.menu("What type of VCS system?", vcs_options, "VCS type ('q' to quit):") pkg['name'] = input("\nWhat is the name of your package? (Exclude the '-git' etc. suffix, that will be added automatically later on)\n").lower() - srcurl = input("\nWhat is the checkout URL for {0}?\n(Do not include the directory or VCS type prefix as per\nhttps://wiki.archlinux.org/index.php/VCS_package_guidelines#VCS_sources ...\nit will be added automatically)\n".format(pkg['name'])) + srcurl = input("\nWhat is the checkout URL for {0}?\n" + + "(Do not include the directory or VCS type prefix as per\n" + + "https://wiki.archlinux.org/index.php/VCS_package_guidelines#VCS_sources ...\n" + + "it will be added automatically)\n".format(pkg['name'])) pkg['vcstype'] = ["git", "svn", "hg", @@ -181,6 +184,19 @@ def aur_create(pkg): ## ADD THE SUBMODULE TO THE MAIN AUR TREE ## def aur_submodule(pkg): + aur_pkgs_repo = git.Repo(aur_pkgs_dir) + aur_pkgs_repo.create_submodule(pkg['name'],aur_pkgs_dir + '/' + pkg['name'],url='aur@aur.archlinux.org:' + pkg['name']) + aur_pkgs_repo.index.commit("adding {0}".format(pkg['name'])) + # Comment me out if you don't have access to upstream: + aur_pkgs_repo.push() + # And don't forget to add the hook to make life easier for us in the future. + # WARNING: HERE BE POSSIBLE RACE CONDITIONS + mod_gitdir = aur_pkgs_repo.submodules[-1].module().git_dir + if not aur_pkgs_repo.submodules[-1].module().git_dir.endswith(pkg['name']): + exit('SOMETHING FUCKED UP BADLY. Do not run this thing in parallel.') + else: + pass + shutil.copy2(aur_pkgs_dir + '/_docs/PKGBUILD.templates.d.python/pre-commit.hook.sh', mod_gitdir + '/hooks/pre-commit', follow_symlinks = True) print() #pprint.pprint(gui_init()) diff --git a/_docs/PKGBUILD.templates.d.python/pre-commit.hook.sh b/_docs/PKGBUILD.templates.d.python/pre-commit.hook.sh new file mode 100755 index 0000000..5320b30 --- /dev/null +++ b/_docs/PKGBUILD.templates.d.python/pre-commit.hook.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +#!/bin/bash + +/usr/bin/mksrcinfo + +git add .SRCINFO