summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schweizer <genstef@gentoo.org>2007-07-07 12:27:43 +0000
committerStefan Schweizer <genstef@gentoo.org>2007-07-07 12:27:43 +0000
commite9cb2b2b87f6a5aaa4877e4f2ca7464b8e833185 (patch)
tree0e6633e04af952f927605faced1a660fab4dfd87 /net-misc/vde
parentUpdate man page on "-l" option, fixes bug #168555. Fix some typos, #170691. (diff)
downloadhistorical-e9cb2b2b87f6a5aaa4877e4f2ca7464b8e833185.tar.gz
historical-e9cb2b2b87f6a5aaa4877e4f2ca7464b8e833185.tar.bz2
historical-e9cb2b2b87f6a5aaa4877e4f2ca7464b8e833185.zip
patch to enable unixterm to receive commands from standard input thanks to Adrian Lambeck <adrian@basicsedv.de> in bug 184429
Package-Manager: portage-2.1.3_rc6
Diffstat (limited to 'net-misc/vde')
-rw-r--r--net-misc/vde/ChangeLog9
-rw-r--r--net-misc/vde/Manifest19
-rw-r--r--net-misc/vde/files/Unixterm_20070403.patch208
-rw-r--r--net-misc/vde/files/digest-vde-2.1.6-r13
-rw-r--r--net-misc/vde/vde-2.1.6-r1.ebuild42
5 files changed, 276 insertions, 5 deletions
diff --git a/net-misc/vde/ChangeLog b/net-misc/vde/ChangeLog
index 2e4891a487ed..d9dddaff4e93 100644
--- a/net-misc/vde/ChangeLog
+++ b/net-misc/vde/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-misc/vde
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/vde/ChangeLog,v 1.11 2007/06/09 15:38:23 genstef Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/vde/ChangeLog,v 1.12 2007/07/07 12:27:43 genstef Exp $
+
+*vde-2.1.6-r1 (07 Jul 2007)
+
+ 07 Jul 2007; Stefan Schweizer <genstef@gentoo.org>
+ +files/Unixterm_20070403.patch, +vde-2.1.6-r1.ebuild:
+ patch to enable unixterm to receive commands from standard input thanks to
+ Adrian Lambeck <adrian@basicsedv.de> in bug 184429
09 Jun 2007; Stefan Schweizer <genstef@gentoo.org> files/vde.init:
Fix failing script thanks to Giuliano Gagliardi <gentoo@gogi.tv> in bug 181193
diff --git a/net-misc/vde/Manifest b/net-misc/vde/Manifest
index 7053cfa2c2ce..93b1828ab583 100644
--- a/net-misc/vde/Manifest
+++ b/net-misc/vde/Manifest
@@ -1,3 +1,7 @@
+AUX Unixterm_20070403.patch 5054 RMD160 76a8200d0975aa172f39a6937799a5ef2b9bbd40 SHA1 05d891782ea64a639e4c68ade3533a34695d392f SHA256 a17223c1b93c74e9e97636f47da3dd194f499f3b216cf17c50f1f37913b3533a
+MD5 db1694c3af67c797a5426088b1711d6d files/Unixterm_20070403.patch 5054
+RMD160 76a8200d0975aa172f39a6937799a5ef2b9bbd40 files/Unixterm_20070403.patch 5054
+SHA256 a17223c1b93c74e9e97636f47da3dd194f499f3b216cf17c50f1f37913b3533a files/Unixterm_20070403.patch 5054
AUX vde.conf 187 RMD160 7d3a650dba0d33401095d444cda3230c5fa8f963 SHA1 0ad41e477982d4eba8afa07d183eb6ed55116eab SHA256 00ff15f4850f8afda12dacfe548a29d70a3d504513066e66a6570b88851c858f
MD5 e9f5534679cda97e64134dd6429582cc files/vde.conf 187
RMD160 7d3a650dba0d33401095d444cda3230c5fa8f963 files/vde.conf 187
@@ -22,14 +26,18 @@ EBUILD vde-2.1.1.ebuild 1094 RMD160 8a28f10f084a3fb157976536f5f1a5f0fd993df7 SHA
MD5 3448cd3f3969c55ff488894cbd77164b vde-2.1.1.ebuild 1094
RMD160 8a28f10f084a3fb157976536f5f1a5f0fd993df7 vde-2.1.1.ebuild 1094
SHA256 e761ee77b652cc36aeb1e4c30ece490334a002907c7d537c929399ef06ebb9a5 vde-2.1.1.ebuild 1094
+EBUILD vde-2.1.6-r1.ebuild 1193 RMD160 15459e2c97b247ec1414e5ed6a1b2e19db9437a2 SHA1 2baa2e6a5c3a25d2b38aaf9a5f97c946c3f838fb SHA256 1c3074bbfc86c5a8d3d99369e33578485ee78b5ee48e15424972b77e378fa256
+MD5 e86d4f7e10c3e7d7a9b7bc339b5dc25c vde-2.1.6-r1.ebuild 1193
+RMD160 15459e2c97b247ec1414e5ed6a1b2e19db9437a2 vde-2.1.6-r1.ebuild 1193
+SHA256 1c3074bbfc86c5a8d3d99369e33578485ee78b5ee48e15424972b77e378fa256 vde-2.1.6-r1.ebuild 1193
EBUILD vde-2.1.6.ebuild 1099 RMD160 07755732ad3c5cd8c2494d335f20bbef31452419 SHA1 ed9ac22b2e39dbbbf1e91bab245b583ddb46f719 SHA256 dc83def2128b6ae678997429774e7023e4d36e0b078d979f0f56ef2c8cf10e09
MD5 f967eb40b7f769ea60bfb69b3b52c3f6 vde-2.1.6.ebuild 1099
RMD160 07755732ad3c5cd8c2494d335f20bbef31452419 vde-2.1.6.ebuild 1099
SHA256 dc83def2128b6ae678997429774e7023e4d36e0b078d979f0f56ef2c8cf10e09 vde-2.1.6.ebuild 1099
-MISC ChangeLog 2214 RMD160 e0716dc32daa4f5f5aff48c20175551defb2a877 SHA1 4d6455d1bbaf6ffda7899e314536540cb356e6b2 SHA256 e0800dcaf610e51ec6c3514136daff46e3f76c219b881cf7d957ad9343b6d483
-MD5 13fddc75a4b36cbce09d67bca0357c4e ChangeLog 2214
-RMD160 e0716dc32daa4f5f5aff48c20175551defb2a877 ChangeLog 2214
-SHA256 e0800dcaf610e51ec6c3514136daff46e3f76c219b881cf7d957ad9343b6d483 ChangeLog 2214
+MISC ChangeLog 2483 RMD160 dffd68796385bc516d8285c00f2efe3ea061cd19 SHA1 34bd6e329b0d6453e3b2e588699734d31dc20ee4 SHA256 f02e4eac1e128af51d490ef54df46e3a1a4c26fd23f8872523ef6d513a41613e
+MD5 ed6d29781510b68f74f0b7405c4f4002 ChangeLog 2483
+RMD160 dffd68796385bc516d8285c00f2efe3ea061cd19 ChangeLog 2483
+SHA256 f02e4eac1e128af51d490ef54df46e3a1a4c26fd23f8872523ef6d513a41613e ChangeLog 2483
MISC metadata.xml 291 RMD160 f134ca695b605c125c3a8e317126398add351bfa SHA1 850bb9320f9809aebd4b8e3cd6c14b17e162112f SHA256 a8fe4b8510e66b25e88c52a68c7c6482e0fc787d585b673becec195e9e4d3c4f
MD5 dd14a01e3370ff0cd441858d7dc257b9 metadata.xml 291
RMD160 f134ca695b605c125c3a8e317126398add351bfa metadata.xml 291
@@ -46,3 +54,6 @@ SHA256 ed6d93e9cee855912bdd8832bdf64102e907ffc6d73467a62dbcc6450eb18c12 files/di
MD5 7366f3b5b17a613f3da8c22a382640a7 files/digest-vde-2.1.6 235
RMD160 b16cffdc57e52560392c8e2aea101cf5f8b6dfc1 files/digest-vde-2.1.6 235
SHA256 d767ab752763afbf9cdafe913d4b85e2213f7f67a32de1d90a968b1c8b1613a3 files/digest-vde-2.1.6 235
+MD5 7366f3b5b17a613f3da8c22a382640a7 files/digest-vde-2.1.6-r1 235
+RMD160 b16cffdc57e52560392c8e2aea101cf5f8b6dfc1 files/digest-vde-2.1.6-r1 235
+SHA256 d767ab752763afbf9cdafe913d4b85e2213f7f67a32de1d90a968b1c8b1613a3 files/digest-vde-2.1.6-r1 235
diff --git a/net-misc/vde/files/Unixterm_20070403.patch b/net-misc/vde/files/Unixterm_20070403.patch
new file mode 100644
index 000000000000..0d5a2a6cb8ee
--- /dev/null
+++ b/net-misc/vde/files/Unixterm_20070403.patch
@@ -0,0 +1,208 @@
+diff -Naur vde2-2.1.6/unixterm/unixterm.c vde2-2.1.6-unixterm/unixterm/unixterm.c
+--- vde2-2.1.6/unixterm/unixterm.c 2006-07-07 16:54:39.000000000 +0200
++++ vde2-2.1.6/unixterm/unixterm.c 2007-04-03 12:49:14.000000000 +0200
+@@ -4,6 +4,8 @@
+ * Minimal terminal emulator on a UNIX stream socket
+ */
+
++/* render: addedd support for stdin commands */
++
+ #include <stdio.h>
+ #include <fcntl.h>
+ #include <stdlib.h>
+@@ -11,10 +13,12 @@
+ #include <sys/poll.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
+-
++#include <getopt.h>
+ #include <vde.h>
+
+ #define BUFSIZE 1024
++#define LINESIZE 1025
++#define THRESHOLD 4
+ char buf[BUFSIZE];
+
+ int main(int argc,char *argv[])
+@@ -23,25 +27,168 @@
+ int fd;
+ int rv;
+ static struct pollfd pfd[]={
+- {STDIN_FILENO,POLLIN | POLLHUP,0},
+- {STDIN_FILENO,POLLIN | POLLHUP,0}};
++ {STDIN_FILENO,POLLIN | POLLHUP, 0},
++ {STDIN_FILENO,POLLIN | POLLHUP, 0}};
+ static int fileout[]={STDOUT_FILENO,STDOUT_FILENO};
++ int optret;
++ char *sockpath, *sockname;
++ char sentinel = 0;
++ unsigned char injecting = 0;
++ unsigned char optcount = 0;
++ unsigned char failures = 0;
++ unsigned char loggedout = 0;
++ unsigned char ok_to_write = 0;
++
++ /* options management loop */
++ while (1) {
++ static struct option options[] = {
++ {"inject", 0, 0, 0}, /* get command list from stdin */
++ {"socket", 1, 0, 0}, /* management socket */
++ {0, 0, 0, 0} /* default case */
++ };
++ int option_index = 0;
++
++ if ((optret = getopt_long (argc, argv, "is:", options, &option_index)) == -1)
++ break;
++
++ optcount++;
++
++ switch (optret) {
++ case 0:
++ switch (option_index) {
++ case 0:
++ injecting = 1;
++ break;
++ case 1:
++ if ((sockpath = strdup(optarg)) == NULL)
++ fprintf(stderr, "strdup error\n");
++ sockname = (char *)basename(sockpath);
++ break;
++ default:
++ fprintf(stderr, "unknown long option\n");
++ break;
++ }
++
++ break;
++
++ case 'i':
++ injecting = 1;
++ break;
++
++ case 's':
++ if ((sockpath = strdup(optarg)) == NULL)
++ fprintf(stderr, "strdup error\n");
++ sockname = (char *)basename(sockpath);
++ break;
++
++ case '?':
++ fprintf(stderr, "unknown short option\n");
++ break;
++
++ default:
++ fprintf(stderr, "default case!\n");
++ break;
++ }
++ }
++
+ sun.sun_family=PF_UNIX;
+- snprintf(sun.sun_path,sizeof(sun.sun_path),"%s",argv[1]);
++ snprintf(sun.sun_path,sizeof(sun.sun_path),"%s", optcount ? sockpath : argv[1]);
++
+ fd=socket(PF_UNIX,SOCK_STREAM,0);
+- rv=connect(fd,(struct sockaddr *)(&sun),sizeof(sun));
++
++ if (connect(fd, (struct sockaddr *)(&sun), sizeof(sun)) < 0) {
++ perror("connect");
++ exit(-1);
++ }
++
+ pfd[1].fd=fileout[0]=fd;
++
+ while(1) {
+- int m,i,n=poll(pfd,2,-1);
+- for(i=0;n>0;i++) {
+- if(pfd[i].revents & POLLHUP)
+- exit(0);
++ int ccount,m,i,n = poll(pfd,2,-1);
++ for(i = 0; n > 0; i++) {
+ if(pfd[i].revents & POLLIN) {
+- n--;
+- if((m=read(pfd[i].fd,buf,BUFSIZE)) == 0)
++ --n;
++ if (injecting) {
++ switch (i) {
++ case 0:
++ if (!feof(stdin)) {
++ ccount = 0;
++
++ if (sentinel > 0) {
++ buf[ccount] = sentinel;
++ ccount++;
++ }
++
++ while ((buf[ccount] = fgetc(stdin)) != '\n' && !feof(stdin))
++ ccount++;
++ /* avoid write of empty lines */
++ if ((ccount > 0) && (buf[0] != '\n')) {
++ write(fileout[i],buf,ccount);
++ }
++ sentinel = fgetc(stdin);
++ }
++ /* end of stdin: logout from management console */
++ if (feof(stdin) && !loggedout) {
++ write(fileout[i],"logout\n",strlen("logout\n"));
++ loggedout = 1;
++ }
++
++ break;
++ case 1: {
++ int cursor = 0;
++ int base = 0;
++ char line[LINESIZE];
++ unsigned char start = 1;
++
++ if ((m = read(pfd[i].fd,buf,BUFSIZE)) == 0)
++ exit(0);
++
++ while (cursor < m) {
++ while ((buf[cursor] != '\n') && (cursor <= m))
++ cursor++;
++
++ memcpy(line, &buf[base], cursor - base + 1);
++
++ if (!ok_to_write && (start = (strstr(line, "0000 DATA") == NULL))) {
++ base += (cursor - base) + 1;
++ cursor += 1;
++ } else {
++ if (ok_to_write && (strstr(line, ".\n") != NULL)) {
++ ok_to_write = 0;
++ }
++
++ if (ok_to_write) {
++ write(fileout[i],sockname, strlen(sockname));
++ write(fileout[i],": ", 2);
++ write(fileout[i],line,cursor - base + 1);
++ }
++ else {
++ if (!start) {
++ ok_to_write = 1;
++ start = 1;
++ }
++ }
++ base += (cursor - base) + 1;
++ cursor += 1;
++ }
++ }
++
++ break;
++ }
++ }
++ } else {
++ if((m=read(pfd[i].fd,buf,BUFSIZE)) == 0)
++ exit(0);
++
++ write(fileout[i],buf,m);
++ }
++ }
++
++ if(pfd[i].revents & POLLHUP) {
++ --n;
++ if (sentinel > 0)
+ exit(0);
+- write(fileout[i],buf,m);
+ }
+- }
+- }
++ } /* for */
++ } /* infinite while */
+ }
diff --git a/net-misc/vde/files/digest-vde-2.1.6-r1 b/net-misc/vde/files/digest-vde-2.1.6-r1
new file mode 100644
index 000000000000..21b986fdd60b
--- /dev/null
+++ b/net-misc/vde/files/digest-vde-2.1.6-r1
@@ -0,0 +1,3 @@
+MD5 68a9a5c4c8cf713bd4d97acc1eb341a6 vde2-2.1.6.tar.bz2 390222
+RMD160 083be75c89c5915ce7fa8a2b300a09af49e793cd vde2-2.1.6.tar.bz2 390222
+SHA256 4a4664346e357e95f3113af6d72878d57e0ef5d493d476ec49870376a2ee00e7 vde2-2.1.6.tar.bz2 390222
diff --git a/net-misc/vde/vde-2.1.6-r1.ebuild b/net-misc/vde/vde-2.1.6-r1.ebuild
new file mode 100644
index 000000000000..ba364632a0d7
--- /dev/null
+++ b/net-misc/vde/vde-2.1.6-r1.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/vde/vde-2.1.6-r1.ebuild,v 1.1 2007/07/07 12:27:43 genstef Exp $
+
+inherit eutils
+
+MY_P="${PN}2-${PV}"
+S="${WORKDIR}/${MY_P}"
+
+DESCRIPTION="vde2 is a virtual distributed ethernet emulator for emulators like qemu, bochs, and uml."
+SRC_URI="mirror://sourceforge/vde/${MY_P}.tar.bz2"
+HOMEPAGE="http://vde.sourceforge.net/"
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+DEPEND=""
+
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}/Unixterm_20070403.patch"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ newinitd "${FILESDIR}"/vde.init vde
+ newconfd "${FILESDIR}"/vde.conf vde
+
+ dodoc INSTALL README
+}
+
+pkg_postinst() {
+ # default group already used in kqemu
+ enewgroup qemu
+ einfo "To start vde automatically add it to the default runlevel:"
+ einfo "# rc-update add vde default"
+ einfo "You need to setup tap0 in /etc/conf.d/net"
+ einfo "To use it as an user be sure to set a group in /etc/conf.d/vde"
+ einfo "Users of the group can then run: $ vdeq qemu -sock /var/run/vde.ctl ..other opts"
+}