mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-28 09:01:55 +02:00
sys-libs/cracklib: Sync with Gentoo
It's from Gentoo commit 4ef3f3e85bd7e2e8de70e76eb09c4c21f207eb16.
This commit is contained in:
parent
b777b42665
commit
21d0ab3c2b
@ -1,13 +1,13 @@
|
||||
# Copyright 1999-2023 Gentoo Authors
|
||||
# Copyright 1999-2024 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
# Note: ideally bump with sys-apps/cracklib-words
|
||||
|
||||
DISTUTILS_EXT=1
|
||||
DISTUTILS_OPTIONAL=1
|
||||
DISTUTILS_USE_PEP517=setuptools
|
||||
PYTHON_COMPAT=( python3_{9..11} )
|
||||
PYTHON_COMPAT=( python3_{10..12} )
|
||||
inherit distutils-r1 libtool multilib-minimal usr-ldscript
|
||||
|
||||
MY_P=${P/_}
|
||||
@ -35,6 +35,10 @@ BDEPEND="
|
||||
python? ( ${DISTUTILS_DEPS} )
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${P}-py3.12-tests.patch
|
||||
)
|
||||
|
||||
distutils_enable_tests unittest
|
||||
|
||||
pkg_setup() {
|
||||
|
@ -0,0 +1,80 @@
|
||||
https://github.com/cracklib/cracklib/commit/a77a392272df3677f71c68e81fcdad1bc722732e
|
||||
|
||||
From a77a392272df3677f71c68e81fcdad1bc722732e Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Gayot <olivier.gayot@canonical.com>
|
||||
Date: Thu, 30 Nov 2023 18:36:17 +0100
|
||||
Subject: [PATCH] Fix test-suite so it can run with Python 3.12
|
||||
|
||||
The test suite still used the obsolete assertEquals() function which was
|
||||
a deprecated alias for assertEqual() (without the s) and got dropped
|
||||
from Python 3.12.
|
||||
|
||||
Use the replacement instead so the test-suite can run with Python 3.12.
|
||||
|
||||
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
|
||||
--- a/python/test_cracklib.py
|
||||
+++ b/python/test_cracklib.py
|
||||
@@ -69,52 +69,52 @@ def test_simple(self):
|
||||
def test_simple_lower(self):
|
||||
for passwd in ['t' * i for i in range(
|
||||
cracklib.MIN_LENGTH - cracklib.LOW_CREDIT)]:
|
||||
- self.assertEquals(
|
||||
+ self.assertEqual(
|
||||
1, cracklib.simple(passwd),
|
||||
'password {0} should be detected as too simple'.format(
|
||||
passwd))
|
||||
- self.assertEquals(0, cracklib.simple(
|
||||
+ self.assertEqual(0, cracklib.simple(
|
||||
't' * (cracklib.MIN_LENGTH - cracklib.LOW_CREDIT)))
|
||||
|
||||
def test_simple_upper(self):
|
||||
for passwd in ['T' * i for i in range(
|
||||
cracklib.MIN_LENGTH - cracklib.UP_CREDIT)]:
|
||||
- self.assertEquals(
|
||||
+ self.assertEqual(
|
||||
1, cracklib.simple(passwd),
|
||||
'password {0} should be detected as too simple'.format(
|
||||
passwd))
|
||||
- self.assertEquals(0, cracklib.simple(
|
||||
+ self.assertEqual(0, cracklib.simple(
|
||||
'T' * (cracklib.MIN_LENGTH - cracklib.UP_CREDIT)))
|
||||
|
||||
def test_simple_digit(self):
|
||||
for passwd in ['1' * i for i in range(
|
||||
cracklib.MIN_LENGTH - cracklib.DIG_CREDIT)]:
|
||||
- self.assertEquals(
|
||||
+ self.assertEqual(
|
||||
1, cracklib.simple(passwd),
|
||||
'password {0} should be detected as too simple'.format(
|
||||
passwd))
|
||||
- self.assertEquals(0, cracklib.simple(
|
||||
+ self.assertEqual(0, cracklib.simple(
|
||||
'1' * (cracklib.MIN_LENGTH - cracklib.DIG_CREDIT)))
|
||||
|
||||
def test_simple_other(self):
|
||||
for passwd in ['#' * i for i in range(
|
||||
cracklib.MIN_LENGTH - cracklib.OTH_CREDIT)]:
|
||||
- self.assertEquals(
|
||||
+ self.assertEqual(
|
||||
1, cracklib.simple(passwd),
|
||||
'password {0} should be detected as too simple'.format(
|
||||
passwd))
|
||||
- self.assertEquals(0, cracklib.simple(
|
||||
+ self.assertEqual(0, cracklib.simple(
|
||||
'#' * (cracklib.MIN_LENGTH - cracklib.OTH_CREDIT)))
|
||||
|
||||
def test_simple_combinations(self):
|
||||
testset = '#a' * (cracklib.MIN_LENGTH // 2)
|
||||
for passwd in [testset[:i] for i in range(
|
||||
cracklib.MIN_LENGTH - cracklib.LOW_CREDIT - cracklib.OTH_CREDIT)]:
|
||||
- self.assertEquals(
|
||||
+ self.assertEqual(
|
||||
1, cracklib.simple(passwd),
|
||||
'password {0} should be detected as too simple'.format(
|
||||
passwd))
|
||||
- self.assertEquals(0, cracklib.simple(
|
||||
+ self.assertEqual(0, cracklib.simple(
|
||||
testset[:(cracklib.MIN_LENGTH - cracklib.LOW_CREDIT -
|
||||
cracklib.OTH_CREDIT)]))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user