From 0eb378c2914b0a345d3aa321b1a63011dede6150 Mon Sep 17 00:00:00 2001 From: Jakub Skokan Date: Thu, 12 Apr 2018 12:29:36 +0200 Subject: [PATCH 1/7] Fix build with LXC 3.0 --- ext/lxc/lxc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/lxc/lxc.c b/ext/lxc/lxc.c index b45a141..b0ec634 100644 --- a/ext/lxc/lxc.c +++ b/ext/lxc/lxc.c @@ -6,6 +6,7 @@ #include #include #include +#include #define SYMBOL(s) ID2SYM(rb_intern(s)) From fcc5601bfda0d9daadfad672e2ac635ea3558cf3 Mon Sep 17 00:00:00 2001 From: Jakub Skokan Date: Thu, 12 Apr 2018 12:29:36 +0200 Subject: [PATCH 2/7] Fix build with LXC 3.0 --- ext/lxc/lxc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/lxc/lxc.c b/ext/lxc/lxc.c index b45a141..b0ec634 100644 --- a/ext/lxc/lxc.c +++ b/ext/lxc/lxc.c @@ -6,6 +6,7 @@ #include #include #include +#include #define SYMBOL(s) ID2SYM(rb_intern(s)) From b66693508ee81d44b0ed7b4badfe631e88227770 Mon Sep 17 00:00:00 2001 From: Andre Nathan Date: Tue, 10 Jul 2018 10:29:23 -0300 Subject: [PATCH 3/7] Version 1.2.3 --- debian/changelog | 6 ++++++ lib/lxc/version.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 13520ef..43c1c39 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ruby-lxc (1.2.3-0digirati1) trusty; urgency=low + + * Version 1.2.3. + + -- Andre Nathan Mon, 10 Jul 2018 10:29:03 -0300 + ruby-lxc (1.2.2-0digirati1) trusty; urgency=low * Version 1.2.2. diff --git a/lib/lxc/version.rb b/lib/lxc/version.rb index efc2bc1..15bb139 100644 --- a/lib/lxc/version.rb +++ b/lib/lxc/version.rb @@ -1,3 +1,3 @@ module LXC - VERSION = '1.2.2' + VERSION = '1.2.3' end From b3f43f273914fd37af8c10fa9a20a25591b1df07 Mon Sep 17 00:00:00 2001 From: Andre Nathan Date: Tue, 10 Jul 2018 10:29:23 -0300 Subject: [PATCH 4/7] Version 1.2.3 --- debian/changelog | 6 ++++++ lib/lxc/version.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 13520ef..43c1c39 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ruby-lxc (1.2.3-0digirati1) trusty; urgency=low + + * Version 1.2.3. + + -- Andre Nathan Mon, 10 Jul 2018 10:29:03 -0300 + ruby-lxc (1.2.2-0digirati1) trusty; urgency=low * Version 1.2.2. diff --git a/lib/lxc/version.rb b/lib/lxc/version.rb index efc2bc1..15bb139 100644 --- a/lib/lxc/version.rb +++ b/lib/lxc/version.rb @@ -1,3 +1,3 @@ module LXC - VERSION = '1.2.2' + VERSION = '1.2.3' end From 6bddbee7a5cb5c61108f7c5fd8e77dbd3b9e0e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Wed, 21 Jun 2023 21:43:46 -0400 Subject: [PATCH 5/7] github: Add DCO/target tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- .github/workflows/commits.yml | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/commits.yml diff --git a/.github/workflows/commits.yml b/.github/workflows/commits.yml new file mode 100644 index 0000000..57f5d69 --- /dev/null +++ b/.github/workflows/commits.yml @@ -0,0 +1,40 @@ +name: Commits +on: + - pull_request + +permissions: + contents: read + +jobs: + dco-check: + permissions: + pull-requests: read # for tim-actions/get-pr-commits to get list of commits from the PR + name: Signed-off-by (DCO) + runs-on: ubuntu-20.04 + steps: + - name: Get PR Commits + id: 'get-pr-commits' + uses: tim-actions/get-pr-commits@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Check that all commits are signed-off + uses: tim-actions/dco@master + with: + commits: ${{ steps.get-pr-commits.outputs.commits }} + + target-branch: + permissions: + contents: none + name: Branch target + runs-on: ubuntu-20.04 + steps: + - name: Check branch target + env: + TARGET: ${{ github.event.pull_request.base.ref }} + run: | + set -x + [ "${TARGET}" = "master" ] && exit 0 + + echo "Invalid branch target: ${TARGET}" + exit 1 From cf94855c8ef74cba3d657f0f5bc70ab8a9a96ed6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Mon, 24 Jul 2023 11:07:35 -0400 Subject: [PATCH 6/7] github: Update for main branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- .github/workflows/commits.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commits.yml b/.github/workflows/commits.yml index 57f5d69..541a8f9 100644 --- a/.github/workflows/commits.yml +++ b/.github/workflows/commits.yml @@ -34,7 +34,7 @@ jobs: TARGET: ${{ github.event.pull_request.base.ref }} run: | set -x - [ "${TARGET}" = "master" ] && exit 0 + [ "${TARGET}" = "main" ] && exit 0 echo "Invalid branch target: ${TARGET}" exit 1 From 2902c02478f0a921942cda39c887aed68c7797fb Mon Sep 17 00:00:00 2001 From: Denis Knauf Date: Tue, 10 Oct 2023 15:31:34 +0200 Subject: [PATCH 7/7] arch_to_personality removed (lxc_config_parse_arch is not provided in API). lxc_wait_for_pid_status implementation added (not provided in API) --- ext/lxc/lxc.c | 64 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 42 insertions(+), 22 deletions(-) diff --git a/ext/lxc/lxc.c b/ext/lxc/lxc.c index b0ec634..6a1f394 100644 --- a/ext/lxc/lxc.c +++ b/ext/lxc/lxc.c @@ -41,8 +41,28 @@ extern void *rb_thread_call_without_gvl(void *(*func)(void *), void *data1, #define RELEASING_GVL2(func, arg, killfunc, killarg) func(arg) #endif -extern int lxc_wait_for_pid_status(pid_t pid); -extern long lxc_config_parse_arch(const char *arch); +//extern int lxc_wait_for_pid_status(pid_t pid); +#include +#include +int lxc_wait_for_pid_status(pid_t pid) +{ + int status, ret; + +again: + ret = waitpid(pid, &status, 0); + if (ret == -1) { + if (errno == EINTR) + goto again; + + return -1; + } + + if (ret != pid) + goto again; + + return status; +} +//extern long lxc_config_parse_arch(const char *arch); static VALUE Container; static VALUE Error; @@ -98,24 +118,24 @@ free_c_string_array(char **arr) * "personality", either +:linux32+ or +:linux+, for the 32-bit and 64-bit * architectures, respectively. */ -static VALUE -lxc_arch_to_personality(VALUE self, VALUE rb_arch) -{ - int ret; - char *arch; - - arch = StringValuePtr(rb_arch); - ret = lxc_config_parse_arch(arch); - - switch (ret) { - case PER_LINUX32: - return SYMBOL("linux32"); - case PER_LINUX: - return SYMBOL("linux"); - default: - rb_raise(Error, "unknown personality"); - } -} +//static VALUE +//lxc_arch_to_personality(VALUE self, VALUE rb_arch) +//{ +// int ret; +// char *arch; +// +// arch = StringValuePtr(rb_arch); +// ret = lxc_config_parse_arch(arch); +// +// switch (ret) { +// case PER_LINUX32: +// return SYMBOL("linux32"); +// case PER_LINUX: +// return SYMBOL("linux"); +// default: +// rb_raise(Error, "unknown personality"); +// } +//} /* * call-seq: @@ -2127,8 +2147,8 @@ Init_lxc(void) { VALUE LXC = rb_define_module("LXC"); - rb_define_singleton_method(LXC, "arch_to_personality", - lxc_arch_to_personality, 1); + //rb_define_singleton_method(LXC, "arch_to_personality", + // lxc_arch_to_personality, 1); rb_define_singleton_method(LXC, "run_command", lxc_run_command, 1); rb_define_singleton_method(LXC, "run_shell", lxc_run_shell, 0); rb_define_singleton_method(LXC, "global_config_item",