Any ebuild containing `epatch` now dies on src_prepare phase. *.patch.out contains: ======================================================= patch: invalid option -- g Usage: patch [options] [origfile [patchfile]] [+ [options] [origfile]]... Options: [-cCeEflnNRsStuv] [-b backup-ext] [-B backup-prefix] [-d directory] [-D symbol] [-F max-fuzz] [-i patchfile] [-o out-file] [-p[strip-count]] [-r rej-name] [-V {numbered,existing,simple}] [--check] [--context] [--prefix=backup-prefix] [--suffix=backup-ext] [--ifdef=symbol] [--directory=directory] [--ed] [--fuzz=max-fuzz] [--force] [--batch] [--ignore-whitespace] [--forward] [--reverse] [--output=out-file] [--strip[=strip-count]] [--normal] [--reject-file=rej-name] [--skip] [--remove-empty-files] [--quiet] [--silent] [--unified] [--version] [--version-control={numbered,existing,simple}] [--index-first] patch program exited with status 1 ======================================================= Reproducible: Always # which patch /usr/bin/patch # equery belongs /usr/bin/patch * Searching for /usr/bin/patch ... sys-freebsd/freebsd-contrib-8.2 (/usr/bin/patch) # equery files sys-devel/patch * Searching for patch in sys-devel ... * Contents of sys-devel/patch-2.6.1: /usr /usr/bin /usr/bin/gpatch ...
Unsure about Product field of this bug.
That was this http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/eutils.eclass?r1=1.382&r2=1.383 change.
problem is that doing 'patch_cmd="patch -p${count} ${EPATCH_OPTS}"' ignores the 'alias patch=gpatch' we have in our profile.bashrc; epatch requires gnu patch. no clue how to get a straightforward fix though :(
(In reply to comment #3) > problem is that doing 'patch_cmd="patch -p${count} ${EPATCH_OPTS}"' ignores the > 'alias patch=gpatch' we have in our profile.bashrc; epatch requires gnu patch. > > no clue how to get a straightforward fix though :( I think there is a similar problem with python-updater in bug 370935. And Arfrever Frehtes Taifersar Arahesis proposed `shopt -s expand_aliases`.
does `shopt -s expand_aliases` make it work ?
(In reply to comment #5) > does `shopt -s expand_aliases` make it work ? No (I tried to add it above patch_cmd=).
How about this patch? diff -u -r1.384 eutils.eclass --- eutils.eclass 26 Feb 2012 13:20:59 -0000 1.384 +++ eutils.eclass 27 Feb 2012 12:18:38 -0000 @@ -444,7 +444,7 @@ # Dynamically detect the correct -p# ... i'm lazy, so shoot me :/ local patch_cmd while [[ ${count} -lt 5 ]] ; do - patch_cmd="patch -p${count} ${EPATCH_OPTS}" + patch_cmd="${BASH_ALIASES[patch]:-patch} -p${count} ${EPATCH_OPTS}" # Generate some useful debug info ... (
(In reply to comment #7) > How about this patch? > > - patch_cmd="patch -p${count} ${EPATCH_OPTS}" > + patch_cmd="${BASH_ALIASES[patch]:-patch} -p${count} ${EPATCH_OPTS}" It works for me.
I'll commit this change in a few days, if no devs has disagree for it.
*** Bug 406325 has been marked as a duplicate of this bug. ***
(In reply to comment #7) technically, BASH_ALIASES was introduced in bash-4.0, and we are supposed to be compatible with bash-3.2+. your code would still "work" with older versions of bash if you define "work" as "everyone without a patch alias" (since the ":-" fallback will kick in fine). if the bsd/prefix guys don't care, then i'm fine with that solution.
Prefix uses GNU patch, so any solution that works for normal Gentoo should work for us here.
Change applied. Thanks.