public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 0/3] cvs.eclass update
@ 2019-07-18 10:18 Ulrich Müller
  2019-07-18 10:19 ` [gentoo-dev] [PATCH 1/3] cvs.eclass: Remove support for running under sudo Ulrich Müller
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ulrich Müller @ 2019-07-18 10:18 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 398 bytes --]

This removes some broken and unused code, and adds proper EAPI support.

Ulrich Müller (3):
  cvs.eclass: Remove support for running under sudo.
  cvs.eclass: Remove support for PATCHES.
  cvs.eclass: Add proper EAPI conditional, drop EAPIs 0 to 3.

 eclass/cvs.eclass | 77 +++++++++--------------------------------------
 1 file changed, 15 insertions(+), 62 deletions(-)

-- 
2.22.0

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [gentoo-dev] [PATCH 1/3] cvs.eclass: Remove support for running under sudo.
  2019-07-18 10:18 [gentoo-dev] [PATCH 0/3] cvs.eclass update Ulrich Müller
@ 2019-07-18 10:19 ` Ulrich Müller
  2019-07-18 10:19 ` [gentoo-dev] [PATCH 2/3] cvs.eclass: Remove support for PATCHES Ulrich Müller
  2019-07-18 10:19 ` [gentoo-dev] [PATCH 3/3] cvs.eclass: Add proper EAPI conditional, drop EAPIs 0 to 3 Ulrich Müller
  2 siblings, 0 replies; 4+ messages in thread
From: Ulrich Müller @ 2019-07-18 10:19 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 4792 bytes --]

This neither works, nor is it used in the tree.

Signed-off-by: Ulrich Müller <ulm@gentoo.org>
---
 eclass/cvs.eclass | 53 +++++++----------------------------------------
 1 file changed, 8 insertions(+), 45 deletions(-)

diff --git a/eclass/cvs.eclass b/eclass/cvs.eclass
index e2121f4724f2..128c065ebe78 100644
--- a/eclass/cvs.eclass
+++ b/eclass/cvs.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: cvs.eclass
@@ -174,22 +174,10 @@ inherit eutils
 # Set this to get a clean copy when updating (passes the
 # -C option to cvs update)
 
-# @ECLASS-VARIABLE: ECVS_RUNAS
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Specifies an alternate (non-root) user to use to run cvs.  Currently
-# b0rked and wouldn't work with portage userpriv anyway without
-# special magic.
-
-# : ${ECVS_RUNAS:=$(whoami)}
-
 # add cvs to deps
 # ssh is used for ext auth
-# sudo is used to run as a specified user
 DEPEND="dev-vcs/cvs"
 
-[[ -n ${ECVS_RUNAS} ]] && DEPEND+=" app-admin/sudo"
-
 if [[ ${ECVS_AUTH} == "ext" ]] ; then
 	#default to ssh
 	[[ -z ${CVS_RSH} ]] && export CVS_RSH="ssh"
