forked from deepin-community/dumb-init
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wrapper script which proxies signals to a child Issue: deepin-community/sig-deepin-sysdev-team#558 Log: update repo
- Loading branch information
Showing
51 changed files
with
2,288 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.tox | ||
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.2.3 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-docstring-first | ||
- id: check-executables-have-shebangs | ||
- id: check-merge-conflict | ||
- id: check-yaml | ||
- id: debug-statements | ||
- id: detect-private-key | ||
- id: double-quote-string-fixer | ||
- id: end-of-file-fixer | ||
- id: flake8 | ||
- id: name-tests-test | ||
- id: requirements-txt-fixer | ||
- id: trailing-whitespace | ||
- id: fix-encoding-pragma | ||
args: ['--remove'] | ||
- repo: https://github.com/pre-commit/mirrors-autopep8 | ||
rev: v1.4.4 | ||
hooks: | ||
- id: autopep8 | ||
- repo: https://github.com/asottile/reorder_python_imports | ||
rev: v1.6.0 | ||
hooks: | ||
- id: reorder-python-imports | ||
args: ['--py3-plus'] | ||
- repo: https://github.com/Lucas-C/pre-commit-hooks | ||
rev: v1.1.6 | ||
hooks: | ||
- id: remove-tabs | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v1.21.0 | ||
hooks: | ||
- id: pyupgrade | ||
args: ['--py3-plus'] | ||
- repo: https://github.com/asottile/add-trailing-comma | ||
rev: v1.4.1 | ||
hooks: | ||
- id: add-trailing-comma | ||
args: ['--py36-plus'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
language: c | ||
services: | ||
- docker | ||
|
||
matrix: | ||
include: | ||
- env: ITEST_TARGET=itest_focal | ||
- env: ITEST_TARGET=itest_buster | ||
- env: ITEST_TARGET=itest_tox | ||
- arch: ppc64le | ||
env: ITEST_TARGET=itest_buster | ||
- arch: arm64 | ||
env: ITEST_TARGET=itest_buster | ||
- arch: s390x | ||
env: ITEST_TARGET=itest_buster | ||
allow_failures: | ||
- arch: ppc64le | ||
env: ITEST_TARGET=itest_buster | ||
- arch: arm64 | ||
env: ITEST_TARGET=itest_buster | ||
- arch: s390x | ||
env: ITEST_TARGET=itest_buster | ||
|
||
|
||
script: | ||
- make "$ITEST_TARGET" | ||
|
||
after_script: | ||
- ci/artifact-upload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
Contributing to dumb-init | ||
======== | ||
|
||
`dumb-init` is primarily developed by [Yelp](https://yelp.github.io/), but | ||
contributions are welcome from everyone! | ||
|
||
Code is reviewed using GitHub pull requests. To make a contribution, you should: | ||
|
||
1. Fork the GitHub repository | ||
2. Push code to a branch on your fork | ||
3. Create a pull request and wait for it to be reviewed | ||
|
||
We aim to have all dumb-init behavior covered by tests. If you make a change in | ||
behavior, please add a test to ensure it doesn't regress. We're also happy to | ||
help with suggestions on testing! | ||
|
||
|
||
## Releasing new versions | ||
|
||
`dumb-init` uses [semantic versioning](http://semver.org/). If you're making a | ||
contribution, please don't bump the version number yourself—we'll take care | ||
of that after merging! | ||
|
||
The process to release a new version is: | ||
|
||
1. Update the version in `VERSION` and run `make VERSION.h` | ||
2. Update the Debian changelog with `dch -v {new version}`. | ||
3. Update the two `wget` urls in the README to point to the new version. | ||
4. Commit the changes and tag the commit like `v1.0.0`. | ||
5. `git push --tags origin master` | ||
6. Wait for Travis to run, then find and download the binary and Debian | ||
packages for all architectures; there will be links printed at the | ||
end of the Travis output. Put these into your `dist` directory. | ||
7. Run `make release` | ||
8. Run `twine upload --skip-existing dist/*.tar.gz dist/*.whl` to upload the | ||
new version to PyPI | ||
9. Upload the resulting Debian packages, binaries, and sha256sums file (all | ||
inside the `dist` directory) to a new [GitHub | ||
release](https://github.com/Yelp/dumb-init/releases) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM debian:buster | ||
|
||
LABEL maintainer="Chris Kuehl <[email protected]>" | ||
|
||
# The default mirrors are too flaky to run reliably in CI. | ||
RUN sed -E \ | ||
'/security\.debian/! s@http://[^/]+/@http://mirrors.kernel.org/@' \ | ||
-i /etc/apt/sources.list | ||
|
||
# Install the bare minimum dependencies necessary for working with Debian | ||
# packages. Build dependencies should be added under "Build-Depends" inside | ||
# debian/control instead. | ||
RUN : \ | ||
&& apt-get update \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
devscripts \ | ||
equivs \ | ||
lintian \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
WORKDIR /tmp/mnt | ||
|
||
COPY debian/control /control | ||
RUN : \ | ||
&& apt-get update \ | ||
&& mk-build-deps --install --tool 'apt-get -y --no-install-recommends' /control \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENTRYPOINT make builddeb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2015 Yelp, Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
include dumb-init.c | ||
include VERSION | ||
include VERSION.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
SHELL=bash | ||
CFLAGS=-std=gnu99 -static -s -Wall -Werror -O3 | ||
|
||
TEST_PACKAGE_DEPS := build-essential python python-pip procps python-dev python-setuptools | ||
|
||
DOCKER_RUN_TEST := docker run -v $(PWD):/mnt:ro | ||
VERSION = $(shell cat VERSION) | ||
|
||
.PHONY: build | ||
build: VERSION.h | ||
$(CC) $(CFLAGS) -o dumb-init dumb-init.c | ||
|
||
VERSION.h: VERSION | ||
echo '// THIS FILE IS AUTOMATICALLY GENERATED' > VERSION.h | ||
echo '// Run `make VERSION.h` to update it after modifying VERSION.' >> VERSION.h | ||
xxd -i VERSION >> VERSION.h | ||
|
||
.PHONY: clean | ||
clean: clean-tox | ||
rm -rf dumb-init dist/ *.deb | ||
|
||
.PHONY: clean-tox | ||
clean-tox: | ||
rm -rf .tox | ||
|
||
.PHONY: release | ||
release: python-dists | ||
cd dist && \ | ||
sha256sum --binary dumb-init_$(VERSION)_amd64.deb dumb-init_$(VERSION)_x86_64 dumb-init_$(VERSION)_ppc64el.deb dumb-init_$(VERSION)_ppc64le dumb-init_$(VERSION)_s390x.deb dumb-init_$(VERSION)_s390x dumb-init_$(VERSION)_arm64.deb dumb-init_$(VERSION)_aarch64 \ | ||
> sha256sums | ||
|
||
.PHONY: python-dists | ||
python-dists: VERSION.h | ||
python setup.py sdist | ||
docker run \ | ||
--user $$(id -u):$$(id -g) \ | ||
-v $(PWD)/dist:/dist:rw \ | ||
quay.io/pypa/manylinux1_x86_64:latest \ | ||
bash -exc ' \ | ||
/opt/python/cp35-cp35m/bin/pip wheel --wheel-dir /tmp /dist/*.tar.gz && \ | ||
auditwheel repair --wheel-dir /dist /tmp/*.whl --wheel-dir /dist \ | ||
' | ||
|
||
.PHONY: builddeb | ||
builddeb: | ||
debuild --set-envvar=CC=musl-gcc -us -uc -b | ||
mkdir -p dist | ||
mv ../dumb-init_*.deb dist/ | ||
# Extract the built binary from the Debian package | ||
dpkg-deb --fsys-tarfile dist/dumb-init_$(VERSION)_$(shell dpkg --print-architecture).deb | \ | ||
tar -C dist --strip=3 -xvf - ./usr/bin/dumb-init | ||
mv dist/dumb-init dist/dumb-init_$(VERSION)_$(shell uname -m) | ||
|
||
.PHONY: builddeb-docker | ||
builddeb-docker: docker-image | ||
mkdir -p dist | ||
docker run --user $$(id -u):$$(id -g) -v $(PWD):/tmp/mnt dumb-init-build | ||
|
||
.PHONY: docker-image | ||
docker-image: | ||
docker build -t dumb-init-build . | ||
|
||
.PHONY: test | ||
test: | ||
tox | ||
tox -e pre-commit | ||
|
||
.PHONY: install-hooks | ||
install-hooks: | ||
tox -e pre-commit -- install -f --install-hooks | ||
|
||
ITEST_TARGETS = itest_focal itest_buster | ||
|
||
.PHONY: itest $(ITEST_TARGETS) | ||
itest: $(ITEST_TARGETS) | ||
|
||
itest_focal: _itest-ubuntu-focal | ||
itest_buster: _itest-debian-buster | ||
|
||
itest_tox: | ||
$(DOCKER_RUN_TEST) debian:buster /mnt/ci/docker-tox-test | ||
|
||
_itest-%: _itest_deb-% _itest_python-% | ||
@true | ||
|
||
_itest_python-%: | ||
$(DOCKER_RUN_TEST) $(shell sed 's/-/:/' <<< "$*") /mnt/ci/docker-python-test | ||
|
||
_itest_deb-%: builddeb-docker | ||
$(DOCKER_RUN_TEST) $(shell sed 's/-/:/' <<< "$*") /mnt/ci/docker-deb-test |
Oops, something went wrong.