If you don't follow ports-changes, you may not have noticed that I've
finally given up and completely replaced update-patches with perl code.
This allowed me to implement several improvements.
- instead of diffing file.orig and file, if update-patches finds a
file.beforesubst, it will diff file.orig and file.beforesubst,
thus allowing update-patches to work seamlessly with ${SUBST_CMD}
(or perl/sed -i.beforesubst if you need to do things manually)
- newer patches always begin with a much more consistent
Index: file
--- file.orig
+++ file
(without timestamps, because those don't really mean much there).
header, independently of whether PATCHORIG is defined or not. And there is
code to recognize "old" headers as well as possible. This should make
changes to PATCHORIG less painful.
(PATCHORIG can be used as a different extension to .orig when generating
patches in "make patch", so that if files in the original archive end up
in .orig, which often happens with "dirty" software, update-patches is less
painful)
- update-patches can deal with CVS keywords in patches, up to a point.
Specifically, it recognizes those keywords early, and can read thru patches
and "fuzz" them a bit, thus losing a line or two of context, BUT losing
the keyword as well.... it can't do much if the keyword is in the middle
of a chunk though.
e.g., if it starts with something like:
Index: mkspecs/defs.pro
--- mkspecs/defs.pro.orig
+++ mkspecs/defs.pro
@@ -1,6 +1,7 @@
# $Id: defs.pro 606 2004-12-25 03:08:40Z andrew $
-QMAKE_CXXFLAGS_DEBUG += -pedantic
-QMAKE_CXXFLAGS += -pedantic
+QMAKE_CXXFLAGS_DEBUG += ${CXXFLAGS}
+QMAKE_CXXFLAGS += ${CXXFLAGS}
+QMAKE_CXXFLAGS_RELEASE =
win32 {
QMAKE_CFLAGS_THREAD -= -mthreads
It will adjust it to be:
Index: mkspecs/defs.pro
--- mkspecs/defs.pro.orig
+++ mkspecs/defs.pro
@@ -2,5 +2,6 @@
-QMAKE_CXXFLAGS_DEBUG += -pedantic
-QMAKE_CXXFLAGS += -pedantic
+QMAKE_CXXFLAGS_DEBUG += ${CXXFLAGS}
+QMAKE_CXXFLAGS += ${CXXFLAGS}
+QMAKE_CXXFLAGS_RELEASE =
win32 {
QMAKE_CFLAGS_THREAD -= -mthreads
thus getting rid of the problem.
Porters don't have to do anything to take advantage of the improvements.
They should just happen for newer patches, and be 100% compatible with
existin stuff. Thus when you edit a port and regen patches, you may want
to do a few tweaks in the port. The most noticeable is taking advantage
of .beforesubst to avoid having to manually edit patches. Possibly using
${SUBST_CMD} if appropriate, or leaving the old %%LOCALBASE%% and such
constructs, but adding a -i.beforesubst to your sed/perl subst command.