Bug #73858 - patch from bug #66400 produced incorrect output in some cases.
authorRobin H. Johnson <robbat2@gentoo.org>
Sun, 9 Jan 2005 10:48:41 +0000 (10:48 +0000)
committerRobin H. Johnson <robbat2@gentoo.org>
Sun, 9 Jan 2005 10:48:41 +0000 (10:48 +0000)
sys-apps/ed/ChangeLog
sys-apps/ed/Manifest
sys-apps/ed/ed-0.2-r5.ebuild [new file with mode: 0644]
sys-apps/ed/files/0.2-r5-mkstemp.patch [new file with mode: 0644]
sys-apps/ed/files/digest-ed-0.2-r5 [new file with mode: 0644]

index 8dca4315d3608a24016e4f64a1e789f67ce5be0c..21ad6600c9c6584f7caa40590270f6e2056bb8d4 100644 (file)
@@ -1,6 +1,12 @@
 # ChangeLog for sys-apps/ed
 # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/ed/ChangeLog,v 1.20 2005/01/02 23:14:21 ciaranm Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/ed/ChangeLog,v 1.21 2005/01/09 10:48:41 robbat2 Exp $
+
+*ed-0.2-r5 (09 Jan 2005)
+
+  09 Jan 2005; Robin H. Johnson <robbat2@gentoo.org>
+  +files/0.2-r5-mkstemp.patch, +ed-0.2-r5.ebuild:
+  Bug #73858 - patch from bug #66400 produced incorrect output in some cases.
 
   02 Jan 2005; Ciaran McCreesh <ciaranm@gentoo.org> :
   Change encoding to UTF-8 for GLEP 31 compliance
index 530a585bbdf06ee2469f1b5900eab061481eda0c..f5d1ed1bf4ede98ad5acbddadc0219c477126b71 100644 (file)
@@ -1,6 +1,9 @@
+MD5 41da455193ffeb42d4be3e78bb48d087 ed-0.2-r5.ebuild 1347
 MD5 d1b602f11d8b40bf22397ac5863efe8d ed-0.2-r4.ebuild 1333
-MD5 30c5a72383b43a338012e68c12d81614 ChangeLog 2225
+MD5 0a2b196776175574986fc5917f1b4fbb ChangeLog 2433
 MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
-MD5 549e2478edb18002261ae5dd055bcf5b files/0.2-info-dir.patch 373
 MD5 1b60eebda7e05a6a35164bc4b23ac8ff files/digest-ed-0.2-r4 58
+MD5 1b60eebda7e05a6a35164bc4b23ac8ff files/digest-ed-0.2-r5 58
+MD5 562fdf577a5ef25a3ea0b210c049dca9 files/0.2-r5-mkstemp.patch 958
 MD5 e7e2248f9baa76de3db8210298e0d79e files/0.2-mkstemp.patch 738
+MD5 549e2478edb18002261ae5dd055bcf5b files/0.2-info-dir.patch 373
diff --git a/sys-apps/ed/ed-0.2-r5.ebuild b/sys-apps/ed/ed-0.2-r5.ebuild
new file mode 100644 (file)
index 0000000..eb43f8f
--- /dev/null
@@ -0,0 +1,48 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/ed/ed-0.2-r5.ebuild,v 1.1 2005/01/09 10:48:41 robbat2 Exp $
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Your basic line editor"
+HOMEPAGE="http://www.gnu.org/software/ed/"
+SRC_URI="ftp://ftp.gnu.org/pub/gnu/ed/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE=""
+
+DEPEND="virtual/libc
+       sys-apps/texinfo"
+
+src_unpack() {
+       unpack ${A}
+       cd ${S}
+       epatch ${FILESDIR}/${PV}-info-dir.patch
+       epatch ${FILESDIR}/${PV}-r5-mkstemp.patch
+       chmod 755 configure #73575
+       WANT_AUTOCONF=2.1 autoconf || die "autoconf failed"
+}
+
+src_compile() {
+       export CC="$(tc-getCC)" RANLIB="$(tc-getRANLIB)"
+       # very old configure script ... econf wont work
+       local myconf="--prefix=/ --host=${CHOST}"
+       [[ -n ${CBUILD} ]] && myconf="${myconf} --build=${CBUILD}"
+       [[ -n ${CTARGET} ]] && myconf="${myconf} --target=${CTARGET}"
+       myconf="${myconf} ${EXTRA_ECONF}"
+       echo "./configure ${myconf}"
+       ./configure ${myconf} || die
+       emake AR="$(tc-getAR)" || die
+}
+
+src_install() {
+       chmod 0644 ${S}/ed.info
+       make \
+               prefix=${D}/ \
+               mandir=${D}/usr/share/man/man1 \
+               infodir=${D}/usr/share/info \
+               install || die
+       dodoc ChangeLog NEWS POSIX README THANKS TODO
+}
diff --git a/sys-apps/ed/files/0.2-r5-mkstemp.patch b/sys-apps/ed/files/0.2-r5-mkstemp.patch
new file mode 100644 (file)
index 0000000..4230f13
--- /dev/null
@@ -0,0 +1,31 @@
+This is based on the following:
+===
+Submitted By: LFS Book <lfs-book@linuxfromscratch.org>
+Date: 2003-10-05
+Initial Package Version: 0.2
+Origin: Slackware Source
+Description: Use mkstemp instead of mktemp.
+===
+However the original patch contained an error.
+mkstemp returns a file description, so when fopen ran, the file was opened twice.
+The correct change is to use fdopen with mkstemp.
+diff -Naur ed-0.2/buf.c ed-0.2-2/buf.c
+--- ed-0.2/buf.c       Sat Nov 19 04:37:59 1994
++++ ed-0.2-2/buf.c     Tue May 28 18:38:23 2002
+@@ -200,13 +200,13 @@
+ int
+ open_sbuf ()
+ {
+-  char *mktemp ();
+-  int u;
++  int u, sfd;
+ 
+   isbinary = newline_added = 0;
+   u = umask(077);
+   strcpy (sfn, "/tmp/ed.XXXXXX");
+-  if (mktemp (sfn) == NULL || (sfp = fopen (sfn, "w+")) == NULL)
++  sfd = mkstemp(sfn);
++    if ((sfd == -1) || (sfp = fdopen (sfn, "w+")) == NULL)
+     {
+       fprintf (stderr, "%s: %s\n", sfn, strerror (errno));
+       sprintf (errmsg, "Cannot open temp file");
diff --git a/sys-apps/ed/files/digest-ed-0.2-r5 b/sys-apps/ed/files/digest-ed-0.2-r5
new file mode 100644 (file)
index 0000000..05d2a7c
--- /dev/null
@@ -0,0 +1 @@
+MD5 ddd57463774cae9b50e70cd51221281b ed-0.2.tar.gz 185913