!2 add dump-init.yaml
From: @running-tortoise Reviewed-by: @jianli-97 Signed-off-by: @jianli-97
This commit is contained in:
commit
f450908f13
55
0000-update-for-pytest-7.2.0.patch
Normal file
55
0000-update-for-pytest-7.2.0.patch
Normal file
@ -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
|
||||||
@ -1,10 +1,11 @@
|
|||||||
Name: dumb-init
|
Name: dumb-init
|
||||||
Version: 1.2.5
|
Version: 1.2.5
|
||||||
Release: 1
|
Release: 2
|
||||||
Summary: Entry-point for containers that proxies signals
|
Summary: Entry-point for containers that proxies signals
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://github.com/Yelp/dumb-init
|
URL: https://github.com/Yelp/dumb-init
|
||||||
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
|
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
|
||||||
|
Patch0: 0000-update-for-pytest-7.2.0.patch
|
||||||
|
|
||||||
BuildRequires: gcc help2man make
|
BuildRequires: gcc help2man make
|
||||||
BuildRequires: python3 python3-pytest python3-mock
|
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.
|
* It can pass signals properly for simple containers.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%autosetup -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
gcc -std=gnu99 %{optflags} -o %{name} dumb-init.c
|
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
|
%doc README.md
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Apr 16 2024 lvxiangcong <lvxiangcong@kylinos.cn> - 1.2.5-2
|
||||||
|
- fix the problem of check build failure
|
||||||
|
|
||||||
* Mon Jun 20 2022 fushanqing <fushanqing@kylinos.cn> - 1.2.5-1
|
* Mon Jun 20 2022 fushanqing <fushanqing@kylinos.cn> - 1.2.5-1
|
||||||
- Initial package
|
- Initial package
|
||||||
4
dump-init.yaml
Normal file
4
dump-init.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
version_control: github
|
||||||
|
src_repo: Yelp/dumb-init.git
|
||||||
|
tag_prefix: "^v"
|
||||||
|
seperator: "."
|
||||||
Loading…
x
Reference in New Issue
Block a user