Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 286229

Summary: app-portage/eix can't be merged
Product: Gentoo/Alt Reporter: Sergey Kishchenko <voidwrk>
Component: Prefix SupportAssignee: Gentoo Prefix <prefix>
Status: RESOLVED FIXED    
Severity: normal CC: martin
Priority: High    
Version: unspecified   
Hardware: All   
OS: Interix   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Patch file to make eix work in rootless environment
Ebuild that makes use of submitted patches

Description Sergey Kishchenko 2009-09-24 13:54:46 UTC
It fails on compile state:
======================================================
  CXX    database/package_reader.o
database/package_reader.cc: In member function 'void PackageReader::skip()':
database/package_reader.cc:81: error: 'fseeko' was not declared in this scope
database/package_reader.cc: In member function 'bool PackageReader::next()':
database/package_reader.cc:99: error: 'ftello' was not declared in this scope
make: *** [database/package_reader.o] Error 1
======================================================
There is no fseeko function available. Proposed ebuild to fix it:
======================================================
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-portage/eix/eix-0.17.1.ebuild,v 1.1 2009/09/08 15:40:46 darkside Exp $

EAPI="2"

inherit multilib eutils

DESCRIPTION="Search and query ebuilds, portage incl. local settings, ext. overlays, version changes, and more"
HOMEPAGE="http://eix.sourceforge.net"
SRC_URI="mirror://sourceforge/eix/${P}.tar.xz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~ppc-aix ~x86-freebsd ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x86-solaris"
IUSE="+bzip2 +deprecated doc nls sqlite tools"

RDEPEND="sqlite? ( >=dev-db/sqlite-3 )
	nls? ( virtual/libintl )
	bzip2? ( app-arch/bzip2 )"
DEPEND="${RDEPEND}
	app-arch/xz-utils
	doc? ( dev-python/docutils )
	nls? ( sys-devel/gettext )"

src_unpack() {
	local i s
	for i in ${A}
	do
		s="${DISTDIR%/}/${i}"
		einfo "Unpacking ${s} to ${PWD}"
		test -s "${s}" || die "${s} does not exist"
		xz -dc -- "${s}" | tar xof - || die "Unpacking ${s} failed"
	done
	cd "${S}"
	epatch "${FILESDIR}/${PN}-0.17.1-r1-fseeko.patch"

}

src_configure() {
	econf $(use_with bzip2) $(use_with sqlite) $(use_with doc rst) \
		$(use_enable nls) $(use_enable tools separate-tools) \
		--with-ebuild-sh-default="/usr/$(get_libdir)/portage/bin/ebuild.sh" \
		--with-portage-rootpath="${ROOTPATH}" \
		$(use_enable deprecated obsolete-reminder)
}

src_install() {
	emake DESTDIR="${D}" install || die "emake install failed"

	dodoc AUTHORS ChangeLog doc/format.txt
	use doc && dodoc doc/format.html
}

pkg_postinst() {
	elog "Ask your overlay maintainers to provide metadata or consider to run"
	elog " egencache --repo=foo --update"
	elog "after updates (e.g. in /etc/eix-sync)."
	elog "This will speed up portage and eix-update (when the new default cache method"
	elog "\"...#metadata-flat\" is used and file dates are correct) for those overlays."
	elog "If metadata is provided but file dates are mangled during overlay updates,"
	elog "you may switch to cache method \"metadata-flat\" instead for that overlay:"
	elog "This is even faster, but works only if metadata is actually up-to-date."
	ewarn
	ewarn "Security Warning:"
	ewarn
	ewarn "Since >=eix-0.12.0, eix uses by default OVERLAY_CACHE_METHOD=\"parse|ebuild*\""
	ewarn "(since >=eix-0.16.1 with automagic \"#metadata-flat\")."
	ewarn "This is rather reliable, but ebuilds may be executed by user \"portage\". Set"
	ewarn "OVERLAY_CACHE_METHOD=parse in /etc/eixrc if you do not trust the ebuilds."
	if use deprecated; then
		elog "ATTENTION: The old eix executable names will be going away in 6"
		elog "months or the next major release, whichever is first. Update"
		elog "your scripts"
	else
		elog "ATTENTION: The eix executable names have changed. Update your"
		elog "scripts, if needed. This message will go away soon."
	fi

}
======================================================
And corresponding eix-0.17.1-r1-fseeko.patch:
======================================================
--- src/database/package_reader.h	2009-09-03 11:06:31 +0300
+++ src/database/package_reader.h	2009-09-24 16:30:20 +0300
@@ -20,6 +20,14 @@
 #include <iostream>
 #include <memory>
 
+
+//fix for systems without fseeko and ftello
+#ifndef HAVE_FSEEKO
+#define fseeko fseek
+#define ftello ftell
+#endif
+
+
 class PortageSettings;
 
 /// Forward-iterate for packages stored in the cachefile.
Comment 1 Sergey Kishchenko 2009-09-24 14:36:30 UTC
Created attachment 205115 [details, diff]
Patch file to make eix work in rootless environment
Comment 2 Markus Duft (RETIRED) gentoo-dev 2009-09-24 14:37:00 UTC
Thanks for the report.

i just committed a similar fix to the svn repo - you should receive it through rsync in a few minutes when you sync.

the issue was interix3 only, so the patch is conditional now.

you can understand the following as constructive critics :) :

Next time please just attach a diff to the previous ebuild in bugzilla - this makes it more readable for me.
Also, create an attachment instead of pasting the whole ebuild/patch in the comment - this makes it possible for me to save the file and have all whitespaces correct - which may not be the case otherwise.

for the ebuild:

for an EAPI=2 ebuild, the patching should be done in a function src_prepare(). please take a look at the ebuild i committed - you can see what i mean there.

otherwise - good job, thanks!

(since i have no XP box to test currently, could you please try, and report back if it worked?)
Comment 3 Sergey Kishchenko 2009-09-24 14:37:29 UTC
Created attachment 205117 [details]
Ebuild that makes use of submitted patches
Comment 4 Markus Duft (RETIRED) gentoo-dev 2009-09-24 14:38:44 UTC
(In reply to comment #1)
> Created an attachment (id=205115) [edit]
> Patch file to make eix work in rootless environment
> 

hmm... could you try to sync, update, and tell me if this is still an issue? i thought that would be fixed somewhere else...?
Comment 5 Markus Duft (RETIRED) gentoo-dev 2009-09-24 14:40:50 UTC
hmmm... i just tried in my interix 5.2 environment: eix-update works flawlessly as the user that installed the prefix.
Comment 6 Martin Väth 2009-09-24 15:21:21 UTC
Please CC me for eix bugs related to compile problems - they should be fixed in
the tarball, not only by patches.
Concerning the other patch: It is not needed, because
setting SKIP_PERMISSION_TESTS=true skips the related tests.
Of course, it is not nice that the error message does not point out this
possibility.
Comment 7 Markus Duft (RETIRED) gentoo-dev 2009-09-24 15:25:47 UTC
(In reply to comment #6)
> Please CC me for eix bugs related to compile problems - they should be fixed in
> the tarball, not only by patches.
> Concerning the other patch: It is not needed, because
> setting SKIP_PERMISSION_TESTS=true skips the related tests.
> Of course, it is not nice that the error message does not point out this
> possibility.
> 

ok, so for the next eix release, will you add a check for ftello and fseeko, and fallback to ftell and fseek if not available? thanks.
Comment 8 Martin Väth 2009-09-24 16:33:27 UTC
The fseeko/ftello fix and improved error messages are already in the trunk.
It will appear in eix-0.18.1.