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

Bug 300435

Summary: eutils.eclass: epatch doesn't omit EPATCH_EXCLUDE entries
Product: Gentoo Linux Reporter: José Manuel Ferrer Ortiz <jmfo1982>
Component: EclassesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description José Manuel Ferrer Ortiz 2010-01-10 14:39:22 UTC
It looks like epatch doesn't ommit EPATCH_EXCLUDE entries, and therefore applies those patches anyway.

Reproducible: Always

Steps to Reproduce:
1.emerge \=mozilla-firefox-3.5.6
2.
3.

Actual Results:  
>>> Preparing source in /var/tmp/portage/www-client/mozilla-firefox-3.5.6/work/mozilla-1.9.1 ...                                                                
 * Applying various patches (bugfixes/updates) ...                              
 *   001-firefox_gentoo_install_dirs.patch ...                            [ ok ]
 *   002-as-needed-linker-error.patch ...                                 [ ok ]
 *   100-bz386904_config_rules_install_dist_files.patch ...               [ ok ]
 *   108-dont_depend_on_nspr_sources.patch ...                            [ ok ]
 *   112-lp185622_system_path_default_browser.patch ...                   [ ok ]
 *   116-ubuntu_no_app_updates.patch ...                                  [ ok ]
 *   136-fix_ftbfs_with_cairo_fb.patch ...                                      

 * Failed Patch: 136-fix_ftbfs_with_cairo_fb.patch !
 *  ( /var/tmp/portage/www-client/mozilla-firefox-3.5.6/work/136-fix_ftbfs_with_cairo_fb.patch )

Expected Results:  
>>> Preparing source in /var/tmp/portage/www-client/mozilla-firefox-3.5.6/work/mozilla-1.9.1 ...                                                                
 * Applying various patches (bugfixes/updates) ...                              
 *   001-firefox_gentoo_install_dirs.patch ...                            [ ok ]
 *   002-as-needed-linker-error.patch ...                                 [ ok ]
 *   100-bz386904_config_rules_install_dist_files.patch ...               [ ok ]
 *   108-dont_depend_on_nspr_sources.patch ...                            [ ok ]
 *   112-lp185622_system_path_default_browser.patch ...                   [ ok ]
 *   116-ubuntu_no_app_updates.patch ...                                  [ ok ]
 *   137-bz460917_att350845_reload_new_plugins.patch ...                  [ ok ]
 *   300-xulrunner-fix-jemalloc-vs-aslr.patch ...                         [ ok ]
 *   301-nanojit.patch ...                                                [ ok ]
 * Done with patching

The patch file 136-fix_ftbfs_with_cairo_fb.patch should be skipped, since it is in the EPATCH_EXCLUDE variable inside firefox-3.5.6.ebuild's src_prepare section, before calling epatch. That patch failing to apply is the way I realized epatch was trying to apply it, when it shouldn't.
Comment 1 José Manuel Ferrer Ortiz 2010-01-10 14:49:47 UTC
The problem is in eutils.eclass file, inside epatch method code. The wrong code is:

local ex
for ex in ${EPATCH_EXCLUDE} ; do
    [[ ${patchname} == ${ex} ]] && continue
done

The problem is that the continue statement doesn't do what the author of that code wanted to, i.e. continue running the outer for loop (actually skipping the patch application), but instead it continues running this for loop (which does nothing useful and therefore the patch gets applied unconditionally).

An easy solution is putting the continue statement outside the innermost for loop, for example something like this:

local ex cont="no"
for ex in ${EPATCH_EXCLUDE} ; do
    [[ ${patchname} == ${ex} ]] && cont="yes" && break
done
[[ ${cont} == "yes" ]] && continue

Thank you for your time and great mantaining job. Oh, and happy new year and decade :)
Comment 2 SpanKY gentoo-dev 2010-01-10 21:28:18 UTC

*** This bug has been marked as a duplicate of bug 300360 ***