live-bootstrap/steps/python-3.1.5/files/graminit-regen.patch
fosslinux a67db8fcbd 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
2024-12-23 15:20:42 +11:00

31 lines
880 B
Diff

SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: PSF-2.0
There is a cycle in the build process. graminit.h requires
parsetok.c to be built, but graminit.h is included in parsetok.c.
Luckily the cycle can be broken by just NOP-ing the logic from
graminit.h.
We apply this patch before regen-ing graminit.h and revert it
afterward.
--- Python-3.1.5/Parser/parsetok.c 2022-10-11 14:11:29.522466304 +1100
+++ Python-3.1.5/Parser/parsetok.c 2022-10-11 14:11:42.786627172 +1100
@@ -8,7 +8,6 @@
#include "parser.h"
#include "parsetok.h"
#include "errcode.h"
-#include "graminit.h"
/* Forward */
@@ -240,7 +239,7 @@
}
}
} else if (tok->encoding != NULL) {
- node* r = PyNode_New(encoding_decl);
+ node* r = NULL;
if (!r) {
err_ret->error = E_NOMEM;
n = NULL;