Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jul 2013 10:03:16 +0100 (BST)
From:      Anton Shterenlikht <mexas@bris.ac.uk>
To:        freebsd-ports@freebsd.org
Subject:   order of patches under ports/xxx/zzz/files
Message-ID:  <201307100903.r6A93Gdb001317@mech-cluster241.men.bris.ac.uk>

next in thread | raw e-mail | index | archive | help
I'm trying to understand exactly how the patches
located in files directory in a port apply.
For example, port math/metis-edf has under files:

# ls files/
medis-patch-Lib_Makefile.txt    patch-Lib::proto.h              patch-Test::Makefile
patch-CONFIG::configure         patch-Lib_Makefile              patch-onmetis
patch-CONFIG_onmetis.in         patch-Programs::Makefile
# 

Patch medis-patch-Lib_Makefile.txt must be applied
on top of patch-Lib_Makefile. This does seem to
work, but what process makes sure that the order
of patch application is exactly that.

I can see that it works manually:

# cd ./work/metis-edf-4.1/
/usr/ports/math/metis-edf/work/metis-edf-4.1
# patch < ../../files/patch-Lib_Makefile 
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- Lib/Makefile.orig  2008-12-03 11:08:03.000000000 +0100
|+++ Lib/Makefile       2010-05-16 16:33:40.000000000 +0200
--------------------------
Patching file Lib/Makefile using Plan A...
Hunk #1 succeeded at 2.
Hunk #2 succeeded at 22.
done
# patch < ../../files/medis-patch-Lib_Makefile.txt 
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- Lib/Makefile.intermediate  2013-03-22 20:40:34.429173000 +0000
|+++ Lib/Makefile
--------------------------
Patching file Lib/Makefile using Plan A...
Hunk #1 succeeded at 22.
done
# 

and that applying the second patch directly does not
work:

# cd ../..
# make clean extract
===>  Cleaning for metis-edf-4.1.2_3
===>   metis-edf-4.1.2_3 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by metis-edf-4.1.2_3 for building
===>  Extracting for metis-edf-4.1.2_3
=> SHA256 Checksum OK for aster-full-src-10.8.0-3.noarch.tar.gz.
(cd /usr/ports/math/metis-edf/work &&    /usr/bin/tar -xf /usr/ports/math/metis-edf/work/aster-full-src-10.8.0/SRC/metis-edf-4.1-2.noarch.tar.gz --no-same-owner --no-same-permissions)
# cd work/metis-edf-4.1/
# patch < ../../files/medis-patch-Lib_Makefile.txt
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- Lib/Makefile.intermediate  2013-03-22 20:40:34.429173000 +0000
|+++ Lib/Makefile
--------------------------
Patching file Lib/Makefile using Plan A...
Hunk #1 failed at 22.
1 out of 1 hunks failed--saving rejects to Lib/Makefile.rej
done
# 

But how does the ports environment know the order
of patch application?

Thanks

Anton




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307100903.r6A93Gdb001317>