From e1973e30555e904b22651840a313abc3d9aa497b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Bar=C4=87?= Date: Sat, 3 Jul 2021 16:19:06 +0200 Subject: [PATCH] src: add ebuild-activate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to Micahł Górny for inspiration: https://0x0.st/-fQu.sh Signed-off-by: Maciej Barć --- src/ebuild-activate | 72 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 src/ebuild-activate diff --git a/src/ebuild-activate b/src/ebuild-activate new file mode 100644 index 0000000..d7d7b0d --- /dev/null +++ b/src/ebuild-activate @@ -0,0 +1,72 @@ +#!/bin/sh + + +# This file is part of scripts. + +# scripts is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3. + +# scripts is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with scripts. If not, see . + +# Original author: Maciej Barć +# Copyright (c) 2021, src_prepare group +# Licensed under the GNU GPL v3 License + + +# Exit if script is not sourced +case ${-} +in + *i* ) + : + ;; + * ) + printf "%s\n" "Run: source ${0}" \ + ">>> Exiting the shell" \ + >> /dev/stderr + exit 1 + ;; +esac + + +# Set variables for ebuild development + +_toplevel="$(git rev-parse --show-toplevel || echo '/dev/null')" + +ACCEPT_LICENSE='*' +export ACCEPT_LICENSE + +if type lz4 >/dev/null +then + BINPKG_COMPRESS='lz4' + export BINPKG_COMPRESS +fi + +if mkdir -p /tmp/distdir +then + DISTDIR='/tmp/distdir' + export DISTDIR +fi + +GENTOO_MIRRORS='' +export GENTOO_MIRRORS + +INSTALL_MASK='' +export INSTALL_MASK + +if [ -e "${_toplevel}/profiles/repo_name" ] +then + PORTDIR="${_toplevel}" + export PORTDIR +fi + +PS1="[e] ${PS1}" + + +echo ">>> Entering Ebuild development environment"