summaryrefslogtreecommitdiff
path: root/dev-util/pkgcheck
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/pkgcheck')
-rw-r--r--dev-util/pkgcheck/Manifest3
-rw-r--r--dev-util/pkgcheck/files/pkgcheck-0.10.20-fix-replay-bin.patch109
-rw-r--r--dev-util/pkgcheck/pkgcheck-0.10.20.ebuild4
3 files changed, 115 insertions, 1 deletions
diff --git a/dev-util/pkgcheck/Manifest b/dev-util/pkgcheck/Manifest
index c0dcaafe983e..2554a7f78dfa 100644
--- a/dev-util/pkgcheck/Manifest
+++ b/dev-util/pkgcheck/Manifest
@@ -1,9 +1,10 @@
AUX 50pkgcheck-gentoo.el 125 BLAKE2B db546b7f4e1517fb4f3bc46eff6a3294c8d677be031ecb33987daa84c355c3628ab7f24bbab90afb24b0bcec6c0ebebb56339374fa35a345481aa9808bd538be SHA512 31bad085867ebecedf0c9c3ed1223e7512238892d69b5224e850d744c5965bf7a2d7cb90978d9cce6da8dc554dba36803d604b8c6ac2b7cc9f2718ef7d6fc644
AUX pkgcheck-0.10.19-fix-pkgcore-0.12.18.patch 2435 BLAKE2B 3e41b3ca1666aa8f88473bb3586312d77dfe2dee6748355346ef774dd8ddea4680abc329c653679eb97e634d86e63ef7c0b1593c9aa7ff4160ebf1e5d072519e SHA512 33607bcf237a542d043255f7a9f7f421f87d1a9e782a3f9a23cefaa91ea0fdfe815f50ff44125cd4e7c54aae36a6503998b9eb3c8c49e3626b46a1845ea39120
+AUX pkgcheck-0.10.20-fix-replay-bin.patch 4506 BLAKE2B 68262310538abb220ef3f3109f65656e11716160895491f00f438bd686fe6a904238b1dd29cd92db7bbbb83f2a0282e455e843b7cc8f17c9f4c47a42f8dc4a82 SHA512 42a45d64f4bcd31b510124e8091bb3aae93c906bdb90ea2332405a5b17baee43edffc45563774fbdb2a7efae795065b67f81aeef1c5b9bde7df0bdcdeab3aa48
DIST pkgcheck-0.10.19.tar.gz 548636 BLAKE2B cc1626c1d5ad9ba6b43f99bcdb668092805eaf9797c9839812d8716ea9f454f631d2e6da4579bbf702da5aadc61adc8064a6b7d32f001aaed9a2e42f8392f24c SHA512 c3af623b5c38325f9afabaa217e29d23dce4355a0aebbed77a5efa469ac135238d0aa04b4973d84c52e68ada0cb3b391a82d58317e75a279f083470c7e69cdf6
DIST pkgcheck-0.10.20.tar.gz 549746 BLAKE2B 72ed97d93674ffd311978d03ad3738494a752bf1b02bea5eaaaf1b066c48e8c9ec5f82b79baeeabf3e56e618c76614ee6179b7115d1d875364ac6e3fbc3c6028 SHA512 6a8c135ca44ccbfe15548bd396aba9448c29f60147920b18b8be5aa5fcd1200e0b75bc5de50fc7892ad5460ddad1e7d28a7e44025bdc581a518d136eda8b0df2
EBUILD pkgcheck-0.10.19-r1.ebuild 2304 BLAKE2B 78ddd76b86dc0a9d3b065340829fc1011b8536aa1fe520ceed432cb04ca6ead5c9ba56c26ce0a14c2445a51f15fea9686a102e0150a279b616e042a637bbe29f SHA512 c2e2a88b3cada968782bc1f070d3e6572fe87a3763da08c14de8ae6bfddd3b4e88dccaed733b568395f65d415620b5b4a25cacc261187c4e3d37857005dfcda9
EBUILD pkgcheck-0.10.19-r2.ebuild 2372 BLAKE2B f655d02fa3cb3a1171d3f8eb81085f9b807c5f72c7f2e8f4fca0206565f123a93bc85e6624580c4a52708f5e74eacbe8de27a952dfdaaaf648ae2cbe019173dc SHA512 d9f1f4e477abd4593d553446c97fc918d20183182f318d2a381cc673851856c463f16ff0f3a7b414caaf3ef2bc62af9acb3a9bfa1dbedcd32b3ab83dd00d6080
-EBUILD pkgcheck-0.10.20.ebuild 2208 BLAKE2B 9df86718b0572e354aecf6b68f251be51538dca36e4a42e79fdb0ab7a48911b5b79ebe033cbf7814f1c5a1105a4065d5790e3ba388c1d8f77c42e735a4d179ac SHA512 d63bf1d5c01fbd1e8d6a93e7176c0b6aceba20dfda43eff12ad12a91eca4f6f52aeb1d1d0a65c521205bb05244789b1fef563fbc5cff6a7c639d7b0221dec52c
+EBUILD pkgcheck-0.10.20.ebuild 2262 BLAKE2B c4f8ad4ab0e05d8f5f6476935fcf34ae7cf5d3ccda0c4895a20ea8395a52ed9613d239e4d7710ede116554cd96f0ae9d8a4a17b7f917cba50a57ba0d009124e1 SHA512 52cab6078b2e32ae17267e880d4fa19aeb951c5d0edbd4fa4bd459e9bd99fdd857ba0d51c13dfa044a9bbdc0b7820947c32b94155fae5ecfbdb1f8ad81849aca
EBUILD pkgcheck-9999.ebuild 2208 BLAKE2B 9df86718b0572e354aecf6b68f251be51538dca36e4a42e79fdb0ab7a48911b5b79ebe033cbf7814f1c5a1105a4065d5790e3ba388c1d8f77c42e735a4d179ac SHA512 d63bf1d5c01fbd1e8d6a93e7176c0b6aceba20dfda43eff12ad12a91eca4f6f52aeb1d1d0a65c521205bb05244789b1fef563fbc5cff6a7c639d7b0221dec52c
MISC metadata.xml 455 BLAKE2B b544db3532ef1da966833d5edbc79988cc1fd85b6d6276476684b49d4485814d6e2d969e742d3633c8176e7f37cae6614dae1654fd1424d71475f022166f6e6a SHA512 5abd1584f486e88992bab8c51c191b4915a5854752130f8a591147ff4b2af2102fdc8ab182e7358c3e4bbb3fdc8400563a250e2dba1793d365f0edc7c5f7c33a
diff --git a/dev-util/pkgcheck/files/pkgcheck-0.10.20-fix-replay-bin.patch b/dev-util/pkgcheck/files/pkgcheck-0.10.20-fix-replay-bin.patch
new file mode 100644
index 000000000000..e20c0b3f53f5
--- /dev/null
+++ b/dev-util/pkgcheck/files/pkgcheck-0.10.20-fix-replay-bin.patch
@@ -0,0 +1,109 @@
+test_pkgcheck_replay: fix test_replay_pipe_stdin from sdist
+
+Bug: https://bugs.gentoo.org/888896
+Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
+--- a/tests/scripts/test_pkgcheck_replay.py
++++ b/tests/scripts/test_pkgcheck_replay.py
+@@ -1,20 +1,18 @@
+-import os
+-import subprocess
+ import tempfile
+ from functools import partial
+ from unittest.mock import patch
+
+ import pytest
++from snakeoil.formatters import PlainTextFormatter
++
+ from pkgcheck import __title__ as project
+ from pkgcheck.checks.profiles import ProfileWarning
+ from pkgcheck.reporters import JsonStream
+ from pkgcheck.scripts import run
+-from snakeoil.formatters import PlainTextFormatter
+
+
+ class TestPkgcheckReplay:
+-
+- script = partial(run, project)
++ script = staticmethod(partial(run, project))
+
+ @pytest.fixture(autouse=True)
+ def _setup(self, testconfig):
+@@ -33,11 +31,11 @@ class TestPkgcheckReplay:
+
+ def test_replay(self, capsys):
+ result = ProfileWarning("profile warning: foo")
+- with tempfile.NamedTemporaryFile() as f:
+- out = PlainTextFormatter(f)
++ with tempfile.NamedTemporaryFile() as file:
++ out = PlainTextFormatter(file)
+ with JsonStream(out) as reporter:
+ reporter.report(result)
+- with patch("sys.argv", self.args + ["-R", "StrReporter", f.name]):
++ with patch("sys.argv", self.args + ["-R", "StrReporter", file.name]):
+ with pytest.raises(SystemExit) as excinfo:
+ self.script()
+ out, err = capsys.readouterr()
+@@ -47,13 +45,13 @@ class TestPkgcheckReplay:
+
+ def test_corrupted_resuts(self, capsys):
+ result = ProfileWarning("profile warning: foo")
+- with tempfile.NamedTemporaryFile() as f:
+- out = PlainTextFormatter(f)
++ with tempfile.NamedTemporaryFile() as file:
++ out = PlainTextFormatter(file)
+ with JsonStream(out) as reporter:
+ reporter.report(result)
+- f.write(b"corrupted")
+- f.seek(0)
+- with patch("sys.argv", self.args + ["-R", "StrReporter", f.name]):
++ file.write(b"corrupted")
++ file.seek(0)
++ with patch("sys.argv", self.args + ["-R", "StrReporter", file.name]):
+ with pytest.raises(SystemExit) as excinfo:
+ self.script()
+ out, err = capsys.readouterr()
+@@ -61,26 +59,28 @@ class TestPkgcheckReplay:
+ assert excinfo.value.code == 2
+
+ def test_invalid_file(self, capsys):
+- with tempfile.NamedTemporaryFile(mode="wt") as f:
+- f.write("invalid file")
+- f.seek(0)
+- with patch("sys.argv", self.args + ["-R", "StrReporter", f.name]):
++ with tempfile.NamedTemporaryFile(mode="wt") as file:
++ file.write("invalid file")
++ file.seek(0)
++ with patch("sys.argv", self.args + ["-R", "StrReporter", file.name]):
+ with pytest.raises(SystemExit) as excinfo:
+ self.script()
+ out, err = capsys.readouterr()
+ assert err.strip() == "pkgcheck replay: error: invalid or unsupported replay file"
+ assert excinfo.value.code == 2
+
+- def test_replay_pipe_stdin(self):
+- script = pytest.REPO_ROOT / "bin/pkgcheck"
+- result = ProfileWarning("profile warning: foo")
+- with tempfile.NamedTemporaryFile() as f:
+- out = PlainTextFormatter(f)
++ def test_replay_pipe_stdin(self, capsys):
++ with tempfile.NamedTemporaryFile() as file:
++ out = PlainTextFormatter(file)
+ with JsonStream(out) as reporter:
+- reporter.report(result)
+- f.seek(0)
+- p = subprocess.run(
+- [script, "replay", "-R", "StrReporter", "-"], stdin=f, stdout=subprocess.PIPE
+- )
+- assert p.stdout.decode() == "profile warning: foo\n"
+- assert p.returncode == 0
++ reporter.report(ProfileWarning("profile warning: foo"))
++ file.seek(0)
++
++ with open(file.name) as stdin, patch("sys.stdin", stdin), patch(
++ "sys.argv", [*self.args, "-R", "StrReporter", "-"]
++ ), pytest.raises(SystemExit) as excinfo:
++ self.script()
++ out, err = capsys.readouterr()
++ assert not err
++ assert out == "profile warning: foo\n"
++ assert excinfo.value.code == 0
diff --git a/dev-util/pkgcheck/pkgcheck-0.10.20.ebuild b/dev-util/pkgcheck/pkgcheck-0.10.20.ebuild
index 45516db85496..c3d2532fb01c 100644
--- a/dev-util/pkgcheck/pkgcheck-0.10.20.ebuild
+++ b/dev-util/pkgcheck/pkgcheck-0.10.20.ebuild
@@ -55,6 +55,10 @@ BDEPEND="${RDEPEND}
)
"
+PATCHES=(
+ "${FILESDIR}/${P}-fix-replay-bin.patch"
+)
+
SITEFILE="50${PN}-gentoo.el"
distutils_enable_tests pytest