@@ -250,15 +238,6 @@ cvs_fetch() {
 		ECVS_UP_OPTS+=" -D ${ECVS_DATE}"
 	fi
 
-	# It would be easiest to always be in "run-as mode", logic-wise,
-	# if sudo didn't ask for a password even when sudo'ing to `whoami`.
-
-	if [[ -z ${ECVS_RUNAS} ]] ; then
-		run=""
-	else
-		run="sudo -u ${ECVS_RUNAS}"
-	fi
-
 	# Create the top dir if needed
 
 	if [[ ! -d ${ECVS_TOP_DIR} ]] ; then
@@ -274,7 +253,7 @@ cvs_fetch() {
 		debug-print "${FUNCNAME}: checkout mode. creating cvs directory"
 		addwrite /foobar
 		addwrite /
-		${run} mkdir -p "/${ECVS_TOP_DIR}"
+		mkdir -p "/${ECVS_TOP_DIR}"
 		export SANDBOX_WRITE="${SANDBOX_WRITE//:\/foobar:\/}"
 	fi
 
@@ -287,11 +266,6 @@ cvs_fetch() {
 	# Disable the sandbox for this dir
 	addwrite "${ECVS_TOP_DIR}"
 
-	# Chown the directory and all of its contents
-	if [[ -n ${ECVS_RUNAS} ]] ; then
-		${run} chown -R "${ECVS_RUNAS}" "/${ECVS_TOP_DIR}"
-	fi
-
 	# Determine the CVS command mode (checkout or update)
 	if [[ ! -d ${ECVS_TOP_DIR}/${ECVS_LOCALNAME}/CVS ]] ; then
 		mode=checkout
@@ -313,13 +287,13 @@ cvs_fetch() {
 	# Switch servers automagically if needed
 	if [[ ${mode} == "update" ]] ; then
 		cd "/${ECVS_TOP_DIR}/${ECVS_LOCALNAME}"
-		local oldserver=$(${run} cat CVS/Root)
+		local oldserver=$(cat CVS/Root)
 		if [[ ${server} != "${oldserver}" ]] ; then
 			einfo "Changing the CVS server from ${oldserver} to ${server}:"
 			debug-print "${FUNCNAME}: Changing the CVS server from ${oldserver} to ${server}:"
 
 			einfo "Searching for CVS directories ..."
-			local cvsdirs=$(${run} find . -iname CVS -print)
+			local cvsdirs=$(find . -iname CVS -print)
 			debug-print "${FUNCNAME}: CVS directories found:"
 			debug-print "${cvsdirs}"
 
@@ -327,7 +301,7 @@ cvs_fetch() {
 			local x
 			for x in ${cvsdirs} ; do
 				debug-print "In ${x}"
-				${run} echo "${server}" > "${x}/Root"
+				echo "${server}" > "${x}/Root"
 			done
 		fi
 	fi
@@ -336,9 +310,6 @@ cvs_fetch() {
 	# mess with ~/.cvspass
 	touch "${T}/cvspass"
 	export CVS_PASSFILE="${T}/cvspass"
-	if [[ -n ${ECVS_RUNAS} ]] ; then
-		chown "${ECVS_RUNAS}" "${T}/cvspass"
-	fi
 
 	# The server string with the password in it, for login (only used for pserver)
 	cvsroot_pass=":${connection}:${ECVS_USER}:${ECVS_PASS}@${ECVS_SERVER}"
@@ -352,9 +323,9 @@ cvs_fetch() {
 	fi
 
 	# Commands to run
-	cmdlogin=( ${run} ${ECVS_CVS_COMMAND} -d "${cvsroot_pass}" login )
-	cmdupdate=( ${run} ${ECVS_CVS_COMMAND} -d "${cvsroot_nopass}" update ${ECVS_UP_OPTS} ${ECVS_LOCALNAME} )
-	cmdcheckout=( ${run} ${ECVS_CVS_COMMAND} -d "${cvsroot_nopass}" checkout ${ECVS_CO_OPTS} ${ECVS_MODULE} )
+	cmdlogin=( ${ECVS_CVS_COMMAND} -d "${cvsroot_pass}" login )
+	cmdupdate=( ${ECVS_CVS_COMMAND} -d "${cvsroot_nopass}" update ${ECVS_UP_OPTS} ${ECVS_LOCALNAME} )
+	cmdcheckout=( ${ECVS_CVS_COMMAND} -d "${cvsroot_nopass}" checkout ${ECVS_CO_OPTS} ${ECVS_MODULE} )
 
 	# Execute commands
 
@@ -482,13 +453,6 @@ EOF
 			unset DISPLAY
 		fi
 	fi
-
-	# Restore ownership.  Not sure why this is needed, but someone
-	# added it in the orig ECVS_RUNAS stuff.
-	if [[ -n ${ECVS_RUNAS} ]] ; then
-		chown $(whoami) "${T}/cvspass"
-	fi
-
 }
 
 # @FUNCTION: cvs_src_unpack
@@ -508,7 +472,6 @@ cvs_src_unpack() {
 	ECVS_PASS=${ECVS_PASS}
 	ECVS_MODULE=${ECVS_MODULE}
 	ECVS_LOCAL=${ECVS_LOCAL}
-	ECVS_RUNAS=${ECVS_RUNAS}
 	ECVS_LOCALNAME=${ECVS_LOCALNAME}"
 
 	[[ -z ${ECVS_MODULE} ]] && die "ERROR: CVS module not set, cannot continue."
-- 
2.22.0

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-dev] [PATCH 2/3] cvs.eclass: Remove support for PATCHES.
  2019-07-18 10:18 [gentoo-dev] [PATCH 0/3] cvs.eclass update Ulrich Müller
  2019-07-18 10:19 ` [gentoo-dev] [PATCH 1/3] cvs.eclass: Remove support for running under sudo Ulrich Müller
@ 2019-07-18 10:19 ` Ulrich Müller
  2019-07-18 10:19 ` [gentoo-dev] [PATCH 3/3] cvs.eclass: Add proper EAPI conditional, drop EAPIs 0 to 3 Ulrich Müller
  2 siblings, 0 replies; 4+ messages in thread
From: Ulrich Müller @ 2019-07-18 10:19 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1181 bytes --]

Not used in the tree, and broken in EAPI 7.

Signed-off-by: Ulrich Müller <ulm@gentoo.org>
---
 eclass/cvs.eclass | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/eclass/cvs.eclass b/eclass/cvs.eclass
index 128c065ebe78..8c9b41f586f3 100644
--- a/eclass/cvs.eclass
+++ b/eclass/cvs.eclass
@@ -15,8 +15,6 @@
 if [[ -z ${_CVS_ECLASS} ]]; then
 _CVS_ECLASS=1
 
-inherit eutils
-
 # TODO:
 
 # Implement more auth types (gserver?, kserver?)
@@ -524,19 +522,6 @@ cvs_src_unpack() {
 		debug-print "${FUNCNAME}: removing empty CVS directory ${ECVS_LOCALNAME}"
 		rm -rf "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}"
 	fi
-
-	# Implement some of base_src_unpack's functionality; note however
-	# that base.eclass may not have been inherited!
-	if [[ -n ${PATCHES} ]] ; then
-		debug-print "${FUNCNAME}: PATCHES=${PATCHES}, S=${S}, autopatching"
-		cd "${S}"
-		epatch ${PATCHES}
-		# Make sure we don't try to apply patches more than once,
-		# since cvs_src_unpack is usually called several times from
-		# e.g. kde-source_src_unpack
-		export PATCHES=""
-	fi
-
 	einfo "CVS module ${ECVS_MODULE} is now in ${WORKDIR}"
 }
 
-- 
2.22.0

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-dev] [PATCH 3/3] cvs.eclass: Add proper EAPI conditional, drop EAPIs 0 to 3.
  2019-07-18 10:18 [gentoo-dev] [PATCH 0/3] cvs.eclass update Ulrich Müller
  2019-07-18 10:19 ` [gentoo-dev] [PATCH 1/3] cvs.eclass: Remove support for running under sudo Ulrich Müller
  2019-07-18 10:19 ` [gentoo-dev] [PATCH 2/3] cvs.eclass: Remove support for PATCHES Ulrich Müller
@ 2019-07-18 10:19 ` Ulrich Müller
  2 siblings, 0 replies; 4+ messages in thread
From: Ulrich Müller @ 2019-07-18 10:19 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1024 bytes --]

---
 eclass/cvs.eclass | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/eclass/cvs.eclass b/eclass/cvs.eclass
index 8c9b41f586f3..ff23bd9df496 100644
--- a/eclass/cvs.eclass
+++ b/eclass/cvs.eclass
@@ -4,6 +4,7 @@
 # @ECLASS: cvs.eclass
 # @MAINTAINER:
 # vapier@gentoo.org (and anyone who wants to help)
+# @SUPPORTED_EAPIS: 4 5 6 7
 # @BLURB: This eclass provides generic cvs fetching functions
 # @DESCRIPTION:
 # This eclass provides the generic cvs fetching functions. To use this from an
@@ -185,10 +186,14 @@ if [[ ${ECVS_AUTH} == "ext" ]] ; then
 	DEPEND+=" net-misc/openssh"
 fi
 
+case ${EAPI:-0} in
+	4|5|6) ;;
+	7) BDEPEND="${DEPEND}"; DEPEND="" ;;
+	*) die "${ECLASS}: EAPI ${EAPI:-0} is not supported" ;;
+esac
+
 # called from cvs_src_unpack
 cvs_fetch() {
-	has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
-
 	# Make these options local variables so that the global values are
 	# not affected by modifications in this function.
 
-- 
2.22.0

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-18 10:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-18 10:18 [gentoo-dev] [PATCH 0/3] cvs.eclass update Ulrich Müller
2019-07-18 10:19 ` [gentoo-dev] [PATCH 1/3] cvs.eclass: Remove support for running under sudo Ulrich Müller
2019-07-18 10:19 ` [gentoo-dev] [PATCH 2/3] cvs.eclass: Remove support for PATCHES Ulrich Müller
2019-07-18 10:19 ` [gentoo-dev] [PATCH 3/3] cvs.eclass: Add proper EAPI conditional, drop EAPIs 0 to 3 Ulrich Müller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox