From 0a9f81674679b70f335a22b6849a5808e4408698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Bar=C4=87?= Date: Thu, 17 Sep 2020 00:36:41 +0200 Subject: [PATCH] eball: new script --- src/eball | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 src/eball diff --git a/src/eball b/src/eball new file mode 100755 index 0000000..d24743b --- /dev/null +++ b/src/eball @@ -0,0 +1,43 @@ +#!/bin/sh + + +trap 'exit 128' INT +export PATH + + +usage() { + cat << HELP +Usage: eball FILES +eball - test new ebuilds + +Original author: XGQT +Copyright (c) 2020, src_prepare group +Licensed under the ISC License +HELP +} + + +if [ -z "${1}" ] +then + usage + exit 1 +elif [ "${1}" = "-h" ] || [ "${1}" = "--help" ] +then + usage + exit 0 +fi + +for ebuild in "${@}" +do + # one may want this to be unprivileged + repoman manifest || ebuild "${ebuild}" manifest + + # we want this to be privileged on Gentoo systems + if [ "$(whoami)" != root ] && [ -z "${EPREFIX}" ] + then + echo "Switching to the root account" + sudo ebuild "${ebuild}" clean test merge + else + ebuild "${ebuild}" clean test merge + fi +done