From d9cd15f6487983546faa6ddaa78b4afbd610ecb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Bar=C4=87?= Date: Sat, 19 Dec 2020 13:28:47 +0100 Subject: [PATCH] src: add commit-ebuild, new-ebuild and update-submodules --- src/commit-ebuild | 26 ++++++++++++++++++++ src/new-ebuild | 56 +++++++++++++++++++++++++++++++++++++++++++ src/update-submodules | 13 ++++++++++ 3 files changed, 95 insertions(+) create mode 100755 src/commit-ebuild create mode 100755 src/new-ebuild create mode 100755 src/update-submodules diff --git a/src/commit-ebuild b/src/commit-ebuild new file mode 100755 index 0000000..2230285 --- /dev/null +++ b/src/commit-ebuild @@ -0,0 +1,26 @@ +#!/bin/sh + + +trap 'exit 128' INT +set -e +export PATH + + +pdir="$(git rev-parse --show-prefix)" + + +FEATURES="sign" +export FEATURES + + +git add . + +if [ -z "${1}" ] +then + repoman commit +else + repoman commit -m "${pdir%/}: ${*}" +fi + +git pull --verbose +git push --verbose diff --git a/src/new-ebuild b/src/new-ebuild new file mode 100755 index 0000000..62b4190 --- /dev/null +++ b/src/new-ebuild @@ -0,0 +1,56 @@ +#!/bin/sh + + +# shellcheck disable=2016 + + +trap 'exit 128' INT +export PATH + + +ebuild_template='# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DESCRIPTION="" +HOMEPAGE="" + +if [[ "\${PV}" == *9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="" +else + SRC_URI="" + KEYWORDS="~amd64" +fi + +RESTRICT=" + mirror + !test? ( test ) +" +LICENSE="" +SLOT="0" +IUSE="test" + +BDEPEND="" +DEPEND="" +RDEPEND=""' + +metadata_template=' + + +' + + +if [ -f ../../profiles/repo_name ] +then + echo "${ebuild_template}" >> "$(basename "$(pwd)")-9999.ebuild" + echo "${metadata_template}" >> "metadata.xml" +else + echo "Are you in a overlay repo?" + echo "To use this script successfully:" + echo "- create a \${CATEGOTY}/\${PN} directory" + echo "- cd into it" + echo "- execute ${0}" + exit 1 +fi diff --git a/src/update-submodules b/src/update-submodules new file mode 100755 index 0000000..e789dcf --- /dev/null +++ b/src/update-submodules @@ -0,0 +1,13 @@ +#!/bin/sh + + +trap 'exit 128' INT +export PATH + + +git submodule update --init --recursive +git submodule update --remote --merge +git add . +git commit -m "submodules update" +git pull --verbose +git push --verbose