main/*: remove unused patches

This commit is contained in:
ptrcnull 2024-01-04 22:58:42 +01:00 committed by Patrycja Rosa
parent 37bd7e111e
commit 8f69b7f403
27 changed files with 0 additions and 2114 deletions

View File

@ -1,35 +0,0 @@
As some firmware paths are hardcoded, replace them with /lib/firmware
----
--- a/tools/hciattach_bcm43xx.c
+++ b/tools/hciattach_bcm43xx.c
@@ -31,7 +31,7 @@
#include "hciattach.h"
#ifndef FIRMWARE_DIR
-#define FIRMWARE_DIR "/etc/firmware"
+#define FIRMWARE_DIR "/lib/firmware"
#endif
#define FW_EXT ".hcd"
--- a/tools/hciattach_qualcomm.c
+++ b/tools/hciattach_qualcomm.c
@@ -222,7 +222,7 @@
} while (resp[3] != 0 && resp[4] != 2);
- snprintf(fw, sizeof(fw), "/etc/firmware/%c%c%c%c%c%c_%c%c%c%c.bin",
+ snprintf(fw, sizeof(fw), "/lib/firmware/%c%c%c%c%c%c_%c%c%c%c.bin",
resp[18], resp[19], resp[20], resp[21],
resp[22], resp[23],
resp[32], resp[33], resp[34], resp[35]);
--- a/tools/hciattach_tialt.c
+++ b/tools/hciattach_tialt.c
@@ -221,7 +221,7 @@
((brf_chip > 7) ? "unknown" : c_brf_chip[brf_chip]),
brf_chip);
- sprintf(fw, "/etc/firmware/%s.bin", c_brf_chip[brf_chip]);
+ sprintf(fw, "/lib/firmware/%s.bin", c_brf_chip[brf_chip]);
texas_load_firmware(fd, fw);
texas_change_speed(fd, speed);

View File

@ -1,12 +0,0 @@
fix compilation for ppc64le: mesh-cfgtest.c:1347:18: error: 'PATH_MAX' undeclared
----
--- a/tools/mesh-cfgtest.c
+++ b/tools/mesh-cfgtest.c
@@ -21,6 +21,7 @@
#include <ftw.h>
#include <getopt.h>
#include <libgen.h>
+#include <limits.h>
#include <signal.h>
#include <stdio.h>
#include <time.h>

View File

@ -1,88 +0,0 @@
From 33d5e8f7066116bd0a706c7cdda4950895164d34 Mon Sep 17 00:00:00 2001
From: Lars Ellenberg <lars.ellenberg@linbit.com>
Date: Wed, 9 Nov 2022 11:01:54 +0100
Subject: [PATCH] drbdadm: drop use of GLOB_MAGCHAR, use strchr heuristic only
Fixup for
2022-09-05 4a1b5900 drbdadm: allow files from an expanded include glob to vanish
When using the `include` statement, if the glob did not match any file,
there is nothing to do, silently ignore. Unless it was no glob, but a literal,
which we would expect to exist.
Also, there is a race between expanding a glob and accessing the file.
That also should not happen for literals, though.
Since we still had the heuristic anyways, because apparently |GLOB_MAGCHAR
does not happen for GLOB_NOMATCH returns, and there exist non-GNU libc that
don't (and likely won't) implement that extension, just forget about
(gl_flags & GLOB_MAGCHAR) but use the incomplete strchr heuristic only.
---
user/v9/drbdadm_parser.c | 35 ++++++++++++++++++++---------------
1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/user/v9/drbdadm_parser.c b/user/v9/drbdadm_parser.c
index 616ec0aa..4d9d7f99 100644
--- a/user/v9/drbdadm_parser.c
+++ b/user/v9/drbdadm_parser.c
@@ -1966,14 +1966,29 @@ void include_stmt(char *str)
size_t i;
int r;
- cwd = pushd_to_current_config_file_unless_stdin();
-
- /* """
+ /*
+ * If the glob did not match any file,
+ * there is nothing to do, silently ignore.
+ * Unless it was no glob, but a literal,
+ * which we would expect to exist.
+ *
+ * """
* As a GNU extension, pglob->gl_flags is set to the
* flags specified, ored with GLOB_MAGCHAR if any
* metacharacters were found.
* """
+ *
+ * But apparently |GLOB_MAGCHAR does not happen for GLOB_NOMATCH returns,
+ * at least not consistently :-(
+ * Also, there exist non-GNU libc
+ * So we have this incomplete strchr heuristic anyways.
*/
+ bool contains_glob_magic_char =
+ strchr(str, '*') ||
+ strchr(str, '?') ||
+ strchr(str, '[');
+
+ cwd = pushd_to_current_config_file_unless_stdin();
r = glob(str, 0, NULL, &glob_buf);
if (r == 0) {
for (i=0; i<glob_buf.gl_pathc; i++) {
@@ -1984,7 +1999,7 @@ void include_stmt(char *str)
if (f) {
include_file(f, strdup(glob_buf.gl_pathv[i]));
fclose(f);
- } else if (errno == ENOENT && glob_buf.gl_flags & GLOB_MAGCHAR) {
+ } else if (errno == ENOENT && contains_glob_magic_char) {
/* Noisily ignore race between glob expansion
* and actual open. */
err("%s:%d: include file vanished after glob expansion '%s'.\n",
@@ -1998,17 +2013,7 @@ void include_stmt(char *str)
}
globfree(&glob_buf);
} else if (r == GLOB_NOMATCH) {
- /*
- * If the glob did not match any file,
- * there is nothing to do, silently ignore.
- * Unless it was no glob, but a literal,
- * which we would expect to exist.
- * Apparently |GLOB_MAGCHAR does not happen for GLOB_NOMATCH returns,
- * at least not consistently :-(
- * So we have this strchr heuristic anyways.
- */
- /* if (!(glob_buf.gl_flags & GLOB_MAGCHAR)) { */
- if (!strchr(str, '?') && !strchr(str, '*') && !strchr(str, '[')) {
+ if (!contains_glob_magic_char) {
err("%s:%d: Failed to open include file '%s'.\n",
config_save, line, str);
config_valid = 0;

View File

@ -1,18 +0,0 @@
--- a/lib/libf2fs_io.c
+++ b/lib/libf2fs_io.c
@@ -67,15 +67,6 @@
return -1;
}
-#ifndef HAVE_LSEEK64
-typedef off_t off64_t;
-
-static inline off64_t lseek64(int fd, __u64 offset, int set)
-{
- return lseek(fd, offset, set);
-}
-#endif
-
/* ---------- dev_cache, Least Used First (LUF) policy ------------------- */
/*
* Least used block will be the first victim to be replaced when max hash

View File

@ -1,33 +0,0 @@
From ea3f17d598d550345e94e4571130e429443e91cb Mon Sep 17 00:00:00 2001
From: Emmanuele Bassi <ebassi@gnome.org>
Date: Sun, 25 Sep 2022 14:20:24 +0100
Subject: [PATCH] Empty values are not valid GParamSpec
The validate() vfunc for GParamSpecParam returns FALSE for empty GValue,
which means the is_valid() vfunc should do the same.
This avoids a segfault when calling g_param_value_is_valid() on a
GParamSpecParam.
Fixes: #2770
---
gobject/gparamspecs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gobject/gparamspecs.c b/gobject/gparamspecs.c
index f17b3488b9..17b8606572 100644
--- a/gobject/gparamspecs.c
+++ b/gobject/gparamspecs.c
@@ -894,6 +894,9 @@ param_param_is_valid (GParamSpec *pspec,
{
GParamSpec *param = value->data[0].v_pointer;
+ if (param == NULL)
+ return FALSE;
+
return g_value_type_compatible (G_PARAM_SPEC_TYPE (param), G_PARAM_SPEC_VALUE_TYPE (pspec));
}
--
GitLab

View File

@ -1,93 +0,0 @@
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Date: Thu, 7 Sep 2017 18:41:10 -0400
Subject: gpg: default to 3072-bit keys.
* agent/command.c (hlp_genkey): update help text to suggest the use of
3072 bits.
* doc/wks.texi: Make example match default generation.
* g10/keygen.c (gen_elg): update default from 2048 to 3072.
* g10/keyid.c (pubkey_string): update comment so that first example
is the default 3072-bit RSA.
--
3072-bit RSA is widely considered to be 128-bit-equivalent security.
This is a sensible default in 2017.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
(cherry picked from commit 909fbca19678e6e36968607e8a2348381da39d8c)
---
agent/command.c | 2 +-
doc/wks.texi | 4 ++--
g10/keygen.c | 2 +-
g10/keyid.c | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
Patch-Source: https://sources.debian.org/data/main/g/gnupg2/2.2.27-2/debian/patches/from-master/gpg-default-to-3072-bit-keys.patch
diff --git a/agent/command.c b/agent/command.c
index 8642498..f94e770 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -843,7 +843,7 @@ static const char hlp_genkey[] =
"\n"
" C: GENKEY\n"
" S: INQUIRE KEYPARAM\n"
- " C: D (genkey (rsa (nbits 2048)))\n"
+ " C: D (genkey (rsa (nbits 3072)))\n"
" C: END\n"
" S: D (public-key\n"
" S: D (rsa (n 326487324683264) (e 10001)))\n"
diff --git a/doc/wks.texi b/doc/wks.texi
index 119e31c..ae6c310 100644
--- a/doc/wks.texi
+++ b/doc/wks.texi
@@ -412,10 +412,10 @@ the submission address:
The output of the last command looks similar to this:
@example
- sec rsa2048 2016-08-30 [SC]
+ sec rsa3072 2016-08-30 [SC]
C0FCF8642D830C53246211400346653590B3795B
uid [ultimate] key-submission@@example.net
- ssb rsa2048 2016-08-30 [E]
+ ssb rsa3072 2016-08-30 [E]
@end example
Take the fingerprint from that output and manually publish the key:
diff --git a/g10/keygen.c b/g10/keygen.c
index d50acf8..79d4579 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -1436,7 +1436,7 @@ gen_elg (int algo, unsigned int nbits, KBNODE pub_root,
if (nbits < 1024)
{
- nbits = 2048;
+ nbits = 3072;
log_info (_("keysize invalid; using %u bits\n"), nbits );
}
else if (nbits > 4096)
diff --git a/g10/keyid.c b/g10/keyid.c
index 69d85da..2987287 100644
--- a/g10/keyid.c
+++ b/g10/keyid.c
@@ -73,7 +73,7 @@ pubkey_letter( int algo )
is copied to the supplied buffer up a length of BUFSIZE-1.
Examples for the output are:
- "rsa2048" - RSA with 2048 bit
+ "rsa3072" - RSA with 3072 bit
"elg1024" - Elgamal with 1024 bit
"ed25519" - ECC using the curve Ed25519.
"E_1.2.3.4" - ECC using the unsupported curve with OID "1.2.3.4".
@@ -83,7 +83,7 @@ pubkey_letter( int algo )
If the option --legacy-list-mode is active, the output use the
legacy format:
- "2048R" - RSA with 2048 bit
+ "3072R" - RSA with 3072 bit
"1024g" - Elgamal with 1024 bit
"256E" - ECDSA using a curve with 256 bit

View File

@ -1,25 +0,0 @@
From 01373f6fd5dd274116c8ec693245677dbf5390e6 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Sun, 28 Oct 2012 07:25:40 -0400
Subject: [PATCH] install shared lib with +x perms
This is executable code, so it should have +x perms on the file.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
src/Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Makefile.in b/src/Makefile.in
index d3b1dcd..6b60ad3 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -113,7 +113,7 @@ install: check
# 2.x goes along; unfortunately that means an additional
# headache in cases like this
if test "x@SHLIB@" != "x" ; then \
- $(INSTALL_DATA) -m 644 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@ ; \
+ $(INSTALL_DATA) -m 755 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@ ; \
cd $(libdir) && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so.@abi_lev@ ; \
echo "WARNING: We installed a lib, you should now call ldconfig" ; \
echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.@abi_full@" ; \

View File

@ -1,13 +0,0 @@
--- gross-1.0.2.orig/include/utils.h
+++ gross-1.0.2/include/utils.h
@@ -39,7 +39,9 @@
#endif /* ! USE_GETTIMEOFDAY */
int readline(int fd, void *vptr, size_t maxlen);
+#if 0
int getline(int fd, char *line, size_t maxlen);
+#endif
ssize_t readn(int fd, void *vptr, size_t n);
ssize_t writen(int fd, const void *vptr, size_t n);
ssize_t writeline(int fd, const char *line);

View File

@ -1,22 +0,0 @@
From ac938e2ecb48ab4dd21298126c7921689d60571b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Tue, 12 Nov 2019 20:03:15 +0000
Subject: [PATCH] invalid read memory access #624
---
src/hunspell/suggestmgr.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hunspell/suggestmgr.cxx b/src/hunspell/suggestmgr.cxx
index dba084e9..c23f165a 100644
--- a/src/hunspell/suggestmgr.cxx
+++ b/src/hunspell/suggestmgr.cxx
@@ -2040,7 +2040,7 @@ int SuggestMgr::leftcommonsubstring(
int l2 = su2.size();
// decapitalize dictionary word
if (complexprefixes) {
- if (su1[l1 - 1] == su2[l2 - 1])
+ if (l1 && l2 && su1[l1 - 1] == su2[l2 - 1])
return 1;
} else {
unsigned short idx = su2.empty() ? 0 : (su2[0].h << 8) + su2[0].l;

View File

@ -1,142 +0,0 @@
https://sourceforge.net/p/iaxmodem/code/46/
https://sourceforge.net/p/iaxmodem/discussion/497500/thread/b2469a0d1a/
Index: iaxmodem.c
===================================================================
--- ./iaxmodem.c (revision 45)
+++ ./iaxmodem.c (working copy)
@@ -543,7 +543,7 @@
printlog(LOG_INFO, "Answering\n");
/* Unset V.24 Circuit 125, "ring indicator". */
- int tioflags;
+ int tioflags = 0;
ioctl(aslave, TIOCMGET, &tioflags);
tioflags &= ~TIOCM_RI;
ioctl(aslave, TIOCMSET, &tioflags);
@@ -762,7 +762,7 @@
int16_t iaxbuf[VOIP_PACKET_SIZE];
static t31_state_t t31_state;
int t31buflen;
- int tioflags;
+ int tioflags = 0;
struct group *grent;
char *devgroup;
char *pmode;
Index: lib/libiax2/src/iax.c
===================================================================
--- ./lib/libiax2/src/iax.c (revision 45)
+++ ./lib/libiax2/src/iax.c (working copy)
@@ -3283,20 +3283,7 @@
/* It's been acked. No need to send it. Destroy the old
frame. If final, destroy the session. */
if (frame->final)
- /* sskacar: Quick deallocation and allocation of sessions may result in
- the same-address-use ! Therefore we cannot trust remote-sent address only
- Best bet is checking by somewhat unique properties to decide
- if we really intend to destroy this session.
- Example Case:
- - Have a call
- - Dump that call and immediately request a new call (or have a incoming call request by a lesser chance)
- - By considerable probability, you might get the previous address for the session.
- - When execution hits to this point as a result of previous call ending
- (as client informs server about dumping and frees the previous session,
- server proccess call-dumping and eventually this point reached)
- - frame->session param to the destroy_session() belongs to the new & valid session ! */
- if (frame->session && (frame->callno == frame->session->callno))
- destroy_session(frame->session);
+ destroy_session(frame->session);
if (frame->data)
free(frame->data);
free(frame);
Index: lib/spandsp/src/at_interpreter.c
===================================================================
--- ./lib/spandsp/src/at_interpreter.c (revision 45)
+++ ./lib/spandsp/src/at_interpreter.c (working copy)
@@ -44,6 +44,7 @@
#include <string.h>
#include <ctype.h>
#include <assert.h>
+#include <syslog.h>
#include "spandsp/telephony.h"
#include "spandsp/logging.h"
@@ -672,43 +673,6 @@
}
/*- End of function --------------------------------------------------------*/
-static int parse_string_out(at_state_t *s, const char **t, char **target, const char *prefix)
-{
- char buf[100];
-
- switch (*(*t)++)
- {
- case '=':
- switch (**t)
- {
- case '?':
- /* Show possible values */
- (*t)++;
- snprintf(buf, sizeof(buf), "%s", (prefix) ? prefix : "");
- at_put_response(s, buf);
- break;
- default:
- /* Set value */
- if (*target)
- free(*target);
- /* If this strdup fails, it should be harmless */
- *target = strdup(*t);
- break;
- }
- break;
- case '?':
- /* Show current index value */
- at_put_response(s, (*target) ? *target : "");
- break;
- default:
- return FALSE;
- }
- while (*t)
- t++;
- return TRUE;
-}
-/*- End of function --------------------------------------------------------*/
-
static const char *s_reg_handler(at_state_t *s, const char *t, int reg)
{
int val;
@@ -4965,10 +4929,31 @@
{
/* Extension of V.253 +VCID, Set calling number ID */
t += 5;
- if (!parse_string_out(s, &t, &s->local_id, NULL))
+ switch (*t)
+ {
+ case '=':
+ switch (*(t+1))
+ {
+ case '?':
+ /* Show possible values */
+ at_put_response(s, "");
+ break;
+ default:
+ /* Set value */
+ s->local_id = strdup(t + 1);
+ if (at_modem_control(s, AT_MODEM_CONTROL_SETID, s->local_id) < 0)
+ return NULL;
+ break;
+ }
+ break;
+ case '?':
+ /* Show current index value from def */
+ at_put_response(s, (s->local_id) ? s->local_id : "");
+ break;
+ default:
return NULL;
- if (at_modem_control(s, AT_MODEM_CONTROL_SETID, s->local_id) < 0)
- return NULL;
+ }
+ while (*t) t++;
return t;
}
/*- End of function --------------------------------------------------------*/

View File

@ -1,11 +0,0 @@
--- a/Makefile.in
+++ b/Makefile.in
@@ -467,7 +467,7 @@
install_doc: install_doc_html install_doc_man
-install: install_bin install_include install_lib install_doc
+install: install_include install_lib install_doc
tests_unit: $(TESTS_UNIT:$(srcroot)%.c=$(objroot)%$(EXE))
tests_integration: $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%$(EXE)) $(TESTS_INTEGRATION_CPP:$(srcroot)%.cpp=$(objroot)%$(EXE))

View File

@ -1,11 +0,0 @@
--- a/field.c.orig 2008-05-05 09:49:15.000000000 -0400
+++ b/field.c 2008-05-05 09:49:25.000000000 -0400
@@ -291,7 +291,7 @@
end = *ptr + length;
- while (end - *ptr > 0) {
+ while (end - *ptr > 0 && **ptr != '\0') {
ucs4 = id3_parse_string(ptr, end - *ptr, *encoding, 0);
if (ucs4 == 0)
goto fail;

View File

@ -1,94 +0,0 @@
diff --git a/lib/inet6_gr.c b/lib/inet6_gr.c
index 72b4a66..2361809 100644
--- a/lib/inet6_gr.c
+++ b/lib/inet6_gr.c
@@ -23,7 +23,7 @@
#include <string.h>
#include <stdio.h>
#include <unistd.h>
-#ifndef __GLIBC__
+#ifdef HAVE_IPV6_ROUTE_H
#include <netinet6/ipv6_route.h> /* glibc doesn't have this */
#endif
#include "version.h"
diff --git a/lib/inet6_sr.c b/lib/inet6_sr.c
index 1ad9510..96dbd5f 100644
--- a/lib/inet6_sr.c
+++ b/lib/inet6_sr.c
@@ -23,10 +23,10 @@
#include <string.h>
#include <stdio.h>
#include <unistd.h>
-#ifdef __GLIBC__
-#include <net/route.h>
-#else
+#ifdef HAVE_IPV6_ROUTE_H
#include <netinet6/ipv6_route.h> /* glibc does not have this */
+#else
+#include <net/route.h>
#endif
#include "version.h"
#include "net-support.h"
diff --git a/lib/inet_sr.c b/lib/inet_sr.c
index 1a876ae..6a26a76 100644
--- a/lib/inet_sr.c
+++ b/lib/inet_sr.c
@@ -26,6 +26,7 @@
#include <string.h>
#include <stdio.h>
#include <unistd.h>
+#include <asm-generic/param.h>
#include "version.h"
#include "net-support.h"
#include "pathnames.h"
diff --git a/lib/util-ank.c b/lib/util-ank.c
index b077f35..4ee59f6 100644
--- a/lib/util-ank.c
+++ b/lib/util-ank.c
@@ -14,6 +14,7 @@
* Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
*/
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/mii-tool.c b/mii-tool.c
index 1cfecc2..fbc3b34 100644
--- a/mii-tool.c
+++ b/mii-tool.c
@@ -46,10 +46,6 @@
#include <net/if.h>
#include <linux/sockios.h>
-#ifndef __GLIBC__
-#include <linux/if_arp.h>
-#include <linux/if_ether.h>
-#endif
#include <linux/mii.h>
#include <linux/sockios.h>
#include "version.h"
diff --git a/netstat.c b/netstat.c
index d0c364f..8453f18 100644
--- a/netstat.c
+++ b/netstat.c
@@ -88,6 +88,7 @@
#include <sys/stat.h>
#include <net/if.h>
#include <dirent.h>
+#include <asm-generic/param.h>
#include "net-support.h"
#include "pathnames.h"
diff --git a/slattach.c b/slattach.c
index 5c81584..3ccde28 100644
--- a/slattach.c
+++ b/slattach.c
@@ -44,6 +44,7 @@
#include <string.h>
#include <unistd.h>
#include <getopt.h>
+#include <termios.h>
#include <linux/if_slip.h>
#if defined(__GLIBC__)

View File

@ -1,24 +0,0 @@
Patch-Source: https://github.com/leev/ngx_http_geoip2_module/commit/df09bbb10a6717dac6b73a4eef3ad15afa071957
--
From df09bbb10a6717dac6b73a4eef3ad15afa071957 Mon Sep 17 00:00:00 2001
From: Lee Valentine <lee@leev.net>
Date: Wed, 14 Jun 2023 10:17:41 -0500
Subject: [PATCH] Fix #90: segfault on bad auto reload value
---
ngx_http_geoip2_module.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ngx_http_geoip2_module.c b/ngx_http_geoip2_module.c
index 4b3461c..4667796 100644
--- a/ngx_http_geoip2_module.c
+++ b/ngx_http_geoip2_module.c
@@ -451,7 +451,7 @@ ngx_http_geoip2_parse_config(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
if (interval == (time_t) NGX_ERROR) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"invalid interval for auto_reload \"%V\"",
- value[1]);
+ &value[1]);
return NGX_CONF_ERROR;
}

View File

@ -1,25 +0,0 @@
From 0cb6851315f2fa4e8c6551e2f5fcabe540c382c8 Mon Sep 17 00:00:00 2001
From: Leonardo Arena <rnalrd@alpinelinux.org>
Date: Wed, 16 Feb 2022 08:52:48 +0000
Subject: [PATCH] Don't use GNU sed
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 8c9be16..52fc99f 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@
# that you want everything installed into.
DESTDIR ?=
-SED = /usr/bin/sed
+SED = /bin/sed
prefix = /usr
exec_prefix = /
--
2.35.1

View File

@ -1,120 +0,0 @@
From c0cf45c77c8ff72b141605a0d7ec79d2cd577ee8 Mon Sep 17 00:00:00 2001
From: Kui-Feng Lee <kuifeng@fb.com>
Date: Wed, 26 Jan 2022 11:20:39 -0800
Subject: [PATCH] libbpf: Update libbpf to the latest git HEAD
Replace deprecated APIs with new ones.
Signed-off-by: Kui-Feng Lee <kuifeng@fb.com>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: bpf@vger.kernel.org
Cc: dwarves@vger.kernel.org
Link: https://lore.kernel.org/r/20220126192039.2840752-5-kuifeng@fb.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
Upstream commit 73383b3a39afe86b22e098773e47b8546c48a649
not strictly required but fixes incompatibilities when building with
libbpf 0.7.0
btf_encoder.c | 20 ++++++++++----------
btf_loader.c | 2 +-
lib/bpf | 2 +-
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/btf_encoder.c b/btf_encoder.c
index 9d015f304e92..4aa003b6aa54 100644
--- a/btf_encoder.c
+++ b/btf_encoder.c
@@ -172,7 +172,7 @@ __attribute ((format (printf, 5, 6)))
static void btf__log_err(const struct btf *btf, int kind, const char *name,
bool output_cr, const char *fmt, ...)
{
- fprintf(stderr, "[%u] %s %s", btf__get_nr_types(btf) + 1,
+ fprintf(stderr, "[%u] %s %s", btf__type_cnt(btf),
btf_kind_str[kind], name ?: "(anon)");
if (fmt && *fmt) {
@@ -203,7 +203,7 @@ static void btf_encoder__log_type(const struct btf_encoder *encoder, const struc
out = err ? stderr : stdout;
fprintf(out, "[%u] %s %s",
- btf__get_nr_types(btf), btf_kind_str[kind],
+ btf__type_cnt(btf) - 1, btf_kind_str[kind],
btf__printable_name(btf, t->name_off));
if (fmt && *fmt) {
@@ -449,10 +449,10 @@ static int btf_encoder__add_field(struct btf_encoder *encoder, const char *name,
int err;
err = btf__add_field(btf, name, type, offset, bitfield_size);
- t = btf__type_by_id(btf, btf__get_nr_types(btf));
+ t = btf__type_by_id(btf, btf__type_cnt(btf) - 1);
if (err) {
fprintf(stderr, "[%u] %s %s's field '%s' offset=%u bit_size=%u type=%u Error emitting field\n",
- btf__get_nr_types(btf), btf_kind_str[btf_kind(t)],
+ btf__type_cnt(btf) - 1, btf_kind_str[btf_kind(t)],
btf__printable_name(btf, t->name_off),
name, offset, bitfield_size, type);
} else {
@@ -899,9 +899,9 @@ static int btf_encoder__write_raw_file(struct btf_encoder *encoder)
const void *raw_btf_data;
int fd, err;
- raw_btf_data = btf__get_raw_data(encoder->btf, &raw_btf_size);
+ raw_btf_data = btf__raw_data(encoder->btf, &raw_btf_size);
if (raw_btf_data == NULL) {
- fprintf(stderr, "%s: btf__get_raw_data failed!\n", __func__);
+ fprintf(stderr, "%s: btf__raw_data failed!\n", __func__);
return -1;
}
@@ -976,7 +976,7 @@ static int btf_encoder__write_elf(struct btf_encoder *encoder)
}
}
- raw_btf_data = btf__get_raw_data(btf, &raw_btf_size);
+ raw_btf_data = btf__raw_data(btf, &raw_btf_size);
if (btf_data) {
/* Existing .BTF section found */
@@ -1043,10 +1043,10 @@ int btf_encoder__encode(struct btf_encoder *encoder)
btf_encoder__add_datasec(encoder, PERCPU_SECTION);
/* Empty file, nothing to do, so... done! */
- if (btf__get_nr_types(encoder->btf) == 0)
+ if (btf__type_cnt(encoder->btf) == 1)
return 0;
- if (btf__dedup(encoder->btf, NULL, NULL)) {
+ if (btf__dedup(encoder->btf, NULL)) {
fprintf(stderr, "%s: btf__dedup failed!\n", __func__);
return -1;
}
@@ -1403,7 +1403,7 @@ void btf_encoder__delete(struct btf_encoder *encoder)
int btf_encoder__encode_cu(struct btf_encoder *encoder, struct cu *cu)
{
- uint32_t type_id_off = btf__get_nr_types(encoder->btf);
+ uint32_t type_id_off = btf__type_cnt(encoder->btf) - 1;
struct llvm_annotation *annot;
int btf_type_id, tag_type_id;
uint32_t core_id;
diff --git a/btf_loader.c b/btf_loader.c
index 7a5b16ff393e..c7d69ccea4d3 100644
--- a/btf_loader.c
+++ b/btf_loader.c
@@ -399,7 +399,7 @@ static int btf__load_types(struct btf *btf, struct cu *cu)
uint32_t type_index;
int err;
- for (type_index = 1; type_index <= btf__get_nr_types(btf); type_index++) {
+ for (type_index = 1; type_index < btf__type_cnt(btf); type_index++) {
const struct btf_type *type_ptr = btf__type_by_id(btf, type_index);
uint32_t type = btf_kind(type_ptr);
--
2.35.1

View File

@ -1,12 +0,0 @@
diff --git a/Makefile.PL b/Makefile.PL
index 9e6cf51..333c7cd 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -5,6 +5,7 @@
#
use 5.007002;
use strict;
+BEGIN { push @INC, '.'; }
use inc::Module::Install;
use Config;

View File

@ -1,136 +0,0 @@
From fe830674abd4926d96d38f9992f3e31b00cd891a Mon Sep 17 00:00:00 2001
From: Stephen Finucane <stephenfin@redhat.com>
Date: Thu, 25 Feb 2021 11:37:42 +0000
Subject: [PATCH 2/4] Fix tests on Python 3.9
I'm not entirely sure this is correct, but it's the only thing I can
find related to changes in classmethod in Python 3.9.
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
---
fixtures/_fixtures/monkeypatch.py | 9 +++-
fixtures/tests/_fixtures/test_monkeypatch.py | 48 ++++++++++++++------
2 files changed, 42 insertions(+), 15 deletions(-)
diff --git a/fixtures/_fixtures/monkeypatch.py b/fixtures/_fixtures/monkeypatch.py
index b5e8564..710a79c 100644
--- a/fixtures/_fixtures/monkeypatch.py
+++ b/fixtures/_fixtures/monkeypatch.py
@@ -83,9 +83,11 @@ def _coerce_values(obj, name, new_value, sentinel):
# bound state rather than having it bound to the new object
# it has been patched onto.
captured_method = new_value
+
@functools.wraps(old_value)
def avoid_get(*args, **kwargs):
return captured_method(*args, **kwargs)
+
new_value = avoid_get
return (new_value, old_value)
@@ -138,18 +140,21 @@ def _setUp(self):
__import__(location, {}, {})
except ImportError:
pass
+
components = location.split('.')
current = __import__(components[0], {}, {})
for component in components[1:]:
current = getattr(current, component)
sentinel = object()
- new_value, old_value = _coerce_values(current, attribute,
- self.new_value, sentinel)
+ new_value, old_value = _coerce_values(
+ current, attribute, self.new_value, sentinel)
+
if self.new_value is self.delete:
if old_value is not sentinel:
delattr(current, attribute)
else:
setattr(current, attribute, new_value)
+
if old_value is sentinel:
self.addCleanup(self._safe_delete, current, attribute)
else:
diff --git a/fixtures/tests/_fixtures/test_monkeypatch.py b/fixtures/tests/_fixtures/test_monkeypatch.py
index 6f11fab..746f6dd 100644
--- a/fixtures/tests/_fixtures/test_monkeypatch.py
+++ b/fixtures/tests/_fixtures/test_monkeypatch.py
@@ -14,6 +14,7 @@
# limitations under that license.
import functools
+import sys
import testtools
from testtools.matchers import Is
@@ -32,7 +33,7 @@ def foo_cls(cls): pass
class D(object):
def bar(self): pass
- def bar_two_args(self, arg):
+ def bar_two_args(self, arg=None):
return (self, arg)
@classmethod
def bar_cls(cls):
@@ -188,14 +189,27 @@ def test_patch_classmethod_with_classmethod(self):
'fixtures.tests._fixtures.test_monkeypatch.C.foo_cls',
D.bar_cls_args)
with fixture:
- cls, target_class = C.foo_cls()
- self.expectThat(cls, Is(D))
- self.expectThat(target_class, Is(C))
- cls, target_class = C().foo_cls()
- self.expectThat(cls, Is(D))
- self.expectThat(target_class, Is(C))
- self._check_restored_static_or_class_method(oldmethod, oldmethod_inst,
- C, 'foo_cls')
+ # Python 3.9 changes the behavior of the classmethod decorator so
+ # that it now honours the descriptor binding protocol [1].
+ # This means we're now going to call the monkeypatched classmethod
+ # the way we would have if it hadn't been monkeypatched: simply
+ # with the class
+ #
+ # https://bugs.python.org/issue19072
+ if sys.version_info >= (3, 9):
+ cls, = C.foo_cls()
+ self.expectThat(cls, Is(D))
+ cls, = C().foo_cls()
+ self.expectThat(cls, Is(D))
+ else:
+ cls, target_class = C.foo_cls()
+ self.expectThat(cls, Is(D))
+ self.expectThat(target_class, Is(C))
+ cls, target_class = C().foo_cls()
+ self.expectThat(cls, Is(D))
+ self.expectThat(target_class, Is(C))
+ self._check_restored_static_or_class_method(
+ oldmethod, oldmethod_inst, C, 'foo_cls')
def test_patch_classmethod_with_function(self):
oldmethod = C.foo_cls
@@ -222,12 +236,20 @@ def test_patch_classmethod_with_boundmethod(self):
with fixture:
slf, cls = C.foo_cls()
self.expectThat(slf, Is(d))
- self.expectThat(cls, Is(C))
+ # See note in test_patch_classmethod_with_classmethod on changes in
+ # Python 3.9
+ if sys.version_info >= (3, 9):
+ self.expectThat(cls, Is(None))
+ else:
+ self.expectThat(cls, Is(C))
slf, cls = C().foo_cls()
self.expectThat(slf, Is(d))
- self.expectThat(cls, Is(C))
- self._check_restored_static_or_class_method(oldmethod, oldmethod_inst,
- C, 'foo_cls')
+ if sys.version_info >= (3, 9):
+ self.expectThat(cls, Is(None))
+ else:
+ self.expectThat(cls, Is(C))
+ self._check_restored_static_or_class_method(
+ oldmethod, oldmethod_inst, C, 'foo_cls')
def test_patch_function_with_staticmethod(self):
oldmethod = fake_no_args

View File

@ -1,68 +0,0 @@
Patch-Source: https://github.com/pexpect/pexpect/pull/715
From 52af5b0ae0627139524448a3f2e83d9f40802bc2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Thu, 24 Mar 2022 15:15:33 +0100
Subject: [PATCH] Convert @asyncio.coroutine to async def
This is required for Python 3.11+ support.
Fixes https://github.com/pexpect/pexpect/issues/677
---
pexpect/_async.py | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/pexpect/_async.py b/pexpect/_async.py
index dfbfeef5..bc83261d 100644
--- a/pexpect/_async.py
+++ b/pexpect/_async.py
@@ -4,8 +4,7 @@
from pexpect import EOF
-@asyncio.coroutine
-def expect_async(expecter, timeout=None):
+async def expect_async(expecter, timeout=None):
# First process data that was previously read - if it maches, we don't need
# async stuff.
idx = expecter.existing_data()
@@ -14,7 +13,7 @@ def expect_async(expecter, timeout=None):
if not expecter.spawn.async_pw_transport:
pw = PatternWaiter()
pw.set_expecter(expecter)
- transport, pw = yield from asyncio.get_event_loop()\
+ transport, pw = await asyncio.get_event_loop()\
.connect_read_pipe(lambda: pw, expecter.spawn)
expecter.spawn.async_pw_transport = pw, transport
else:
@@ -22,26 +21,25 @@ def expect_async(expecter, timeout=None):
pw.set_expecter(expecter)
transport.resume_reading()
try:
- return (yield from asyncio.wait_for(pw.fut, timeout))
+ return (await asyncio.wait_for(pw.fut, timeout))
except asyncio.TimeoutError as e:
transport.pause_reading()
return expecter.timeout(e)
-@asyncio.coroutine
-def repl_run_command_async(repl, cmdlines, timeout=-1):
+async def repl_run_command_async(repl, cmdlines, timeout=-1):
res = []
repl.child.sendline(cmdlines[0])
for line in cmdlines[1:]:
- yield from repl._expect_prompt(timeout=timeout, async_=True)
+ await repl._expect_prompt(timeout=timeout, async_=True)
res.append(repl.child.before)
repl.child.sendline(line)
# Command was fully submitted, now wait for the next prompt
- prompt_idx = yield from repl._expect_prompt(timeout=timeout, async_=True)
+ prompt_idx = await repl._expect_prompt(timeout=timeout, async_=True)
if prompt_idx == 1:
# We got the continuation prompt - command was incomplete
repl.child.kill(signal.SIGINT)
- yield from repl._expect_prompt(timeout=1, async_=True)
+ await repl._expect_prompt(timeout=1, async_=True)
raise ValueError("Continuation prompt found - input was incomplete:")
return u''.join(res + [repl.child.before])

View File

@ -1,801 +0,0 @@
Patch-Source: https://github.com/python/cpython/pull/28303
--
From af2f55fa55fff397a75feafb0f2d4b4d14b8313a Mon Sep 17 00:00:00 2001
From: Serhiy Storchaka <storchaka@gmail.com>
Date: Mon, 13 Sep 2021 09:11:37 +0300
Subject: [PATCH] bpo-5846: Do not use obsolete unittest functions.
Get rid of use of makeSuite() and findTestCases().
Also make test_math and test_threading_local discoverable.
---
Lib/distutils/tests/test_archive_util.py | 2 +-
Lib/distutils/tests/test_bdist.py | 2 +-
Lib/distutils/tests/test_bdist_dumb.py | 2 +-
Lib/distutils/tests/test_bdist_rpm.py | 2 +-
Lib/distutils/tests/test_build.py | 2 +-
Lib/distutils/tests/test_build_clib.py | 2 +-
Lib/distutils/tests/test_build_ext.py | 4 ++--
Lib/distutils/tests/test_build_py.py | 2 +-
Lib/distutils/tests/test_build_scripts.py | 2 +-
Lib/distutils/tests/test_check.py | 2 +-
Lib/distutils/tests/test_clean.py | 2 +-
Lib/distutils/tests/test_cmd.py | 2 +-
Lib/distutils/tests/test_config.py | 2 +-
Lib/distutils/tests/test_config_cmd.py | 2 +-
Lib/distutils/tests/test_core.py | 2 +-
Lib/distutils/tests/test_cygwinccompiler.py | 2 +-
Lib/distutils/tests/test_dep_util.py | 2 +-
Lib/distutils/tests/test_dir_util.py | 2 +-
Lib/distutils/tests/test_dist.py | 4 ++--
Lib/distutils/tests/test_extension.py | 2 +-
Lib/distutils/tests/test_file_util.py | 2 +-
Lib/distutils/tests/test_filelist.py | 4 ++--
Lib/distutils/tests/test_install.py | 2 +-
Lib/distutils/tests/test_install_data.py | 2 +-
Lib/distutils/tests/test_install_headers.py | 2 +-
Lib/distutils/tests/test_install_lib.py | 2 +-
Lib/distutils/tests/test_install_scripts.py | 2 +-
Lib/distutils/tests/test_log.py | 2 +-
Lib/distutils/tests/test_msvc9compiler.py | 2 +-
Lib/distutils/tests/test_msvccompiler.py | 2 +-
Lib/distutils/tests/test_register.py | 2 +-
Lib/distutils/tests/test_sdist.py | 2 +-
Lib/distutils/tests/test_spawn.py | 2 +-
Lib/distutils/tests/test_sysconfig.py | 2 +-
Lib/distutils/tests/test_text_file.py | 2 +-
Lib/distutils/tests/test_unixccompiler.py | 2 +-
Lib/distutils/tests/test_upload.py | 2 +-
Lib/distutils/tests/test_util.py | 2 +-
Lib/distutils/tests/test_version.py | 2 +-
Lib/test/support/__init__.py | 5 ++--
Lib/test/support/testresult.py | 2 +-
Lib/test/test_dbm.py | 5 ++--
Lib/test/test_email/torture_test.py | 26 ++++++++-------------
Lib/test/test_io.py | 6 +++--
Lib/test/test_math.py | 13 ++++-------
Lib/test/test_pdb.py | 10 +++-----
Lib/test/test_threading_local.py | 17 ++++++--------
Lib/test/test_zipimport.py | 3 ++-
Lib/unittest/test/test_case.py | 2 +-
49 files changed, 80 insertions(+), 93 deletions(-)
diff --git a/Lib/distutils/tests/test_archive_util.py b/Lib/distutils/tests/test_archive_util.py
index edcec25..8aec840 100644
--- a/Lib/distutils/tests/test_archive_util.py
+++ b/Lib/distutils/tests/test_archive_util.py
@@ -390,7 +390,7 @@ class ArchiveUtilTestCase(support.TempdirManager,
archive.close()
def test_suite():
- return unittest.makeSuite(ArchiveUtilTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(ArchiveUtilTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_bdist.py b/Lib/distutils/tests/test_bdist.py
index 55fa393..480bd24 100644
--- a/Lib/distutils/tests/test_bdist.py
+++ b/Lib/distutils/tests/test_bdist.py
@@ -50,7 +50,7 @@ class BuildTestCase(support.TempdirManager,
def test_suite():
- return unittest.makeSuite(BuildTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(BuildTestCase)
if __name__ == '__main__':
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_bdist_dumb.py b/Lib/distutils/tests/test_bdist_dumb.py
index 01a233b..bb860c8 100644
--- a/Lib/distutils/tests/test_bdist_dumb.py
+++ b/Lib/distutils/tests/test_bdist_dumb.py
@@ -91,7 +91,7 @@ class BuildDumbTestCase(support.TempdirManager,
self.assertEqual(contents, sorted(wanted))
def test_suite():
- return unittest.makeSuite(BuildDumbTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(BuildDumbTestCase)
if __name__ == '__main__':
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_bdist_rpm.py b/Lib/distutils/tests/test_bdist_rpm.py
index ba4382f..f1eb9ba 100644
--- a/Lib/distutils/tests/test_bdist_rpm.py
+++ b/Lib/distutils/tests/test_bdist_rpm.py
@@ -129,7 +129,7 @@ class BuildRpmTestCase(support.TempdirManager,
os.remove(os.path.join(pkg_dir, 'dist', 'foo-0.1-1.noarch.rpm'))
def test_suite():
- return unittest.makeSuite(BuildRpmTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(BuildRpmTestCase)
if __name__ == '__main__':
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_build.py b/Lib/distutils/tests/test_build.py
index b020a5b..83a9e4f 100644
--- a/Lib/distutils/tests/test_build.py
+++ b/Lib/distutils/tests/test_build.py
@@ -50,7 +50,7 @@ class BuildTestCase(support.TempdirManager,
self.assertEqual(cmd.executable, os.path.normpath(sys.executable))
def test_suite():
- return unittest.makeSuite(BuildTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(BuildTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_build_clib.py b/Lib/distutils/tests/test_build_clib.py
index 19e012a..601a1b1 100644
--- a/Lib/distutils/tests/test_build_clib.py
+++ b/Lib/distutils/tests/test_build_clib.py
@@ -138,7 +138,7 @@ class BuildCLibTestCase(support.TempdirManager,
self.assertIn('libfoo.a', os.listdir(build_temp))
def test_suite():
- return unittest.makeSuite(BuildCLibTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(BuildCLibTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py
index 8e7364d..3ee567d 100644
--- a/Lib/distutils/tests/test_build_ext.py
+++ b/Lib/distutils/tests/test_build_ext.py
@@ -545,8 +545,8 @@ class ParallelBuildExtTestCase(BuildExtTestCase):
def test_suite():
suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(BuildExtTestCase))
- suite.addTest(unittest.makeSuite(ParallelBuildExtTestCase))
+ suite.addTest(unittest.TestLoader().loadTestsFromTestCase(BuildExtTestCase))
+ suite.addTest(unittest.TestLoader().loadTestsFromTestCase(ParallelBuildExtTestCase))
return suite
if __name__ == '__main__':
diff --git a/Lib/distutils/tests/test_build_py.py b/Lib/distutils/tests/test_build_py.py
index 0712e92..a590a48 100644
--- a/Lib/distutils/tests/test_build_py.py
+++ b/Lib/distutils/tests/test_build_py.py
@@ -173,7 +173,7 @@ class BuildPyTestCase(support.TempdirManager,
def test_suite():
- return unittest.makeSuite(BuildPyTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(BuildPyTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_build_scripts.py b/Lib/distutils/tests/test_build_scripts.py
index 954fc76..f299e51 100644
--- a/Lib/distutils/tests/test_build_scripts.py
+++ b/Lib/distutils/tests/test_build_scripts.py
@@ -106,7 +106,7 @@ class BuildScriptsTestCase(support.TempdirManager,
self.assertIn(name, built)
def test_suite():
- return unittest.makeSuite(BuildScriptsTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(BuildScriptsTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_check.py b/Lib/distutils/tests/test_check.py
index e534aca..91bcdce 100644
--- a/Lib/distutils/tests/test_check.py
+++ b/Lib/distutils/tests/test_check.py
@@ -157,7 +157,7 @@ class CheckTestCase(support.LoggingSilencer,
'restructuredtext': 1})
def test_suite():
- return unittest.makeSuite(CheckTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(CheckTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_clean.py b/Lib/distutils/tests/test_clean.py
index c605afd..9236749 100644
--- a/Lib/distutils/tests/test_clean.py
+++ b/Lib/distutils/tests/test_clean.py
@@ -43,7 +43,7 @@ class cleanTestCase(support.TempdirManager,
cmd.run()
def test_suite():
- return unittest.makeSuite(cleanTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(cleanTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_cmd.py b/Lib/distutils/tests/test_cmd.py
index cf5197c..2319214 100644
--- a/Lib/distutils/tests/test_cmd.py
+++ b/Lib/distutils/tests/test_cmd.py
@@ -120,7 +120,7 @@ class CommandTestCase(unittest.TestCase):
debug.DEBUG = False
def test_suite():
- return unittest.makeSuite(CommandTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(CommandTestCase)
if __name__ == '__main__':
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_config.py b/Lib/distutils/tests/test_config.py
index 344084a..8ab70ef 100644
--- a/Lib/distutils/tests/test_config.py
+++ b/Lib/distutils/tests/test_config.py
@@ -135,7 +135,7 @@ class PyPIRCCommandTestCase(BasePyPIRCCommandTestCase):
def test_suite():
- return unittest.makeSuite(PyPIRCCommandTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(PyPIRCCommandTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_config_cmd.py b/Lib/distutils/tests/test_config_cmd.py
index 0127ba7..072f9eb 100644
--- a/Lib/distutils/tests/test_config_cmd.py
+++ b/Lib/distutils/tests/test_config_cmd.py
@@ -94,7 +94,7 @@ class ConfigTestCase(support.LoggingSilencer,
self.assertFalse(os.path.exists(f))
def test_suite():
- return unittest.makeSuite(ConfigTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(ConfigTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_core.py b/Lib/distutils/tests/test_core.py
index 4e6694a..700a22d 100644
--- a/Lib/distutils/tests/test_core.py
+++ b/Lib/distutils/tests/test_core.py
@@ -134,7 +134,7 @@ class CoreTestCase(support.EnvironGuard, unittest.TestCase):
self.assertEqual(stdout.readlines()[0], wanted)
def test_suite():
- return unittest.makeSuite(CoreTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(CoreTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_cygwinccompiler.py b/Lib/distutils/tests/test_cygwinccompiler.py
index 9dc869d..0912ffd 100644
--- a/Lib/distutils/tests/test_cygwinccompiler.py
+++ b/Lib/distutils/tests/test_cygwinccompiler.py
@@ -148,7 +148,7 @@ class CygwinCCompilerTestCase(support.TempdirManager,
self.assertRaises(ValueError, get_msvcr)
def test_suite():
- return unittest.makeSuite(CygwinCCompilerTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(CygwinCCompilerTestCase)
if __name__ == '__main__':
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_dep_util.py b/Lib/distutils/tests/test_dep_util.py
index c6fae39..0d52740 100644
--- a/Lib/distutils/tests/test_dep_util.py
+++ b/Lib/distutils/tests/test_dep_util.py
@@ -74,7 +74,7 @@ class DepUtilTestCase(support.TempdirManager, unittest.TestCase):
def test_suite():
- return unittest.makeSuite(DepUtilTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(DepUtilTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_dir_util.py b/Lib/distutils/tests/test_dir_util.py
index d436cf8..1b1f3bb 100644
--- a/Lib/distutils/tests/test_dir_util.py
+++ b/Lib/distutils/tests/test_dir_util.py
@@ -133,7 +133,7 @@ class DirUtilTestCase(support.TempdirManager, unittest.TestCase):
def test_suite():
- return unittest.makeSuite(DirUtilTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(DirUtilTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_dist.py b/Lib/distutils/tests/test_dist.py
index f8a9e86..2ef70d9 100644
--- a/Lib/distutils/tests/test_dist.py
+++ b/Lib/distutils/tests/test_dist.py
@@ -521,8 +521,8 @@ class MetadataTestCase(support.TempdirManager, support.EnvironGuard,
def test_suite():
suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(DistributionTestCase))
- suite.addTest(unittest.makeSuite(MetadataTestCase))
+ suite.addTest(unittest.TestLoader().loadTestsFromTestCase(DistributionTestCase))
+ suite.addTest(unittest.TestLoader().loadTestsFromTestCase(MetadataTestCase))
return suite
if __name__ == "__main__":
diff --git a/Lib/distutils/tests/test_extension.py b/Lib/distutils/tests/test_extension.py
index 81fad02..2b08930 100644
--- a/Lib/distutils/tests/test_extension.py
+++ b/Lib/distutils/tests/test_extension.py
@@ -64,7 +64,7 @@ class ExtensionTestCase(unittest.TestCase):
"Unknown Extension options: 'chic'")
def test_suite():
- return unittest.makeSuite(ExtensionTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(ExtensionTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_file_util.py b/Lib/distutils/tests/test_file_util.py
index c7783b8..a614219 100644
--- a/Lib/distutils/tests/test_file_util.py
+++ b/Lib/distutils/tests/test_file_util.py
@@ -118,7 +118,7 @@ class FileUtilTestCase(support.TempdirManager, unittest.TestCase):
def test_suite():
- return unittest.makeSuite(FileUtilTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(FileUtilTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_filelist.py b/Lib/distutils/tests/test_filelist.py
index cee97d4..98c97e4 100644
--- a/Lib/distutils/tests/test_filelist.py
+++ b/Lib/distutils/tests/test_filelist.py
@@ -331,8 +331,8 @@ class FindAllTestCase(unittest.TestCase):
def test_suite():
return unittest.TestSuite([
- unittest.makeSuite(FileListTestCase),
- unittest.makeSuite(FindAllTestCase),
+ unittest.TestLoader().loadTestsFromTestCase(FileListTestCase),
+ unittest.TestLoader().loadTestsFromTestCase(FindAllTestCase),
])
diff --git a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py
index 0632024..b2a3887 100644
--- a/Lib/distutils/tests/test_install.py
+++ b/Lib/distutils/tests/test_install.py
@@ -254,7 +254,7 @@ class InstallTestCase(support.TempdirManager,
def test_suite():
- return unittest.makeSuite(InstallTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(InstallTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_install_data.py b/Lib/distutils/tests/test_install_data.py
index 32ab296..6191d2f 100644
--- a/Lib/distutils/tests/test_install_data.py
+++ b/Lib/distutils/tests/test_install_data.py
@@ -69,7 +69,7 @@ class InstallDataTestCase(support.TempdirManager,
self.assertTrue(os.path.exists(os.path.join(inst, rone)))
def test_suite():
- return unittest.makeSuite(InstallDataTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(InstallDataTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_install_headers.py b/Lib/distutils/tests/test_install_headers.py
index 2217b32..1aa4d09 100644
--- a/Lib/distutils/tests/test_install_headers.py
+++ b/Lib/distutils/tests/test_install_headers.py
@@ -33,7 +33,7 @@ class InstallHeadersTestCase(support.TempdirManager,
self.assertEqual(len(cmd.get_outputs()), 2)
def test_suite():
- return unittest.makeSuite(InstallHeadersTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(InstallHeadersTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_install_lib.py b/Lib/distutils/tests/test_install_lib.py
index fda6315..652653f 100644
--- a/Lib/distutils/tests/test_install_lib.py
+++ b/Lib/distutils/tests/test_install_lib.py
@@ -109,7 +109,7 @@ class InstallLibTestCase(support.TempdirManager,
def test_suite():
- return unittest.makeSuite(InstallLibTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(InstallLibTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_install_scripts.py b/Lib/distutils/tests/test_install_scripts.py
index 1f7b103..648db3b 100644
--- a/Lib/distutils/tests/test_install_scripts.py
+++ b/Lib/distutils/tests/test_install_scripts.py
@@ -76,7 +76,7 @@ class InstallScriptsTestCase(support.TempdirManager,
def test_suite():
- return unittest.makeSuite(InstallScriptsTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(InstallScriptsTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_log.py b/Lib/distutils/tests/test_log.py
index 75cf900..ec2ae02 100644
--- a/Lib/distutils/tests/test_log.py
+++ b/Lib/distutils/tests/test_log.py
@@ -40,7 +40,7 @@ class TestLog(unittest.TestCase):
'Fαtal\t\\xc8rr\\u014dr')
def test_suite():
- return unittest.makeSuite(TestLog)
+ return unittest.TestLoader().loadTestsFromTestCase(TestLog)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_msvc9compiler.py b/Lib/distutils/tests/test_msvc9compiler.py
index 77a07ef..6235405 100644
--- a/Lib/distutils/tests/test_msvc9compiler.py
+++ b/Lib/distutils/tests/test_msvc9compiler.py
@@ -178,7 +178,7 @@ class msvc9compilerTestCase(support.TempdirManager,
def test_suite():
- return unittest.makeSuite(msvc9compilerTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(msvc9compilerTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_msvccompiler.py b/Lib/distutils/tests/test_msvccompiler.py
index b518d6a..dd67c3e 100644
--- a/Lib/distutils/tests/test_msvccompiler.py
+++ b/Lib/distutils/tests/test_msvccompiler.py
@@ -75,7 +75,7 @@ class msvccompilerTestCase(support.TempdirManager,
raise unittest.SkipTest("VS 2015 is not installed")
def test_suite():
- return unittest.makeSuite(msvccompilerTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(msvccompilerTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_register.py b/Lib/distutils/tests/test_register.py
index bba4863..7805c6d 100644
--- a/Lib/distutils/tests/test_register.py
+++ b/Lib/distutils/tests/test_register.py
@@ -318,7 +318,7 @@ class RegisterTestCase(BasePyPIRCCommandTestCase):
def test_suite():
- return unittest.makeSuite(RegisterTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(RegisterTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/distutils/tests/test_sdist.py
index 752e9db..46b3a13 100644
--- a/Lib/distutils/tests/test_sdist.py
+++ b/Lib/distutils/tests/test_sdist.py
@@ -487,7 +487,7 @@ class SDistTestCase(BasePyPIRCCommandTestCase):
archive.close()
def test_suite():
- return unittest.makeSuite(SDistTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(SDistTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_spawn.py b/Lib/distutils/tests/test_spawn.py
index 4ec767b..631d645 100644
--- a/Lib/distutils/tests/test_spawn.py
+++ b/Lib/distutils/tests/test_spawn.py
@@ -131,7 +131,7 @@ class SpawnTestCase(support.TempdirManager,
def test_suite():
- return unittest.makeSuite(SpawnTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(SpawnTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_sysconfig.py b/Lib/distutils/tests/test_sysconfig.py
index 59676b0..3697206 100644
--- a/Lib/distutils/tests/test_sysconfig.py
+++ b/Lib/distutils/tests/test_sysconfig.py
@@ -269,7 +269,7 @@ class SysconfigTestCase(support.EnvironGuard, unittest.TestCase):
def test_suite():
suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(SysconfigTestCase))
+ suite.addTest(unittest.TestLoader().loadTestsFromTestCase(SysconfigTestCase))
return suite
diff --git a/Lib/distutils/tests/test_text_file.py b/Lib/distutils/tests/test_text_file.py
index 7e76240..ebac3d5 100644
--- a/Lib/distutils/tests/test_text_file.py
+++ b/Lib/distutils/tests/test_text_file.py
@@ -101,7 +101,7 @@ class TextFileTestCase(support.TempdirManager, unittest.TestCase):
in_file.close()
def test_suite():
- return unittest.makeSuite(TextFileTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(TextFileTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_unixccompiler.py b/Lib/distutils/tests/test_unixccompiler.py
index 24725ea..a3484d4 100644
--- a/Lib/distutils/tests/test_unixccompiler.py
+++ b/Lib/distutils/tests/test_unixccompiler.py
@@ -139,7 +139,7 @@ class UnixCCompilerTestCase(unittest.TestCase):
def test_suite():
- return unittest.makeSuite(UnixCCompilerTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(UnixCCompilerTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_upload.py b/Lib/distutils/tests/test_upload.py
index 74f0bc0..d679741 100644
--- a/Lib/distutils/tests/test_upload.py
+++ b/Lib/distutils/tests/test_upload.py
@@ -217,7 +217,7 @@ class uploadTestCase(BasePyPIRCCommandTestCase):
def test_suite():
- return unittest.makeSuite(uploadTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(uploadTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_util.py b/Lib/distutils/tests/test_util.py
index d4a01c6..812d44e 100644
--- a/Lib/distutils/tests/test_util.py
+++ b/Lib/distutils/tests/test_util.py
@@ -304,7 +304,7 @@ class UtilTestCase(support.EnvironGuard, unittest.TestCase):
def test_suite():
- return unittest.makeSuite(UtilTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(UtilTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/distutils/tests/test_version.py b/Lib/distutils/tests/test_version.py
index 8671cd2..1563e02 100644
--- a/Lib/distutils/tests/test_version.py
+++ b/Lib/distutils/tests/test_version.py
@@ -81,7 +81,7 @@ class VersionTestCase(unittest.TestCase):
(v1, v2, res))
def test_suite():
- return unittest.makeSuite(VersionTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(VersionTestCase)
if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index c9a80c2..0777a78 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -1129,17 +1129,18 @@ def _compile_match_function(patterns):
def run_unittest(*classes):
"""Run tests from unittest.TestCase-derived classes."""
valid_types = (unittest.TestSuite, unittest.TestCase)
+ loader = unittest.TestLoader()
suite = unittest.TestSuite()
for cls in classes:
if isinstance(cls, str):
if cls in sys.modules:
- suite.addTest(unittest.findTestCases(sys.modules[cls]))
+ suite.addTest(loader.loadTestsFromModule(sys.modules[cls]))
else:
raise ValueError("str arguments must be keys in sys.modules")
elif isinstance(cls, valid_types):
suite.addTest(cls)
else:
- suite.addTest(unittest.makeSuite(cls))
+ suite.addTest(loader.loadTestsFromTestCase(cls))
_filter_suite(suite, match_test)
_run_suite(suite)
diff --git a/Lib/test/support/testresult.py b/Lib/test/support/testresult.py
index 6f2edda..2cd1366 100644
--- a/Lib/test/support/testresult.py
+++ b/Lib/test/support/testresult.py
@@ -173,7 +173,7 @@ if __name__ == '__main__':
raise RuntimeError('error message')
suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(TestTests))
+ suite.addTest(unittest.TestLoader().loadTestsFromTestCase(TestTests))
stream = io.StringIO()
runner_cls = get_test_runner_class(sum(a == '-v' for a in sys.argv))
runner = runner_cls(sys.stdout)
diff --git a/Lib/test/test_email/torture_test.py b/Lib/test/test_email/torture_test.py
index e72a146..9cf9362 100644
--- a/Lib/test/test_email/torture_test.py
+++ b/Lib/test/test_email/torture_test.py
@@ -12,7 +12,6 @@ import unittest
from io import StringIO
from test.test_email import TestEmailBase
-from test.support import run_unittest
import email
from email import __file__ as testfile
@@ -24,10 +23,11 @@ def openfile(filename):
return open(path, 'r')
# Prevent this test from running in the Python distro
-try:
- openfile('crispin-torture.txt')
-except OSError:
- raise unittest.SkipTest
+def setUpModule():
+ try:
+ openfile('crispin-torture.txt')
+ except OSError:
+ raise unittest.SkipTest
@@ -117,17 +117,11 @@ def _testclasses():
return [getattr(mod, name) for name in dir(mod) if name.startswith('Test')]
-def suite():
- suite = unittest.TestSuite()
+def load_tests(loader, tests, pattern):
+ suite = loader.suiteClass()
for testclass in _testclasses():
- suite.addTest(unittest.makeSuite(testclass))
+ suite.addTest(loader.loadTestsFromTestCase(testclass))
return suite
-
-def test_main():
- for testclass in _testclasses():
- run_unittest(testclass)
-
-
-if __name__ == '__main__':
- unittest.main(defaultTest='suite')
+if __name__ == "__main__":
+ unittest.main()
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index fb83762..fc33df6 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -4600,7 +4600,7 @@ class PySignalsTest(SignalsTest):
test_reentrant_write_text = None
-def load_tests(*args):
+def load_tests(loader, tests, pattern):
tests = (CIOTest, PyIOTest, APIMismatchTest,
CBufferedReaderTest, PyBufferedReaderTest,
CBufferedWriterTest, PyBufferedWriterTest,
@@ -4632,7 +4632,9 @@ def load_tests(*args):
for name, obj in py_io_ns.items():
setattr(test, name, obj)
- suite = unittest.TestSuite([unittest.makeSuite(test) for test in tests])
+ suite = loader.suiteClass()
+ for test in tests:
+ suite.addTest(loader.loadTestsFromTestCase(test))
return suite
if __name__ == "__main__":
diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py
index e5f4e2b..6843c1b 100644
--- a/Lib/test/test_math.py
+++ b/Lib/test/test_math.py
@@ -1,7 +1,7 @@
# Python test set -- math module
# XXXX Should not do tests around zero only
-from test.support import run_unittest, verbose, requires_IEEE_754
+from test.support import verbose, requires_IEEE_754
from test import support
import unittest
import itertools
@@ -2211,13 +2211,10 @@ class IsCloseTests(unittest.TestCase):
self.assertAllNotClose(fraction_examples, rel_tol=1e-9)
-def test_main():
+def load_tests(loader, tests, pattern):
from doctest import DocFileSuite
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(MathTests))
- suite.addTest(unittest.makeSuite(IsCloseTests))
- suite.addTest(DocFileSuite("ieee754.txt"))
- run_unittest(suite)
+ tests.addTest(DocFileSuite("ieee754.txt"))
+ return tests
if __name__ == '__main__':
- test_main()
+ unittest.main()
diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
index 6ac1a4a..72738bf 100644
--- a/Lib/test/test_pdb.py
+++ b/Lib/test/test_pdb.py
@@ -1952,14 +1952,10 @@ class ChecklineTests(unittest.TestCase):
self.assertFalse(db.checkline(os_helper.TESTFN, lineno))
-def load_tests(*args):
+def load_tests(loader, tests, pattern):
from test import test_pdb
- suites = [
- unittest.makeSuite(PdbTestCase),
- unittest.makeSuite(ChecklineTests),
- doctest.DocTestSuite(test_pdb)
- ]
- return unittest.TestSuite(suites)
+ tests.addTest(doctest.DocTestSuite(test_pdb))
+ return tests
if __name__ == '__main__':
diff --git a/Lib/test/test_threading_local.py b/Lib/test/test_threading_local.py
index 13facb5..1567c41 100644
--- a/Lib/test/test_threading_local.py
+++ b/Lib/test/test_threading_local.py
@@ -201,22 +201,19 @@ class PyThreadingLocalTest(unittest.TestCase, BaseLocalTest):
_local = _threading_local.local
-def test_main():
- suite = unittest.TestSuite()
- suite.addTest(DocTestSuite('_threading_local'))
- suite.addTest(unittest.makeSuite(ThreadLocalTest))
- suite.addTest(unittest.makeSuite(PyThreadingLocalTest))
+def load_tests(loader, tests, pattern):
+ tests.addTest(DocTestSuite('_threading_local'))
local_orig = _threading_local.local
def setUp(test):
_threading_local.local = _thread._local
def tearDown(test):
_threading_local.local = local_orig
- suite.addTest(DocTestSuite('_threading_local',
- setUp=setUp, tearDown=tearDown)
- )
+ tests.addTests(DocTestSuite('_threading_local',
+ setUp=setUp, tearDown=tearDown)
+ )
+ return tests
- support.run_unittest(suite)
if __name__ == '__main__':
- test_main()
+ unittest.main()
diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py
index da66dad..a4bb96f 100644
--- a/Lib/test/test_zipimport.py
+++ b/Lib/test/test_zipimport.py
@@ -155,7 +155,8 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
# zlib.decompress function object, after which the problem being
# tested here wouldn't be a problem anymore...
# (Hence the 'A' in the test method name: to make it the first
- # item in a list sorted by name, like unittest.makeSuite() does.)
+ # item in a list sorted by name, like
+ # unittest.TestLoader.getTestCaseNames() does.)
#
# This test fails on platforms on which the zlib module is
# statically linked, but the problem it tests for can't
diff --git a/Lib/unittest/test/test_case.py b/Lib/unittest/test/test_case.py
index 9b3a598..62f44f8 100644
--- a/Lib/unittest/test/test_case.py
+++ b/Lib/unittest/test/test_case.py
@@ -420,7 +420,7 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing):
result = unittest.TestResult()
result.failfast = True
- suite = unittest.makeSuite(Foo)
+ suite = unittest.TestLoader().loadTestsFromTestCase(Foo)
suite.run(result)
expected = ['a1', 'a2', 'b1']

View File

@ -1,13 +0,0 @@
diff --git a/librhash/byte_order.h b/librhash/byte_order.h
index 1ea1096..b248b57 100644
--- a/librhash/byte_order.h
+++ b/librhash/byte_order.h
@@ -4,7 +4,7 @@
#include "ustd.h"
#include <stdlib.h>
-#if defined(__GLIBC__)
+#if defined(__linux__)
# include <endian.h>
#endif
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__APPLE__)

View File

@ -1,15 +0,0 @@
--- a/webrick.gemspec
+++ b/webrick.gemspec
@@ -14,12 +14,6 @@
s.require_path = %w{lib}
s.files = [
- "Gemfile",
- "LICENSE.txt",
- "README.md",
- "Rakefile",
- "bin/console",
- "bin/setup",
"lib/webrick.rb",
"lib/webrick/accesslog.rb",
"lib/webrick/cgi.rb",

View File

@ -1,8 +0,0 @@
--- a/test-unit.gemspec
+++ b/test-unit.gemspec
@@ -27,4 +27 @@
- spec.files = ["README.md", "Rakefile"]
- spec.files += ["COPYING", "BSDL", "PSFL"]
- spec.files += Dir.glob("{lib,sample}/**/*.rb")
- spec.files += Dir.glob("doc/text/**/*.*")
+ spec.files += Dir.glob("lib/**/*.rb")

View File

@ -1,74 +0,0 @@
Patch-Source: https://gist.github.com/q66/c780c321caa630a7052035c18bac6655
https://github.com/llvm/llvm-project/issues/62893
--
From f2f90378d4a2c1f744c85d327c67ae8e862fdc7f Mon Sep 17 00:00:00 2001
From: Daniel Kolesa <daniel@octaforge.org>
Date: Tue, 23 May 2023 21:09:55 +0200
Subject: [PATCH] disambiguate ScopedString::append
On some targets, the definition of va_list may result in a wrong
overload of append getting picked up when passing a single string
as a variadic argument.
---
lib/scudo/standalone/report.cpp | 2 +-
lib/scudo/standalone/string_utils.cpp | 6 +++---
lib/scudo/standalone/string_utils.h | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/report.cpp b/report.cpp
index a37faac..9cb70ad 100644
--- a/report.cpp
+++ b/report.cpp
@@ -21,7 +21,7 @@ public:
void append(const char *Format, ...) {
va_list Args;
va_start(Args, Format);
- Message.append(Format, Args);
+ Message.vappend(Format, Args);
va_end(Args);
}
NORETURN ~ScopedErrorReport() {
diff --git a/string_utils.cpp b/string_utils.cpp
index 13fdb9c..3d921ba 100644
--- a/string_utils.cpp
+++ b/string_utils.cpp
@@ -218,7 +218,7 @@ int formatString(char *Buffer, uptr BufferLength, const char *Format, ...) {
return Res;
}
-void ScopedString::append(const char *Format, va_list Args) {
+void ScopedString::vappend(const char *Format, va_list Args) {
va_list ArgsCopy;
va_copy(ArgsCopy, Args);
// formatString doesn't currently support a null buffer or zero buffer length,
@@ -239,7 +239,7 @@ void ScopedString::append(const char *Format, va_list Args) {
void ScopedString::append(const char *Format, ...) {
va_list Args;
va_start(Args, Format);
- append(Format, Args);
+ vappend(Format, Args);
va_end(Args);
}
@@ -247,7 +247,7 @@ void Printf(const char *Format, ...) {
va_list Args;
va_start(Args, Format);
ScopedString Msg;
- Msg.append(Format, Args);
+ Msg.vappend(Format, Args);
outputRaw(Msg.data());
va_end(Args);
}
diff --git a/string_utils.h b/string_utils.h
index 4190119..a4cab52 100644
--- a/string_utils.h
+++ b/string_utils.h
@@ -25,7 +25,7 @@ public:
String.clear();
String.push_back('\0');
}
- void append(const char *Format, va_list Args);
+ void vappend(const char *Format, va_list Args);
void append(const char *Format, ...) FORMAT(2, 3);
void output() const { outputRaw(String.data()); }
void reserve(size_t Size) { String.reserve(Size + 1); }

View File

@ -1,32 +0,0 @@
diff --git a/io/mmap.c b/io/mmap.c
index f9383e5..12f3fff 100644
--- a/io/mmap.c
+++ b/io/mmap.c
@@ -4,10 +4,10 @@
* All Rights Reserved.
*/
-#include "command.h"
-#include "input.h"
#include <sys/mman.h>
#include <signal.h>
+#include "command.h"
+#include "input.h"
#include "init.h"
#include "io.h"
@@ -20,6 +20,14 @@ static cmdinfo_t mwrite_cmd;
static cmdinfo_t mremap_cmd;
#endif /* HAVE_MREMAP */
+#ifndef HAVE_MAP_SYNC
+#define MAP_SYNC 0
+#define MAP_SHARED_VALIDATE 0
+#else
+#include <asm-generic/mman.h>
+#include <asm-generic/mman-common.h>
+#endif /* HAVE_MAP_SYNC */
+
mmap_region_t *maptable;
int mapcount;
mmap_region_t *mapping;

View File

@ -1,12 +0,0 @@
diff --git a/include/linux.h b/include/linux.h
index 7bf59e0..ee25ec9 100644
--- a/include/linux.h
+++ b/include/linux.h
@@ -21,6 +21,7 @@
#include <asm/types.h>
#include <mntent.h>
#include <fcntl.h>
+#include <signal.h> /* For SIGKILL */
#if defined(HAVE_FALLOCATE)
#include <linux/falloc.h>
#endif

View File

@ -1,177 +0,0 @@
Patch-Source: https://github.com/openzfs/zfs/commit/fe975048da29c4756bafd9f63a192db17e3acb7c
--
From fe975048da29c4756bafd9f63a192db17e3acb7c Mon Sep 17 00:00:00 2001
From: szubersk <szuberskidamian@gmail.com>
Date: Wed, 30 Nov 2022 20:27:28 +1000
Subject: [PATCH] Fix Clang 15 compilation errors
- Clang 15 doesn't support `-fno-ipa-sra` anymore. Do a separate
check for `-fno-ipa-sra` support by $KERNEL_CC.
- Don't enable `-mgeneral-regs-only` for certain module files.
Fix #13260
- Scope `GCC diagnostic ignored` statements to GCC only. Clang
doesn't need them to compile the code.
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: szubersk <szuberskidamian@gmail.com>
Closes #13260
Closes #14150
---
config/always-compiler-options.m4 | 31 +++++++++++++++++++++
config/zfs-build.m4 | 3 +-
module/Kbuild.in | 6 ++++
module/icp/algs/edonr/edonr.c | 4 ++-
module/icp/algs/skein/skein_block.c | 2 ++
module/lua/ldo.c | 3 +-
module/os/linux/spl/spl-generic.c | 4 +++
module/zfs/vdev_raidz_math_aarch64_neonx2.c | 4 +++
8 files changed, 54 insertions(+), 3 deletions(-)
diff --git a/config/always-compiler-options.m4 b/config/always-compiler-options.m4
index 5046ce0..0f66db5 100644
--- a/config/always-compiler-options.m4
+++ b/config/always-compiler-options.m4
@@ -221,3 +221,34 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_IPA_SRA], [
CFLAGS="$saved_flags"
AC_SUBST([NO_IPA_SRA])
])
+
+dnl #
+dnl # Check if kernel cc supports -fno-ipa-sra option.
+dnl #
+AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_KERNEL_CC_NO_IPA_SRA], [
+ AC_MSG_CHECKING([whether $KERNEL_CC supports -fno-ipa-sra])
+
+ saved_cc="$CC"
+ saved_flags="$CFLAGS"
+ CC="gcc"
+ CFLAGS="$CFLAGS -Werror -fno-ipa-sra"
+
+ AS_IF([ test -n "$KERNEL_CC" ], [
+ CC="$KERNEL_CC"
+ ])
+ AS_IF([ test -n "$KERNEL_LLVM" ], [
+ CC="clang"
+ ])
+
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
+ KERNEL_NO_IPA_SRA=-fno-ipa-sra
+ AC_MSG_RESULT([yes])
+ ], [
+ KERNEL_NO_IPA_SRA=
+ AC_MSG_RESULT([no])
+ ])
+
+ CC="$saved_cc"
+ CFLAGS="$saved_flags"
+ AC_SUBST([KERNEL_NO_IPA_SRA])
+])
diff --git a/config/zfs-build.m4 b/config/zfs-build.m4
index 2ab6765..9390812 100644
--- a/config/zfs-build.m4
+++ b/config/zfs-build.m4
@@ -81,7 +81,7 @@ AC_DEFUN([ZFS_AC_DEBUG], [
AC_DEFUN([ZFS_AC_DEBUGINFO_ENABLE], [
DEBUG_CFLAGS="$DEBUG_CFLAGS -g -fno-inline $NO_IPA_SRA"
- KERNEL_DEBUG_CFLAGS="$KERNEL_DEBUG_CFLAGS -fno-inline $NO_IPA_SRA"
+ KERNEL_DEBUG_CFLAGS="$KERNEL_DEBUG_CFLAGS -fno-inline $KERNEL_NO_IPA_SRA"
KERNEL_MAKE="$KERNEL_MAKE CONFIG_DEBUG_INFO=y"
DEBUGINFO_ZFS="_with_debuginfo"
@@ -217,6 +217,7 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_ZERO_LENGTH
ZFS_AC_CONFIG_ALWAYS_CC_NO_OMIT_FRAME_POINTER
ZFS_AC_CONFIG_ALWAYS_CC_NO_IPA_SRA
+ ZFS_AC_CONFIG_ALWAYS_KERNEL_CC_NO_IPA_SRA
ZFS_AC_CONFIG_ALWAYS_CC_ASAN
ZFS_AC_CONFIG_ALWAYS_TOOLCHAIN_SIMD
ZFS_AC_CONFIG_ALWAYS_SYSTEM
diff --git a/module/Kbuild.in b/module/Kbuild.in
index 1507965..a334c37 100644
--- a/module/Kbuild.in
+++ b/module/Kbuild.in
@@ -44,4 +44,10 @@ endif
subdir-asflags-y := $(ZFS_MODULE_CFLAGS) $(ZFS_MODULE_CPPFLAGS)
subdir-ccflags-y := $(ZFS_MODULE_CFLAGS) $(ZFS_MODULE_CPPFLAGS)
+ifeq ($(CONFIG_ARM64),y)
+CFLAGS_REMOVE_zcommon/zfs_fletcher_aarch64_neon.o += -mgeneral-regs-only
+CFLAGS_REMOVE_zfs/vdev_raidz_math_aarch64_neon.o += -mgeneral-regs-only
+CFLAGS_REMOVE_zfs/vdev_raidz_math_aarch64_neonx2.o += -mgeneral-regs-only
+endif
+
endif
diff --git a/module/icp/algs/edonr/edonr.c b/module/icp/algs/edonr/edonr.c
index 7a3ba30..baf8bb8 100644
--- a/module/icp/algs/edonr/edonr.c
+++ b/module/icp/algs/edonr/edonr.c
@@ -343,9 +343,11 @@ Q256(size_t bitlen, const uint32_t *data, uint32_t *restrict p)
* which only goes over it by a hair (1248 bytes on ARM32).
*/
#include <sys/isa_defs.h> /* for _ILP32 */
-#ifdef _ILP32 /* We're 32-bit, assume small stack frames */
+#if defined(_ILP32) /* We're 32-bit, assume small stack frames */
+#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic ignored "-Wframe-larger-than="
#endif
+#endif
#if defined(__IBMC__) && defined(_AIX) && defined(__64BIT__)
static inline size_t
diff --git a/module/icp/algs/skein/skein_block.c b/module/icp/algs/skein/skein_block.c
index 7ba165a..3ad52da 100644
--- a/module/icp/algs/skein/skein_block.c
+++ b/module/icp/algs/skein/skein_block.c
@@ -30,7 +30,9 @@
* the #pragma here to ignore the warning.
*/
#if defined(_ILP32) || defined(__powerpc) /* Assume small stack */
+#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic ignored "-Wframe-larger-than="
+#endif
/*
* We're running on 32-bit, don't unroll loops to save stack frame space
*
diff --git a/module/lua/ldo.c b/module/lua/ldo.c
index a9835c4..e4abe04 100644
--- a/module/lua/ldo.c
+++ b/module/lua/ldo.c
@@ -197,7 +197,8 @@ l_noret luaD_throw (lua_State *L, int errcode) {
}
}
-#if defined(HAVE_INFINITE_RECURSION)
+#if defined(__GNUC__) && !defined(__clang__) && \
+ defined(HAVE_INFINITE_RECURSION)
#pragma GCC diagnostic pop
#endif
diff --git a/module/os/linux/spl/spl-generic.c b/module/os/linux/spl/spl-generic.c
index 508fb9d..2cb5251 100644
--- a/module/os/linux/spl/spl-generic.c
+++ b/module/os/linux/spl/spl-generic.c
@@ -225,8 +225,10 @@ __div_u64(uint64_t u, uint32_t v)
* replacements for libgcc-provided functions and will never be called
* directly.
*/
+#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
+#endif
/*
* Implementation of 64-bit unsigned division for 32-bit machines.
@@ -425,7 +427,9 @@ __aeabi_ldivmod(int64_t u, int64_t v)
EXPORT_SYMBOL(__aeabi_ldivmod);
#endif /* __arm || __arm__ */
+#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
+#endif
#endif /* BITS_PER_LONG */