cvs{,ps}: import upstream versions for category migration

We don't actually use any cvs packages, but some of the ebuilds/eclasses
(like git) indirectly and optionally depend on cvs, so update them for
the category migration (dev-util -> dev-vcs).

BUG=chromium-os:24360
TEST=`emerge cvs && cvs -d:pserver:anonymous@anoncvs.gentoo.org:/var/cvsroot -q co -R gentoo-projects/portage-utils` works

Change-Id: I642839bb357e836d8be29595349a9d8890a804eb
Reviewed-on: https://gerrit.chromium.org/gerrit/13145
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
Mike Frysinger 2011-12-19 13:52:04 -05:00 committed by Gerrit
parent ccba5de906
commit b3bd8cb68f
10 changed files with 377 additions and 0 deletions

View File

@ -0,0 +1,79 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-vcs/cvs/cvs-1.12.12-r6.ebuild,v 1.1 2010/06/19 00:27:23 abcd Exp $
inherit eutils pam
DESCRIPTION="Concurrent Versions System - source code revision control tools"
HOMEPAGE="http://www.nongnu.org/cvs/"
SRC_URI="mirror://gnu/non-gnu/cvs/source/feature/${PV}/${P}.tar.bz2
doc? ( mirror://gnu/non-gnu/cvs/source/feature/${PV}/cederqvist-${PV}.html.tar.bz2
mirror://gnu/non-gnu/cvs/source/feature/${PV}/cederqvist-${PV}.pdf
mirror://gnu/non-gnu/cvs/source/feature/${PV}/cederqvist-${PV}.ps )"
LICENSE="GPL-2 LGPL-2"
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd"
IUSE="crypt doc kerberos nls pam server"
DEPEND=">=sys-libs/zlib-1.1.4
kerberos? ( virtual/krb5 )
pam? ( virtual/pam )"
src_unpack() {
unpack ${P}.tar.bz2
use doc && unpack cederqvist-${PV}.html.tar.bz2
EPATCH_OPTS="-p1 -d ${S}" epatch "${FILESDIR}"/${P}-cvsbug-tmpfix.patch
epatch "${FILESDIR}"/${P}-openat.patch
EPATCH_OPTS="-p1 -d ${S}" epatch "${FILESDIR}"/${P}-block-requests.patch
cd "${S}"
epatch "${FILESDIR}"/${P}-cvs-gnulib-vasnprintf.patch
epatch "${FILESDIR}"/${P}-install-sh.patch
elog "If you want any CVS server functionality, you MUST emerge with USE=server!"
}
src_compile() {
econf \
--with-external-zlib \
--with-tmpdir=/tmp \
$(use_enable crypt encryption) \
$(use_with kerberos gssapi) \
$(use_enable nls) \
$(use_enable pam) \
$(use_enable server) \
|| die
emake || die "emake failed"
}
src_install() {
emake install DESTDIR="${D}" || die
insinto /etc/xinetd.d
newins "${FILESDIR}"/cvspserver.xinetd.d cvspserver || die "newins failed"
dodoc BUGS ChangeLog* DEVEL* FAQ HACKING \
MINOR* NEWS PROJECTS README* TESTS TODO
# Not installed into emacs site-lisp because it clobbers the normal C
# indentations.
dodoc cvs-format.el || die "dodoc failed"
use server && newdoc "${FILESDIR}"/cvs-1.12.12-cvs-custom.c cvs-custom.c
if use doc; then
dodoc "${DISTDIR}"/cederqvist-${PV}.pdf
dodoc "${DISTDIR}"/cederqvist-${PV}.ps
tar xjf "${DISTDIR}"/cederqvist-${PV}.html.tar.bz2
dohtml -r cederqvist-${PV}.html/*
cd "${D}"/usr/share/doc/${PF}/html/
ln -s cvs.html index.html
fi
newpamd "${FILESDIR}"/cvs.pam-include-1.12.12 cvs
}
src_test() {
einfo "FEATURES=\"maketest\" has been disabled for dev-vcs/cvs"
}

View File

@ -0,0 +1,140 @@
Author: Robin H. Johnson <robbat2@gentoo.org>
Date: 2006-08-09
This patch allows a CVS server to deny usage of specific commands, based on
input in the environment.
Just set the CVS_BLOCK_REQUESTS env var with all of the commands you want,
seperated by spaces. Eg:
CVS_BLOCK_REQUESTS="Gzip-stream gzip-file-contents"
would block ALL usage of compression.
Please see the array 'struct request requests[]' in src/server.c for a full
list of commands.
Please note that if you block any commands marked as RQ_ESSENTIAL, CVS clients
may fail! (This includes 'ci'!).
See the companion cvs-custom.c for a wrapper that can enforce the environment variable for pserver setups.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
diff -Nuar --exclude '*~' -U 10 cvs-1.12.12.orig/src/server.c cvs-1.12.12/src/server.c
--- cvs-1.12.12.orig/src/server.c 2005-04-14 14:13:29.000000000 +0000
+++ cvs-1.12.12/src/server.c 2006-08-09 01:40:44.000000000 +0000
@@ -5836,43 +5836,90 @@
#undef REQ_LINE
};
#endif /* SERVER_SUPPORT or CLIENT_SUPPORT */
#ifdef SERVER_SUPPORT
/*
* This server request is not ignored by the secondary.
*/
+
+/* Hack by Robin H. Johnson <robbat2@gentoo.org>.
+ * Allow the server ENV to specify what request types are to be ignored.
+ */
+
+static char blocked_requests[BUFSIZ] = " ";
+
+static void build_blocked_requests() {
+ char *tmp = getenv("CVS_BLOCK_REQUESTS");
+
+ if (tmp != NULL && strlen(tmp) > 0) {
+ // move to our custom buffer
+ strncat(blocked_requests, tmp, sizeof(blocked_requests)-strlen(blocked_requests));
+ //add a space on the end as well for searching
+ strncat(blocked_requests, " ", sizeof(blocked_requests)-strlen(blocked_requests));
+ }
+
+ // now blocked_requests contains the list of every request that we do not
+ // want to serve
+}
+
+// returns 0 if we should serve this request
+// use as if(checker(FOO)) continue;
+static int serve_valid_requests_checker(char *reqname) {
+ char needle[BUFSIZ] = " ";
+ char *tmp;
+
+ if(!blocked_requests || strlen(blocked_requests) < 2)
+ return 0;
+
+ // we want to look for ' 'reqname' '
+ snprintf(needle, sizeof(needle), " %s ", reqname);
+
+ // now do the search
+ tmp = strstr(blocked_requests, needle);
+
+ if (tmp != NULL)
+ return 1;
+
+ return 0;
+
+}
+
static void
serve_valid_requests (char *arg)
{
struct request *rq;
/* Since this is processed in the first pass, don't reprocess it in the
* second.
*
* We still print errors since new errors could have been generated in the
* second pass.
*/
if (print_pending_error ()
#ifdef PROXY_SUPPORT
|| reprocessing
#endif /* PROXY_SUPPORT */
)
return;
+
+ build_blocked_requests();
buf_output0 (buf_to_net, "Valid-requests");
for (rq = requests; rq->name != NULL; rq++)
{
if (rq->func != NULL)
{
+ if(serve_valid_requests_checker(rq->name))
+ continue;
buf_append_char (buf_to_net, ' ');
buf_output0 (buf_to_net, rq->name);
}
}
buf_output0 (buf_to_net, "\nok\n");
/* The client is waiting for the list of valid requests, so we
must send the output now. */
buf_flush (buf_to_net, 1);
}
@@ -6353,20 +6400,24 @@
cmd += len;
else if (cmd[len] == ' ')
cmd += len + 1;
else
/*
* The first len characters match, but it's a different
* command. e.g. the command is "cooperate" but we matched
* "co".
*/
continue;
+ // Ignore commands that we are supposed to ignore.
+ if(serve_valid_requests_checker(rq->name))
+ continue;
+
if (!(rq->flags & RQ_ROOTLESS)
&& current_parsed_root == NULL)
{
/* For commands which change the way in which data
is sent and received, for example Gzip-stream,
this does the wrong thing. Since the client
assumes that everything is being compressed,
unconditionally, there is no way to give this
error to the client without turning on

View File

@ -0,0 +1,34 @@
http://bugs.gentoo.org/213833
commit 913c09becd9df89dbd9b9f386e7f35c240d5efe8
Author: Bruno Haible <bruno@clisp.org>
Date: Fri Oct 19 01:50:42 2007 +0200
Don't use %n on glibc >= 2.3 systems.
diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
index f563823..5d818aa 100644
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -3385,9 +3385,21 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
#endif
*p = dp->conversion;
#if USE_SNPRINTF
+# if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3))
p[1] = '%';
p[2] = 'n';
p[3] = '\0';
+# else
+ /* On glibc2 systems from glibc >= 2.3 - probably also older
+ ones - we know that snprintf's returns value conforms to
+ ISO C 99: the gl_SNPRINTF_DIRECTIVE_N test passes.
+ Therefore we can avoid using %n in this situation.
+ On glibc2 systems from 2004-10-18 or newer, the use of %n
+ in format strings in writable memory may crash the program
+ (if compiled with _FORTIFY_SOURCE=2), so we should avoid it
+ in this situation. */
+ p[1] = '\0';
+# endif
#else
p[1] = '\0';
#endif

View File

@ -0,0 +1,22 @@
Index: cvs-1.12.12/src/cvsbug.in
===================================================================
--- cvs-1.12.12.orig/src/cvsbug.in
+++ cvs-1.12.12/src/cvsbug.in
@@ -109,14 +109,14 @@ elif [ -f /bin/domainname ]; then
/usr/bin/ypcat passwd 2>/dev/null | cat - /etc/passwd | grep "^$LOGNAME:" |
cut -f5 -d':' | sed -e 's/,.*//' > $TEMP
ORIGINATOR="`cat $TEMP`"
- rm -f $TEMP
+ > $TEMP
fi
fi
if [ "$ORIGINATOR" = "" ]; then
grep "^$LOGNAME:" /etc/passwd | cut -f5 -d':' | sed -e 's/,.*//' > $TEMP
ORIGINATOR="`cat $TEMP`"
- rm -f $TEMP
+ > $TEMP
fi
if [ -n "$ORGANIZATION" ]; then

View File

@ -0,0 +1,12 @@
diff -ur a/build-aux/install-sh b/build-aux/install-sh
--- a/build-aux/install-sh 2006-03-25 20:04:46 +0000
+++ b/build-aux/install-sh 2007-09-14 10:53:29 +0100
@@ -246,7 +246,7 @@
fi
if test -n "$dir_arg"; then
- $doit $mkdircmd "$dst" \
+ { test -d "$dst" || $doit $mkdircmd -p "$dst"; } \
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \

View File

@ -0,0 +1,21 @@
Index: cvs-1.12.12/lib/openat.c
===================================================================
--- cvs-1.12.12.orig/lib/openat.c
+++ cvs-1.12.12/lib/openat.c
@@ -55,9 +55,13 @@ rpl_openat (int fd, char const *filename
va_list arg;
va_start (arg, flags);
- /* Assume that mode_t is passed compatibly with mode_t's type
- after argument promotion. */
- mode = va_arg (arg, mode_t);
+ /* If mode_t is narrower than int, use the promoted type (int),
+ not mode_t. Use sizeof to guess whether mode_t is nerrower;
+ we don't know of any practical counterexamples. */
+ if (sizeof (mode_t) < sizeof (int))
+ mode = va_arg (arg, int);
+ else
+ mode = va_arg (arg, mode_t);
va_end (arg);
}

View File

@ -0,0 +1,4 @@
#%PAM-1.0
auth include system-auth
account include system-auth
session include system-auth

View File

@ -0,0 +1,14 @@
service cvspserver
{
disable = yes
socket_type = stream
wait = no
user = root
log_type = FILE /var/log/cvspserver
protocol = tcp
env = HOME=/var/cvsroot
log_on_failure += USERID
port = 2401
server = /usr/bin/cvs
server_args = -f --allow-root=/var/cvsroot pserver
}

View File

@ -0,0 +1,33 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-vcs/cvsps/cvsps-2.1.ebuild,v 1.4 2011/04/20 12:46:35 jlec Exp $
inherit eutils toolchain-funcs
MY_P="${P/_/}"
DESCRIPTION="Generates patchset information from a CVS repository"
HOMEPAGE="http://www.cobite.com/cvsps/"
SRC_URI="http://www.cobite.com/cvsps/${MY_P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
IUSE=""
DEPEND="sys-libs/zlib"
RDEPEND="${DEPEND}"
S="${WORKDIR}/${MY_P}"
src_unpack() {
unpack ${A}
cd "${S}"
epatch "${FILESDIR}"/${P}-build.patch
tc-export CC
}
src_install() {
dobin cvsps || die
doman cvsps.1
dodoc README CHANGELOG
}

View File

@ -0,0 +1,18 @@
--- Makefile.orig 2008-03-24 07:16:47.000000000 -0400
+++ Makefile 2008-03-24 07:17:18.000000000 -0400
@@ -3,6 +3,7 @@
CC?=gcc
CFLAGS?=-g -O2 -Wall
CFLAGS+=-I. -DVERSION=\"$(MAJOR).$(MINOR)\"
+LDLIBS+=-lz
prefix?=/usr/local
OBJS=\
cbtcommon/debug.o\
@@ -21,7 +22,6 @@
all: cvsps
cvsps: $(OBJS)
- $(CC) -o cvsps $(OBJS) -lz
install:
[ -d $(prefix)/bin ] || mkdir -p $(prefix)/bin