Opened 2 years ago

Closed 23 months ago

Last modified 23 months ago

#66244 closed defect (fixed)

db46 failed in patching mp/mp_region.c on osx 13 Ventura

Reported by: dlamija (Muhammed Ramiza) Owned by: kencu (Ken)
Priority: Normal Milestone:
Component: ports Version: 2.8.0
Keywords: ventura Cc:
Port: db46

Description

Error from main.log

:info:patch patching file 'mp/mp_region.c'
:info:patch 1 out of 1 hunks failed--saving rejects to 'mp/mp_region.c.rej'
:info:patch Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_macports_macports-ports_databases_db46/db46/work/db-4.6.21" && /usr/bin/patch -p0 < '/opt/local/var/macports/distfiles/db4/4.6.21_6/patch.4.6.21.2'

Change History (4)

comment:1 Changed 2 years ago by jmroot (Joshua Root)

Port: +compat185 removed

comment:2 Changed 2 years ago by dmeyer0

the .2 patch appears to have DOS line endings

comment:3 Changed 23 months ago by kencu (Ken)

Owner: set to kencu
Resolution: fixed
Status: newclosed

In 1eb314a2f52ac980eece16c0216876e99667d006/macports-ports (master):

db46: fix patching on Ventura+

the patch command that comes with Ventura does not
handle the variant line endings the way earlier versions
of the patch command did.

use gpatch instead

closes: #66244

comment:4 Changed 23 months ago by kencu (Ken)

You are right, copying that patch file to the files directory and then converting it to UNIX format allows patch to work on Ventura.

I tried using the "--binary" option to patch, which some said worked for this, but it didn't work here on Ventura for me.

One of the patches is fairly large, the last one:

% ls -la
total 23320
drwxr-xr-x  7 macports  wheel       224 28 Dec 19:20 .
drwxr-xr-x  3 root      wheel        96 28 Dec 19:20 ..
-rw-r--r--  1 macports  wheel  11881885 28 Dec 19:20 db-4.6.21.tar.gz
-rw-r--r--  1 macports  wheel      2475 28 Dec 19:20 patch.4.6.21.1
-rw-r--r--  1 macports  wheel       892 28 Dec 19:20 patch.4.6.21.2
-rw-r--r--  1 macports  wheel      1911 28 Dec 19:20 patch.4.6.21.3
-rw-r--r--  1 macports  wheel     41501 28 Dec 19:20 patch.4.6.21.4

and downloading that one at least seems desirable. The .1, .2, and .3 patches could be moved into the files directory, or just the .2 patch moved in there.

It's a bit confusing no matter which option is picked.

this didn't work:

depends_patch-append port:dos2unix
pre-patch {
    system "${prefix}/bin/dos2unix [shellescape ${distpath}/patch.${version}.2]"
}
Executing:  cd "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_databases_db46/db46/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/db4/4.6.21_6/db-4.6.21.tar.gz' | /usr/bin/tar -xf - 
dos2unix: Failed to open temporary output file: Operation not permitted
dos2unix: problems converting file /opt/local/var/macports/distfiles/db4/4.6.21_6/patch.4.6.21.2
Command failed: /opt/local/bin/dos2unix /opt/local/var/macports/distfiles/db4/4.6.21_6/patch.4.6.21.2
Exit code: 1
Error: Failed to patch db46: command execution failed

but this does work:

if {${os.platform} eq "darwin" && ${os.major} >=22 } {
    depends_patch-append port:gpatch
    patch.cmd   ${prefix}/bin/gpatch
    patch.pre_args-append --read-only=ignore
}
Note: See TracTickets for help on using tickets.