diff --git a/0000-update-for-pytest-7.2.0.patch b/0000-update-for-pytest-7.2.0.patch new file mode 100644 index 0000000000000000000000000000000000000000..312564faa7a275db2183ecc14befadf10c28391f --- /dev/null +++ b/0000-update-for-pytest-7.2.0.patch @@ -0,0 +1,55 @@ +diff -U4 -r dumb-init-1.2.5--orig/testing/__init__.py dumb-init-1.2.5--patched/testing/__init__.py +--- dumb-init-1.2.5--orig/testing/__init__.py 2020-12-10 19:55:42.000000000 +0100 ++++ dumb-init-1.2.5--patched/testing/__init__.py 2022-11-12 02:42:07.751248222 +0100 +@@ -7,11 +7,8 @@ + from contextlib import contextmanager + from subprocess import PIPE + from subprocess import Popen + +-from py._path.local import LocalPath +- +- + # these signals cause dumb-init to suspend itself + SUSPEND_SIGNALS = frozenset([ + signal.SIGTSTP, + signal.SIGTTOU, +@@ -48,16 +45,17 @@ + + def child_pids(pid): + """Return a list of direct child PIDs for the given PID.""" + children = set() +- for p in LocalPath('/proc').listdir(): ++ for p in os.listdir('/proc'): + try: +- stat = open(p.join('stat').strpath).read() ++ with open(os.path.join('/proc', p, 'stat')) as f: ++ stat = f.read() + m = re.match(r'^\d+ \(.+?\) [a-zA-Z] (\d+) ', stat) + assert m, stat + ppid = int(m.group(1)) + if ppid == pid: +- children.add(int(p.basename)) ++ children.add(int(p)) + except OSError: + # Happens when the process exits after listing it, or between + # opening stat and reading it. + pass +@@ -75,14 +73,15 @@ + + + def is_alive(pid): + """Return whether a process is running with the given PID.""" +- return LocalPath('/proc').join(str(pid)).isdir() ++ return os.path.isdir(os.path.join('/proc', str(pid))) + + + def process_state(pid): + """Return a process' state, such as "stopped" or "running".""" +- status = LocalPath('/proc').join(str(pid), 'status').read() ++ with open(os.path.join('/proc', str(pid), 'status')) as f: ++ status = f.read() + m = re.search(r'^State:\s+[A-Z] \(([a-z]+)\)$', status, re.MULTILINE) + return m.group(1) + + +Only in dumb-init-1.2.5--patched/testing: __init__.py.orig diff --git a/dumb-init.spec b/dumb-init.spec index 3265977e7197f1eeb4d346ff8035728773b74dbd..ddb64a8555d4d71af909f95b1064c43c0082e86b 100644 --- a/dumb-init.spec +++ b/dumb-init.spec @@ -1,10 +1,11 @@ Name: dumb-init Version: 1.2.5 -Release: 1 +Release: 2 Summary: Entry-point for containers that proxies signals License: MIT URL: https://github.com/Yelp/dumb-init Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz +Patch0: 0000-update-for-pytest-7.2.0.patch BuildRequires: gcc help2man make BuildRequires: python3 python3-pytest python3-mock @@ -17,7 +18,7 @@ PID 1 inside minimal container environments (such as Podman and Docker). * It can pass signals properly for simple containers. %prep -%setup -q +%autosetup -p1 %build gcc -std=gnu99 %{optflags} -o %{name} dumb-init.c @@ -37,5 +38,8 @@ install -Dpm0644 %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1 %doc README.md %changelog +* Tue Apr 16 2024 lvxiangcong - 1.2.5-2 +- fix the problem of check build failure + * Mon Jun 20 2022 fushanqing - 1.2.5-1 - Initial package \ No newline at end of file diff --git a/dump-init.yaml b/dump-init.yaml new file mode 100644 index 0000000000000000000000000000000000000000..24da13d6233f2b3c13abb85ece3f99dfa94d9f83 --- /dev/null +++ b/dump-init.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: Yelp/dumb-init.git +tag_prefix: "^v" +seperator: "." \ No newline at end of file