Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre release #64

Merged
merged 4 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: snickerbockers/submodules-init@v4
- name: apt is for w__p
run: |
wget https://github.com/cosmo-ray/json-search/releases/download/0.2/json-search-x86_64.AppImage
wget https://github.com/cosmo-ray/json-search/releases/download/0.3.1/json-search-x86_64.AppImage
chmod +x json-search-x86_64.AppImage
sudo cp json-search-x86_64.AppImage /bin/json-search
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux-pkg-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
sudo apt-get update --fix-missing
sudo apt-get install -y -f -o Acquire::Retries=3 cargo libfuse2
docker build -t oapi-build ./docker
docker run --device /dev/fuse --cap-add SYS_ADMIN --privileged=True -v $PWD:/oapi-cli oapi-build scl enable devtoolset-11 -- /oapi-cli/docker/make.sh cp
docker run --device /dev/fuse --cap-add SYS_ADMIN --privileged=True -v $PWD:/oapi-cli oapi-build /oapi-cli/docker/make.sh cp
sudo chown $(whoami) -R ./docker-package/
./docker-package/oapi-cli-x86_64.AppImage --appimage-extract-and-run --help
./docker-package/oapi-cli-x86_64.AppImage --help
Expand Down
2 changes: 1 addition & 1 deletion COGNAC
8 changes: 4 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM centos:7
FROM rockylinux:8

RUN echo "assumeyes=1" >> /etc/yum.conf

RUN yum search epel-release
RUN yum info epel-release
RUN yum install -y epel-release wget
RUN yum update -y

RUN yum install -y git autoconf automake make cmake3 json-c-devel centos-release-scl-rh libnghttp2 libpsl libtool pkgconfig fuse-devel file cargo libcurl-devel
RUN yum install -y devtoolset-11-gcc-c++
RUN ln -s /usr/bin/cmake3 /usr/bin/cmake
RUN yum install -y git autoconf automake make cmake json-c-devel libnghttp2 libpsl libtool pkgconfig fuse-devel file cargo libcurl-devel

RUN yum clean all
2 changes: 1 addition & 1 deletion local-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ oapi-cli --password=useless --login=non-existant CreateVms ReadVms ReadVms --
echo "[Test unknown user is unknown OK]"

trap "echo [Test Create vms and read with user 0 FAIL]" ERR
oapi-cli --password='ashita wa dochida' --login='joe' CreateVms ReadVms ReadVms --Filters.VmIds[] i-00000003 | jq .Vms > /dev/null
oapi-cli --password='ashita wa dochida' --login='joe' CreateVms --ImageId ami-ffffff00 ReadVms ReadVms --Filters.VmIds[] i-00000003 | jq .Vms > /dev/null
echo '[Test Create vms and read with user 0 OK]'

trap "echo [Test read vm with user and --raw-print 0 FAIL]" ERR
Expand Down
14 changes: 11 additions & 3 deletions main-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,29 @@ struct ptr_array {
} \
} while (0)

/*
* use to be sizeof v, but if I pass "" to SET_NEXT, sizeof v is 1, and I expect
* char *,
* because the array can contain int and double too, I'll gowith allocated the
* biggerst size for all
*/
#define OBJ_SIZE 8

#define SET_NEXT(a,v,pa) do { \
int cnt; \
if (!a) { \
a = calloc(64, sizeof(v)); \
a = calloc(64, OBJ_SIZE); \
if (!a) break; \
if (ptr_array_append(pa, a) < 0) \
break; \
} \
for (cnt = 0; a[cnt]; ++cnt); \
if (cnt && (cnt % 63) == 0) { \
int idx = ptr_array_get_idx(pa, a); \
pa->ptrs[idx] = realloc(a, (cnt + 1 + 64) * sizeof(v)); \
pa->ptrs[idx] = realloc(a, (cnt + 1 + 64) * OBJ_SIZE); \
if (!pa->ptrs[idx]) { free(a); break; } \
a = pa->ptrs[idx]; \
memset(a + cnt + 1, 0, 64 * sizeof(v)); \
memset(a + cnt + 1, 0, 64 * OBJ_SIZE); \
} \
a[cnt] = v; \
} while (0)
Expand Down
Loading
Loading