Make patches relative to where tarballs are extracted

Ever since an old patch version, it has (for reasonable security
reasons) not supported patched with ../ in the filename.
Many of our patches have been relying on this behaviour being OK,
because we start off with an ancient patch version that didn't perform
such checks. As soon as we need this behaviour after we build a newer
patch though, we will have problems.

So, let's change the policy.
Patches are relative to where tarballs are extracted, rather than the
"working directory" - e.g. have patches for `coreutils-9.4/src/cp.c`
instead of `src/cp.c`.
Keeping this consistent has a few implications;
- patches are applied from the build/ directory in bash era now, with
  `-p0`
- when patches are manually applied in the bash era, use `-p` as
  required, usually `-p1`
- in kaem era where patches are always manually applied, `-p1` is used
This commit is contained in:
fosslinux 2024-12-21 16:50:23 +11:00
parent 749b2bfe37
commit a67db8fcbd
156 changed files with 1265 additions and 1263 deletions

View file

@ -12,8 +12,8 @@ We disable the following programs for the following reasons:
* column: musl incompatibility.
diff --color -ru misc-utils/Makefile.am misc-utils/Makefile.am
--- misc-utils/Makefile.am 2021-06-13 09:34:49.669370352 +1000
+++ misc-utils/Makefile.am 2021-06-13 09:42:06.644523490 +1000
--- util-linux-2.19.1/misc-utils/Makefile.am 2021-06-13 09:34:49.669370352 +1000
+++ util-linux-2.19.1/misc-utils/Makefile.am 2021-06-13 09:42:06.644523490 +1000
@@ -6,8 +6,8 @@
sbin_PROGRAMS =
usrsbin_exec_PROGRAMS =
@ -45,8 +45,8 @@ diff --color -ru misc-utils/Makefile.am misc-utils/Makefile.am
sbin_PROGRAMS += blkid.static
blkid_static_SOURCES = $(blkid_SOURCES)
diff --color -ru sys-utils/Makefile.am sys-utils/Makefile.am
--- sys-utils/Makefile.am 2021-06-13 09:34:49.686370532 +1000
+++ sys-utils/Makefile.am 2021-06-13 09:42:06.644523490 +1000
--- util-linux-2.19.1/sys-utils/Makefile.am 2021-06-13 09:34:49.686370532 +1000
+++ util-linux-2.19.1/sys-utils/Makefile.am 2021-06-13 09:42:06.644523490 +1000
@@ -2,7 +2,7 @@
bin_PROGRAMS =
@ -68,8 +68,8 @@ diff --color -ru sys-utils/Makefile.am sys-utils/Makefile.am
dist_man_MANS += dmesg.1 ctrlaltdel.8 cytune.8 setarch.8 \
diff --color -ru text-utils/Makefile.am text-utils/Makefile.am
--- text-utils/Makefile.am 2021-06-13 09:34:49.696370638 +1000
+++ text-utils/Makefile.am 2021-06-13 09:46:19.230591066 +1000
--- util-linux-2.19.1/text-utils/Makefile.am 2021-06-13 09:34:49.696370638 +1000
+++ util-linux-2.19.1/text-utils/Makefile.am 2021-06-13 09:46:19.230591066 +1000
@@ -2,7 +2,7 @@
EXTRA_DIST = README.clear README.col

View file

