diff options
author | Ulrich Müller <ulm@gentoo.org> | 2011-08-11 07:04:45 +0000 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2011-08-11 07:04:45 +0000 |
commit | d8cb0c4408aed774d4a92334e57dcacc14252eaf (patch) | |
tree | 8088da08b4e3a0118127f37fb8d4f9558d194d3d /app-editors | |
parent | Initial import (bug #366871). Ebuild based on work by Petr Sabata. (diff) | |
download | gentoo-2-d8cb0c4408aed774d4a92334e57dcacc14252eaf.tar.gz gentoo-2-d8cb0c4408aed774d4a92334e57dcacc14252eaf.tar.bz2 gentoo-2-d8cb0c4408aed774d4a92334e57dcacc14252eaf.zip |
Fix canonicalisation of user home directory.
(Portage version: 2.1.10.10/cvs/Linux x86_64)
Diffstat (limited to 'app-editors')
-rw-r--r-- | app-editors/zile/ChangeLog | 8 | ||||
-rw-r--r-- | app-editors/zile/files/zile-2.3.24-userhome.patch | 26 | ||||
-rw-r--r-- | app-editors/zile/zile-2.3.24-r1.ebuild | 44 |
3 files changed, 77 insertions, 1 deletions
diff --git a/app-editors/zile/ChangeLog b/app-editors/zile/ChangeLog index f843a6f26b40..861ab8cf2ccf 100644 --- a/app-editors/zile/ChangeLog +++ b/app-editors/zile/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for app-editors/zile # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-editors/zile/ChangeLog,v 1.146 2011/05/29 17:30:07 ulm Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-editors/zile/ChangeLog,v 1.147 2011/08/11 07:04:45 ulm Exp $ + +*zile-2.3.24-r1 (11 Aug 2011) + + 11 Aug 2011; Ulrich Mueller <ulm@gentoo.org> +zile-2.3.24-r1.ebuild, + +files/zile-2.3.24-userhome.patch: + Fix canonicalisation of user home directory. Reported by flameeyes. 29 May 2011; Ulrich Mueller <ulm@gentoo.org> -zile-2.3.20.ebuild: Remove old. diff --git a/app-editors/zile/files/zile-2.3.24-userhome.patch b/app-editors/zile/files/zile-2.3.24-userhome.patch new file mode 100644 index 000000000000..37f605ccf610 --- /dev/null +++ b/app-editors/zile/files/zile-2.3.24-userhome.patch @@ -0,0 +1,26 @@ +http://lists.gnu.org/archive/html/bug-zile/2011-08/msg00030.html + +--- zile-2.3.24-orig/src/file.c ++++ zile-2.3.24/src/file.c +@@ -177,14 +177,15 @@ compact_path (astr path) + { + /* Replace `/userhome/' (if found) with `~/'. */ + size_t homelen = strlen (pw->pw_dir); +- if (astr_len (path) >= homelen && +- !strncmp (pw->pw_dir, astr_cstr (path), homelen)) ++ if (homelen > 0 && pw->pw_dir[homelen - 1] == '/') ++ homelen--; ++ ++ if (astr_len (path) > homelen && ++ !strncmp (pw->pw_dir, astr_cstr (path), homelen) && ++ astr_get (path, homelen) == '/') + { + astr buf = astr_new_cstr ("~/"); +- if (STREQ (pw->pw_dir, "/")) +- astr_cat_cstr (buf, astr_cstr (path) + 1); +- else +- astr_cat_cstr (buf, astr_cstr (path) + homelen + 1); ++ astr_cat_cstr (buf, astr_cstr (path) + homelen + 1); + astr_cpy (path, buf); + astr_delete (buf); + } diff --git a/app-editors/zile/zile-2.3.24-r1.ebuild b/app-editors/zile/zile-2.3.24-r1.ebuild new file mode 100644 index 000000000000..4d455b1c90b3 --- /dev/null +++ b/app-editors/zile/zile-2.3.24-r1.ebuild @@ -0,0 +1,44 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-editors/zile/zile-2.3.24-r1.ebuild,v 1.1 2011/08/11 07:04:45 ulm Exp $ + +EAPI=4 + +inherit eutils + +DESCRIPTION="Zile is a small Emacs clone" +HOMEPAGE="http://www.gnu.org/software/zile/" +SRC_URI="mirror://gnu/zile/${P}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris" +IUSE="livecd test valgrind" + +RDEPEND="sys-libs/ncurses" +DEPEND="${RDEPEND} + test? ( valgrind? ( dev-util/valgrind ) )" + +src_prepare() { + epatch "${FILESDIR}/${P}-userhome.patch" +} + +src_configure() { + econf $(use test && use_with valgrind || echo "--without-valgrind") +} + +src_install() { + emake DESTDIR="${D}" install + + # FAQ is installed by the build system in /usr/share/zile + dodoc AUTHORS BUGS NEWS README THANKS + + # Zile should never install charset.alias (even on non-glibc arches) + rm -f "${ED}"/usr/lib/charset.alias +} + +pkg_postinst() { + if use livecd; then + [ -e "${EROOT}"/usr/bin/emacs ] || ln -s zile "${EROOT}"/usr/bin/emacs + fi +} |