Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 74249 - djbdns-1.05-r12 has a bad patch
Summary: djbdns-1.05-r12 has a bad patch
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Jared H. Hudson (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-12 17:54 UTC by Alex Efros
Modified: 2004-12-18 11:06 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Efros 2004-12-12 17:54:31 UTC
Looks like there exist design bug at epatch() in *.ebuild files.
As far as I understand, epatch() try to find suitable value for -p param by
trying --dry-run with -p0, -p1, etc. until success. In some cases this 
algorithm may fail. Here is example how this may happens in djbdns-1.05-r12.

(`--dry-run -p0` will success because filename in patch use absolute pathname
/etc/dnsroots.global, but `-p0` will fail (probably because user "portage" can't
change /etc/dnsroots.global); but anyway this patch should be executed with
`-p2` instead of `-p0`.)

Reproducible: Always
Steps to Reproduce:
1. Extract file dnsroots.global from /usr/portage/distfiles/djbdns-1.05.tar.gz
and copy it into /etc/ directory (backup your current /etc/dnsroots.global
first, if any).
2. emerge =net-dns/djbdns-1.05-r12

Actual Results:  
Calculating dependencies
>>> Unpacking source...                               
>>> Unpacking djbdns-1.05.tar.gz to /var/tmp/portage/djbdns-1.05-r12/work       
QA Notice: USE Flag 'ipv6arpa' not in IUSE for net-dns/djbdns-1.05-r12          
 * Applying 1.05-errno.patch ...                                        [ ok ]   
 * Applying headtail.patch ...                                          [ ok ]   
 * Applying dnsroots.patch ...                                                  
                                                                                
 * A dry-run of patch command succeeded, but actually                           
 * applying the patch failed!                                                   
                                                                                
 * Failed Patch: dnsroots.patch!                                                
 *                                                                              
 * Include in your bugreport the contents of:                                   
 *                                                                              
 *   /var/tmp/portage/djbdns-1.05-r12/temp/dnsroots.patch-5352.out              
                                                                                
                                                                                
!!! ERROR: net-dns/djbdns-1.05-r12 failed.                                      
!!! Function epatch, Line 402, Exitcode 0                                       
!!! Failed Patch: dnsroots.patch!                                               
!!! If you need support, post the topmost build error, NOT this status message. 
                                                                                
--------------------------- ACCESS VIOLATION SUMMARY +--------------------------
LOG FILE = "/tmp/sandbox-net-dns_-_djbdns-1.05-r12-5351.log"                    
                                                                                
rename:    /etc/dnsroots.global                                                 
--------------------------------------------------------------------------------
 ...done!                                                                  

Expected Results:  
 * Applying dnsroots.patch ...                                          [ ok ]
Comment 1 SpanKY gentoo-dev 2004-12-12 18:52:24 UTC
it's a bug in the ebuild, not epatch
Comment 2 Alex Efros 2004-12-12 22:37:49 UTC
So, your think it's okay to patch file in /etc/ using epatch()?
How about sandbox for epatch()? I don't think ebuild-script should be able
to patch any files outside /var/tmp/portage/PKG/work/ directory...
Comment 3 SpanKY gentoo-dev 2004-12-13 07:39:48 UTC
the patch is wrong because it refers to /etc/dnsroots.global instead of just 'dnsroots.gobal' or perhaps 'djbdns/dnsroots.global'

it is NOT a bug in epatch
Comment 4 Jared H. Hudson (RETIRED) gentoo-dev 2004-12-18 11:06:25 UTC
Even though I could not recreate the bug at first I found the bug based on another bug report. Closing. Please reopen if you continue to have problems.