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

Bug 554518

Summary: app-emacs/emacs-common-gentoo-1.5 incompatible with portage-multilib, pkg_preinst() not idempotent
Product: Gentoo Linux Reporter: Nathan Phillip Brink (binki) (RETIRED) <binki>
Component: Current packagesAssignee: Emacs project <emacs>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 306835    
Attachments: emacs-common-gentoo-1.5-portage-multilib.patch
emerge--info.txt
emacs-common-gentoo-1.5-portage-multilib-indented.patch
emacs-common-gentoo-1.5.ebuild.diff

Description Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2015-07-11 14:12:41 UTC
Created attachment 406528 [details, diff]
emacs-common-gentoo-1.5-portage-multilib.patch

I am using the portage-multilib fork of portage (#gentoo-multilib-overlay). To most compatibly support multiple ABIs with existing ebuilds in gentoo-x86, it runs many ebuild stages multiple times—once per ABI. This includes pkg_preinst(). The line which deletes `site-gentoo.el.orig` asserts that the file exists and fails if it doesn’t. Since `site-gentoo.el.orig` is not installed to an ABI-specific folder, this line fails when it is run for a second ABI, causing die() to be called:

    rm: cannot remove ‘/var/tmp/portage/app-emacs/emacs-common-gentoo-1.5/image//usr/share/emacs/site-lisp/site-gentoo.el.orig’: No such file or directory

Likewise to the mv line (for if `site-lisp` does not yet exist in ${EROOT}):

    mv: cannot stat ‘/var/tmp/portage/app-emacs/emacs-common-gentoo-1.5/image//usr/share/emacs/site-lisp/site-gentoo.el.orig’: No such file or directory

Please consider making the lines dealing with `site-gentoo.el.orig` idempotent. This logic only needs to be run if `site-gentoo.el` doesn’t yet exist in ${ED}. I have attached a patch which makes this change and makes emacs-common-gentoo work for me.
Comment 1 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2015-07-11 14:13:35 UTC
Created attachment 406530 [details]
emerge--info.txt
Comment 2 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2015-07-11 14:20:02 UTC
Created attachment 406532 [details, diff]
emacs-common-gentoo-1.5-portage-multilib-indented.patch

Not sure what people prefer, but I realized the indentation changes were lost because I had followd some guide which told me to put “diff -u -b -B” into my ~/.cvsrc a long time ago. These are the changes I would commit if given the go-ahead, indentation changes included…
Comment 3 Ulrich Müller gentoo-dev 2015-07-11 15:12:23 UTC
Created attachment 406536 [details, diff]
emacs-common-gentoo-1.5.ebuild.diff

Slightly different approach, please test.
Comment 4 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2015-07-11 17:45:10 UTC
Comment on attachment 406532 [details, diff]
emacs-common-gentoo-1.5-portage-multilib-indented.patch

(In reply to Ulrich Müller from comment #3)
> Created attachment 406536 [details, diff] [details, diff]
> emacs-common-gentoo-1.5.ebuild.diff
> 
> Slightly different approach, please test.

This works for me. Tested both with and without preexisting site-lisp.

Thanks!