@ -5,8 +5,8 @@ SPDX-License-Identifier: GPL-2.0-or-later
The tests/ subfolder is broken and useless unless we run `make test' which we
don't.
--- Makefile.am 2021-06-13 09:50:21.775597435 +1000
+++ Makefile.am 2021-06-13 09:50:10.900501284 +1000
--- util-linux-2.19.1/Makefile.am 2021-06-13 09:50:21.775597435 +1000
+++ util-linux-2.19.1/Makefile.am 2021-06-13 09:50:10.900501284 +1000
@@ -29,8 +29,7 @@
po \
schedutils \

View file

@ -4,8 +4,8 @@ SPDX-License-Identifier: BSD-4-Clause
headers.patch but for files licensed BSD.
--- fdisk/fdiskbsdlabel.c 2021-06-12 16:09:49.519140837 +1000
+++ fdisk/fdiskbsdlabel.c 2021-06-12 16:10:00.875220602 +1000
--- util-linux-2.19.1/fdisk/fdiskbsdlabel.c 2021-06-12 16:09:49.519140837 +1000
+++ util-linux-2.19.1/fdisk/fdiskbsdlabel.c 2021-06-12 16:10:00.875220602 +1000
@@ -53,6 +53,7 @@
#include "nls.h"
@ -14,8 +14,8 @@ headers.patch but for files licensed BSD.
#include "common.h"
#include "fdisk.h"
--- login-utils/ttymsg.c 2021-06-12 16:11:45.911958381 +1000
+++ login-utils/ttymsg.c 2021-06-12 19:09:30.108310127 +1000
--- util-linux-2.19.1/login-utils/ttymsg.c 2021-06-12 16:11:45.911958381 +1000
+++ util-linux-2.19.1/login-utils/ttymsg.c 2021-06-12 19:09:30.108310127 +1000
@@ -51,6 +51,7 @@
#include <stdio.h>
#include <string.h>

View file

@ -4,8 +4,8 @@ SPDX-License-Identifier: GPL-2.0-or-later
headers.patch but for files licensed GPL 2.0 or later.
--- misc-utils/findmnt.c 2021-06-12 19:13:40.306009682 +1000
+++ misc-utils/findmnt.c 2021-06-12 19:13:58.223132046 +1000
--- util-linux-2.19.1/misc-utils/findmnt.c 2021-06-12 19:13:40.306009682 +1000
+++ util-linux-2.19.1/misc-utils/findmnt.c 2021-06-12 19:13:58.223132046 +1000
@@ -30,6 +30,7 @@
#include <sys/ioctl.h>
#endif
@ -14,8 +14,8 @@ headers.patch but for files licensed GPL 2.0 or later.
#define USE_UNSTABLE_LIBMOUNT_API
#include <libmount.h>
--- fsck/fsck.c 2021-06-22 18:30:27.843680552 +1000
+++ fsck/fsck.c 2021-06-22 18:30:41.327764247 +1000
--- util-linux-2.19.1/fsck/fsck.c 2021-06-22 18:30:27.843680552 +1000
+++ util-linux-2.19.1/fsck/fsck.c 2021-06-22 18:30:41.327764247 +1000
@@ -32,6 +32,7 @@
#include <sys/signal.h>
#include <sys/stat.h>

View file

@ -12,8 +12,8 @@ ttymsg.
(This is the main patch file. See -bsd.patch for files with such licensing).
diff --color -ru shlibs/blkid/src/devname.c shlibs/blkid/src/devname.c
--- shlibs/blkid/src/devname.c 2021-06-12 14:24:30.982387640 +1000
+++ shlibs/blkid/src/devname.c 2021-06-12 14:25:42.934921608 +1000
--- util-linux-2.19.1/shlibs/blkid/src/devname.c 2021-06-12 14:24:30.982387640 +1000
+++ util-linux-2.19.1/shlibs/blkid/src/devname.c 2021-06-12 14:25:42.934921608 +1000
@@ -33,6 +33,7 @@
#include <errno.h>
#endif
@ -23,8 +23,8 @@ diff --color -ru shlibs/blkid/src/devname.c shlibs/blkid/src/devname.c
#include "blkidP.h"
diff --color -ru shlibs/blkid/src/devno.c shlibs/blkid/src/devno.c
--- shlibs/blkid/src/devno.c 2021-06-12 14:24:30.987387677 +1000
+++ shlibs/blkid/src/devno.c 2021-06-12 14:25:27.750808925 +1000
--- util-linux-2.19.1/shlibs/blkid/src/devno.c 2021-06-12 14:24:30.987387677 +1000
+++ util-linux-2.19.1/shlibs/blkid/src/devno.c 2021-06-12 14:25:27.750808925 +1000
@@ -31,6 +31,7 @@
#endif
#include <fcntl.h>
@ -34,8 +34,8 @@ diff --color -ru shlibs/blkid/src/devno.c shlibs/blkid/src/devno.c
#include "blkidP.h"
#include "pathnames.h"
diff --color -ru shlibs/blkid/src/partitions/partitions.c shlibs/blkid/src/partitions/partitions.c
--- shlibs/blkid/src/partitions/partitions.c 2021-06-12 14:24:30.983387647 +1000
+++ shlibs/blkid/src/partitions/partitions.c 2021-06-12 14:25:24.326783515 +1000
--- util-linux-2.19.1/shlibs/blkid/src/partitions/partitions.c 2021-06-12 14:24:30.983387647 +1000
+++ util-linux-2.19.1/shlibs/blkid/src/partitions/partitions.c 2021-06-12 14:25:24.326783515 +1000
@@ -19,6 +19,7 @@
#include <stdint.h>
#include <inttypes.h>
@ -45,8 +45,8 @@ diff --color -ru shlibs/blkid/src/partitions/partitions.c shlibs/blkid/src/parti
#include "partitions.h"
diff --color -ru shlibs/blkid/src/topology/evms.c shlibs/blkid/src/topology/evms.c
--- shlibs/blkid/src/topology/evms.c 2021-06-12 14:24:30.984387655 +1000
+++ shlibs/blkid/src/topology/evms.c 2021-06-12 14:25:30.390828517 +1000
--- util-linux-2.19.1/shlibs/blkid/src/topology/evms.c 2021-06-12 14:24:30.984387655 +1000
+++ util-linux-2.19.1/shlibs/blkid/src/topology/evms.c 2021-06-12 14:25:30.390828517 +1000
@@ -19,6 +19,7 @@
#include <sys/stat.h>
#include <sys/types.h>
@ -56,8 +56,8 @@ diff --color -ru shlibs/blkid/src/topology/evms.c shlibs/blkid/src/topology/evms
#include "topology.h"
diff --color -ru shlibs/blkid/src/topology/lvm.c shlibs/blkid/src/topology/lvm.c
--- shlibs/blkid/src/topology/lvm.c 2021-06-12 14:24:30.984387655 +1000
+++ shlibs/blkid/src/topology/lvm.c 2021-06-12 14:25:37.510881355 +1000
--- util-linux-2.19.1/shlibs/blkid/src/topology/lvm.c 2021-06-12 14:24:30.984387655 +1000
+++ util-linux-2.19.1/shlibs/blkid/src/topology/lvm.c 2021-06-12 14:25:37.510881355 +1000
@@ -18,6 +18,7 @@
#include <sys/stat.h>
#include <sys/types.h>
@ -67,8 +67,8 @@ diff --color -ru shlibs/blkid/src/topology/lvm.c shlibs/blkid/src/topology/lvm.c
#include "topology.h"
diff --color -ru shlibs/blkid/src/topology/md.c shlibs/blkid/src/topology/md.c
--- shlibs/blkid/src/topology/md.c 2021-06-12 14:24:30.984387655 +1000
+++ shlibs/blkid/src/topology/md.c 2021-06-12 14:25:34.679860346 +1000
--- util-linux-2.19.1/shlibs/blkid/src/topology/md.c 2021-06-12 14:24:30.984387655 +1000
+++ util-linux-2.19.1/shlibs/blkid/src/topology/md.c 2021-06-12 14:25:34.679860346 +1000
@@ -19,6 +19,7 @@
#include <sys/stat.h>
#include <sys/types.h>
@ -77,8 +77,8 @@ diff --color -ru shlibs/blkid/src/topology/md.c shlibs/blkid/src/topology/md.c
#include "topology.h"
--- shlibs/blkid/src/topology/dm.c 2021-06-12 14:29:01.195392922 +1000
+++ shlibs/blkid/src/topology/dm.c 2021-06-12 14:29:05.897427816 +1000
--- util-linux-2.19.1/shlibs/blkid/src/topology/dm.c 2021-06-12 14:29:01.195392922 +1000
+++ util-linux-2.19.1/shlibs/blkid/src/topology/dm.c 2021-06-12 14:29:05.897427816 +1000
@@ -18,6 +18,7 @@
#include <sys/stat.h>
#include <sys/types.h>
@ -88,8 +88,8 @@ diff --color -ru shlibs/blkid/src/topology/md.c shlibs/blkid/src/topology/md.c
#include "topology.h"
diff --color -ru shlibs/blkid/src/evaluate.c shlibs/blkid/src/evaluate.c
--- shlibs/blkid/src/evaluate.c 2021-06-12 16:11:45.893958255 +1000
+++ shlibs/blkid/src/evaluate.c 2021-06-12 16:12:20.652202397 +1000
--- util-linux-2.19.1/shlibs/blkid/src/evaluate.c 2021-06-12 16:11:45.893958255 +1000
+++ util-linux-2.19.1/shlibs/blkid/src/evaluate.c 2021-06-12 16:12:20.652202397 +1000
@@ -21,6 +21,7 @@
#endif
#include <stdint.h>
@ -99,8 +99,8 @@ diff --color -ru shlibs/blkid/src/evaluate.c shlibs/blkid/src/evaluate.c
#include "pathnames.h"
#include "canonicalize.h"
diff --color -ru shlibs/mount/src/fs.c shlibs/mount/src/fs.c
--- shlibs/mount/src/fs.c 2021-06-12 16:11:45.897958283 +1000
+++ shlibs/mount/src/fs.c 2021-06-12 16:12:14.812161377 +1000
--- util-linux-2.19.1/shlibs/mount/src/fs.c 2021-06-12 16:11:45.897958283 +1000
+++ util-linux-2.19.1/shlibs/mount/src/fs.c 2021-06-12 16:12:14.812161377 +1000
@@ -18,6 +18,7 @@
#include <errno.h>
#include <blkid.h>
@ -109,8 +109,8 @@ diff --color -ru shlibs/mount/src/fs.c shlibs/mount/src/fs.c
#include "nls.h"
#include "mountP.h"
--- shlibs/mount/src/tab_parse.c 2021-06-12 19:04:38.773393353 +1000
+++ shlibs/mount/src/tab_parse.c 2021-06-12 19:04:51.115474555 +1000
--- util-linux-2.19.1/shlibs/mount/src/tab_parse.c 2021-06-12 19:04:38.773393353 +1000
+++ util-linux-2.19.1/shlibs/mount/src/tab_parse.c 2021-06-12 19:04:51.115474555 +1000
@@ -14,6 +14,7 @@
#include <dirent.h>
#include <fcntl.h>

View file

@ -6,8 +6,8 @@ We don't have pkg-config, hence:
a) disable gtk-doc (uses pkg-config exclusively)
b) disable pkg-config type checks
--- configure.ac 2021-06-12 11:23:41.719074631 +1000
+++ configure.ac 2021-06-12 11:26:17.748153926 +1000
--- util-linux-2.19.1/configure.ac 2021-06-12 11:23:41.719074631 +1000
+++ util-linux-2.19.1/configure.ac 2021-06-12 11:26:17.748153926 +1000
@@ -84,9 +84,6 @@
dnl libtool-2
LT_INIT
@ -80,8 +80,8 @@ b) disable pkg-config type checks
shlibs/mount/samples/Makefile
shlibs/uuid/uuid.pc
shlibs/uuid/Makefile
--- shlibs/mount/Makefile.am.bak 2021-06-12 11:32:07.578612839 +1000
+++ shlibs/mount/Makefile.am 2021-06-12 11:32:20.247701887 +1000
--- util-linux-2.19.1/shlibs/mount/Makefile.am.bak 2021-06-12 11:32:07.578612839 +1000
+++ util-linux-2.19.1/shlibs/mount/Makefile.am 2021-06-12 11:32:20.247701887 +1000
@@ -2,11 +2,6 @@
SUBDIRS = src samples
@ -94,8 +94,8 @@ b) disable pkg-config type checks
pkgconfigdir = $(usrlib_execdir)/pkgconfig
pkgconfig_DATA = mount.pc
--- shlibs/blkid/Makefile.am.bak 2021-06-12 11:32:03.546584499 +1000
+++ shlibs/blkid/Makefile.am 2021-06-12 11:32:10.790635416 +1000
--- util-linux-2.19.1/shlibs/blkid/Makefile.am.bak 2021-06-12 11:32:03.546584499 +1000
+++ util-linux-2.19.1/shlibs/blkid/Makefile.am 2021-06-12 11:32:10.790635416 +1000
@@ -2,10 +2,6 @@
SUBDIRS = src samples