commit: a116fca0e3d853762769238d83a37401f870a56c Author: dsaf <ghostyn678+git <AT> gmail <DOT> com> AuthorDate: Mon Feb 2 11:59:16 2026 +0000 Commit: dsaf <ghostyn678+git <AT> gmail <DOT> com> CommitDate: Mon Feb 2 12:49:10 2026 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=a116fca0
app-admin/run0edit: new package, add 0.5.6_p20251226, 9999 Signed-off-by: dsaf <ghostyn678+git <AT> gmail.com> app-admin/run0edit/Manifest | 1 + app-admin/run0edit/metadata.xml | 16 +++++ app-admin/run0edit/run0edit-0.5.6_p20251226.ebuild | 69 ++++++++++++++++++++++ app-admin/run0edit/run0edit-9999.ebuild | 69 ++++++++++++++++++++++ 4 files changed, 155 insertions(+) diff --git a/app-admin/run0edit/Manifest b/app-admin/run0edit/Manifest new file mode 100644 index 0000000000..6497a05cd2 --- /dev/null +++ b/app-admin/run0edit/Manifest @@ -0,0 +1 @@ +DIST run0edit-0.5.6_p20251226.tar.gz 38917 BLAKE2B 06a9535d79452dcbc8b6bc4861a2792e251d6fddcdf9c96504bec1b5f1f248635e37228d3cb491beb8a3cf4ce702e55d3d1144c8e8a8afb9ec649939ae5d20b2 SHA512 1fc8a41e5c7556b08b2085cfd822ba976c8096830c74f7ce86ba6cf96fcfc980b081c2be8f6714030b4c878df910c9954105fdd474cd4ab0fcf54c72fe8604b3 diff --git a/app-admin/run0edit/metadata.xml b/app-admin/run0edit/metadata.xml new file mode 100644 index 0000000000..a7be25b55b --- /dev/null +++ b/app-admin/run0edit/metadata.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>[email protected]</email> + <name>dsaf</name> + </maintainer> + <longdescription> + run0edit allows a permitted user to edit a file as root. + Authorization uses the same mechanism as run0, which + typically takes the form of a password prompt. + </longdescription> + <upstream> + <remote-id type="github">HastD/run0edit</remote-id> + </upstream> +</pkgmetadata> diff --git a/app-admin/run0edit/run0edit-0.5.6_p20251226.ebuild b/app-admin/run0edit/run0edit-0.5.6_p20251226.ebuild new file mode 100644 index 0000000000..d644ed28dd --- /dev/null +++ b/app-admin/run0edit/run0edit-0.5.6_p20251226.ebuild @@ -0,0 +1,69 @@ +# Copyright 2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{12..14} ) +inherit python-single-r1 + +MY_COMMIT="6c5827576ac9241d976cf8bd953ea244793f2506" + +DESCRIPTION="Script to edit a single file as root using run0" +HOMEPAGE="https://github.com/HastD/run0edit" + +if [[ ${PV} == *9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/HastD/run0edit.git" +elif [[ ${PV} == *_p* ]] ; then + SRC_URI="https://github.com/HastD/run0edit/archive/${MY_COMMIT}.tar.gz -> ${P}.tar.gz" + S="${WORKDIR}/${PN}-${MY_COMMIT}" +else + SRC_URI="https://github.com/HastD/run0edit/releases/download/v${PV}/run0edit-${PV}.tar.gz" +fi + +LICENSE="|| ( Apache-2.0 MIT )" +SLOT="0" + +if [[ ${PV} != *9999* ]] ; then + KEYWORDS="~amd64" +fi + +REQUIRED_USE="${PYTHON_REQUIRED_USE}" +RDEPEND=" + ${PYTHON_DEPS} + >=sys-apps/systemd-256:= +" + +DOCS=( {CHANGELOG,SECURITY,README}.md ) + +src_prepare() { + default + + mv run0edit_main.py run0edit || die + + python_fix_shebang run0edit run0edit_inner.py + + local b2=$(b2sum "${S}"/run0edit_inner.py | cut -d' ' -f1) + local sitedir=$(python_get_sitedir) + + # patch hard-coded variables to work + sed -i \ + -e "s|^INNER_SCRIPT_PATH:.*|INNER_SCRIPT_PATH: Final[str] = \"${sitedir}/run0edit_inner.py\"|" \ + -e "/^INNER_SCRIPT_B2:/{ + N + s|^.*|INNER_SCRIPT_B2: Final[str] = \"${b2}\"| + }" \ + run0edit || die +} + +src_install() { + python_domodule run0edit_inner.py + + python_doscript run0edit + + einstalldocs + + # setup editor.conf + dodir /etc/"${PN}" + echo "$(which ${EDITOR})" >> "${ED}"/etc/"${PN}"/editor.conf || die +} diff --git a/app-admin/run0edit/run0edit-9999.ebuild b/app-admin/run0edit/run0edit-9999.ebuild new file mode 100644 index 0000000000..d644ed28dd --- /dev/null +++ b/app-admin/run0edit/run0edit-9999.ebuild @@ -0,0 +1,69 @@ +# Copyright 2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{12..14} ) +inherit python-single-r1 + +MY_COMMIT="6c5827576ac9241d976cf8bd953ea244793f2506" + +DESCRIPTION="Script to edit a single file as root using run0" +HOMEPAGE="https://github.com/HastD/run0edit" + +if [[ ${PV} == *9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/HastD/run0edit.git" +elif [[ ${PV} == *_p* ]] ; then + SRC_URI="https://github.com/HastD/run0edit/archive/${MY_COMMIT}.tar.gz -> ${P}.tar.gz" + S="${WORKDIR}/${PN}-${MY_COMMIT}" +else + SRC_URI="https://github.com/HastD/run0edit/releases/download/v${PV}/run0edit-${PV}.tar.gz" +fi + +LICENSE="|| ( Apache-2.0 MIT )" +SLOT="0" + +if [[ ${PV} != *9999* ]] ; then + KEYWORDS="~amd64" +fi + +REQUIRED_USE="${PYTHON_REQUIRED_USE}" +RDEPEND=" + ${PYTHON_DEPS} + >=sys-apps/systemd-256:= +" + +DOCS=( {CHANGELOG,SECURITY,README}.md ) + +src_prepare() { + default + + mv run0edit_main.py run0edit || die + + python_fix_shebang run0edit run0edit_inner.py + + local b2=$(b2sum "${S}"/run0edit_inner.py | cut -d' ' -f1) + local sitedir=$(python_get_sitedir) + + # patch hard-coded variables to work + sed -i \ + -e "s|^INNER_SCRIPT_PATH:.*|INNER_SCRIPT_PATH: Final[str] = \"${sitedir}/run0edit_inner.py\"|" \ + -e "/^INNER_SCRIPT_B2:/{ + N + s|^.*|INNER_SCRIPT_B2: Final[str] = \"${b2}\"| + }" \ + run0edit || die +} + +src_install() { + python_domodule run0edit_inner.py + + python_doscript run0edit + + einstalldocs + + # setup editor.conf + dodir /etc/"${PN}" + echo "$(which ${EDITOR})" >> "${ED}"/etc/"${PN}"/editor.conf || die +}
