Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 461568 - eutils.eclass: epatch: bash alias look up doesn't work with bash-3.2
Summary: eutils.eclass: epatch: bash alias look up doesn't work with bash-3.2
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal QA (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-12 19:25 UTC by Michał Górny
Modified: 2013-04-25 18:38 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
The environment file (environment,196.42 KB, text/plain)
2013-03-12 19:25 UTC, Michał Górny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-03-12 19:25:05 UTC
Created attachment 341840 [details]
The environment file

>>> Preparing source in /tmp/portage/dev-lang/perl-5.16.3/work/perl-5.16.3 ...
 * Applying patches from perl-5.16.3-1 ...
 *   gentoo/EUMM-RUNPATH.diff ...
/tmp/portage/dev-lang/perl-5.16.3/temp/environment: line 4469: gentoo/EUMM-RUNPATH.diff: division by 0 (error token is "-RUNPATH.diff")
 * The ebuild phase 'prepare' has exited unexpectedly. This type of
 * behavior is known to be triggered by things such as failed variable
 * assignments (bug #190128) or bad substitution errors (bug #200313).
 * Normally, before exiting, bash should have displayed an error message
 * above. If bash did not produce an error message above, it's possible
 * that the ebuild has called `exit` when it should have called `die`
 * instead. This behavior may also be triggered by a corrupt bash binary or
 * a hardware problem such as memory or cpu malfunction. If the problem is
 * not reproducible or it appears to occur randomly, then it is likely to
 * be triggered by a hardware problem. If you suspect a hardware problem
 * then you should try some basic hardware diagnostics such as memtest.
 * Please do not report this as a bug unless it is consistently
 * reproducible and you are sure that your bash binary and hardware are
 * functioning properly.

with that line being:
            patch_cmd="${BASH_ALIASES[patch]:-patch} -p${count} ${EPATCH_OPTS}";
Comment 1 SpanKY gentoo-dev 2013-03-12 20:44:10 UTC
this was added for the prefix guys
Comment 2 Fabian Groffen gentoo-dev 2013-03-31 09:56:55 UTC
% cvs log -r1.386 eutils.eclass 

revision 1.386
date: 2012-03-01 23:10:50 +0100;  author: naota;  state: Exp;  lines: +2 -2;  commitid: 31e44f4ff3e84567;
Consider patch alias, #404447


See bug #404447, BSD guys needed it for gpatch (aliased)
Comment 3 SpanKY gentoo-dev 2013-04-03 16:32:42 UTC
(In reply to comment #2)

maybe we should just revert and force the bsd guys to sort it out
Comment 4 Alexis Ballier gentoo-dev 2013-04-03 17:21:41 UTC
(In reply to comment #3)

can you suggest anything better than aliasing patch ?
Comment 5 Alexis Ballier gentoo-dev 2013-04-03 17:33:34 UTC
(In reply to comment #4)
> (In reply to comment #3)
> 
> can you suggest anything better than aliasing patch ?

other options:
- type -p gpatch -> use gpatch instead of patch
- define PATCH (or any better named variable) in profiles and use ${PATCH:-patch}
Comment 6 Naohiro Aota gentoo-dev 2013-04-04 00:26:24 UTC
How about assigning null string "patch" variable for this part of code?

diff -u -r1.411 eutils.eclass
--- eutils.eclass       26 Feb 2013 14:36:40 -0000      1.411
+++ eutils.eclass       4 Apr 2013 00:24:07 -0000
@@ -470,7 +470,10 @@
                # Dynamically detect the correct -p# ... i'm lazy, so shoot me :/
                local patch_cmd
                while [[ ${count} -lt 5 ]] ; do
+                       local patch_saved=${patch}
+                       patch=
                        patch_cmd="${BASH_ALIASES[patch]:-patch} -p${count} ${EPATCH_OPTS}"
+                       patch=${patch_saved}
 
                        # Generate some useful debug info ...
                        (
Comment 7 SpanKY gentoo-dev 2013-04-25 18:38:24 UTC
i don't think any of those really scale.  committed this instead:

http://sources.gentoo.org/eclass/eutils.eclass?r1=1.416&r2=1.417