Skip to content

Commit

Permalink
Merge pull request #128 from ggtakec/fix_update
Browse files Browse the repository at this point in the history
Updated tool scripts and support OSs
  • Loading branch information
ggtakec authored Aug 30, 2023
2 parents 639a152 + 55dd768 commit 3103e4e
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 14 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,15 @@ jobs:
- ubuntu:22.04
- ubuntu:20.04
- ubuntu:18.04
- debian:bookworm
- debian:bullseye
- debian:buster
- centos:centos7
- rockylinux:9
- rockylinux:8
- centos:centos7
- fedora:37
- fedora:36
- alpine:3.17
- alpine:3.18

container:
image: ${{ matrix.container }}
Expand Down Expand Up @@ -153,7 +154,7 @@ jobs:
# <default tag flag>: If you want to use the created Docker image as the default image, specify "default".
#
imageinfo:
- alpine:3.17,alpine:3.17,alpine,default
- alpine:3.18,alpine:3.18,alpine,default
- ubuntu:22.04,ubuntu:22.04,ubuntu

#
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/imagetypevars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,17 @@ elif [ "${CI_DOCKER_IMAGE_OSTYPE}" = "alpine" ]; then
PKGMGR_INSTALL_OPT="add -q --no-progress --no-cache"
PKGMGR_UNINSTALL_OPT="del -q --purge --no-progress --no-cache"
PKG_INSTALL_CURL="curl"
PKG_INSTALL_BASE="chmpx"
PKG_INSTALL_DEV="chmpx-dev"
PKG_INSTALL_BASE="chmpx bind-tools"
PKG_INSTALL_DEV="chmpx-dev bind-tools"

elif [ "${CI_DOCKER_IMAGE_OSTYPE}" = "ubuntu" ]; then
PKGMGR_NAME="apt-get"
PKGMGR_UPDATE_OPT="update -qq -y"
PKGMGR_INSTALL_OPT="install -qq -y"
PKGMGR_UNINSTALL_OPT="purge --auto-remove -q -y"
PKG_INSTALL_CURL="curl"
PKG_INSTALL_BASE="chmpx"
PKG_INSTALL_DEV="chmpx-dev"
PKG_INSTALL_BASE="chmpx dnsutils"
PKG_INSTALL_DEV="chmpx-dev dnsutils"
UPDATE_LIBPATH="ldconfig"

#
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/ostypevars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,20 @@ elif [ "${CI_OSTYPE}" = "ubuntu:18.04" ] || [ "${CI_OSTYPE}" = "ubuntu:bionic" ]
PKG_EXT="deb"
IS_OS_UBUNTU=1

elif [ "${CI_OSTYPE}" = "debian:12" ] || [ "${CI_OSTYPE}" = "debian:bookworm" ]; then
DIST_TAG="debian/bookworm"
INSTALL_PKG_LIST="git autoconf autotools-dev gcc g++ make gdb dh-make fakeroot dpkg-dev devscripts libtool pkg-config ruby-dev rubygems rubygems-integration procps libyaml-dev k2hash-dev gnutls-dev"
INSTALLER_BIN="apt-get"
UPDATE_CMD="update"
UPDATE_CMD_ARG=""
INSTALL_CMD="install"
INSTALL_CMD_ARG=""
INSTALL_AUTO_ARG="-y"
INSTALL_QUIET_ARG="-qq"
PKG_OUTPUT_DIR="debian_build"
PKG_EXT="deb"
IS_OS_DEBIAN=1

elif [ "${CI_OSTYPE}" = "debian:11" ] || [ "${CI_OSTYPE}" = "debian:bullseye" ]; then
DIST_TAG="debian/bullseye"
INSTALL_PKG_LIST="git autoconf autotools-dev gcc g++ make gdb dh-make fakeroot dpkg-dev devscripts libtool pkg-config ruby-dev rubygems rubygems-integration procps libyaml-dev k2hash-dev gnutls-dev"
Expand Down Expand Up @@ -256,8 +270,8 @@ elif [ "${CI_OSTYPE}" = "fedora:36" ]; then
PKG_EXT="rpm"
IS_OS_FEDORA=1

elif [ "${CI_OSTYPE}" = "alpine:3.17" ]; then
DIST_TAG="alpine/v3.17"
elif [ "${CI_OSTYPE}" = "alpine:3.18" ]; then
DIST_TAG="alpine/v3.18"
INSTALL_PKG_LIST="bash sudo alpine-sdk automake autoconf libtool groff util-linux-misc musl-locales ruby-dev procps yaml-dev k2hash-dev openssl-dev"
INSTALLER_BIN="apk"
UPDATE_CMD="update"
Expand Down
8 changes: 4 additions & 4 deletions buildutils/make_variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ elif [ "${PRGMODE}" = "DEBHELPER" ]; then
# That string is depended debhelper package version and os etc.
# (if not ubuntu/debian os, returns default string)
#
OS_ID_STRING=$(grep '^ID[[:space:]]*=[[:space:]]*' /etc/os-release | sed -e 's|^ID[[:space:]]*=[[:space:]]*||g' -e 's|^[[:space:]]*||g' -e 's|[[:space:]]*$||g')
OS_ID_STRING=$(grep '^ID[[:space:]]*=[[:space:]]*' /etc/os-release | sed -e 's|^ID[[:space:]]*=[[:space:]]*||g' -e 's|^[[:space:]]*||g' -e 's|[[:space:]]*$||g' -e 's|"||g')

DEBHELPER_MAJOR_VER=$(apt-cache show debhelper 2>/dev/null | grep Version 2>/dev/null | awk '{print $2}' 2>/dev/null | sed -e 's/\..*/ /g' 2>/dev/null)

Expand All @@ -220,10 +220,10 @@ elif [ "${PRGMODE}" = "DEBHELPER" ]; then
fi

if [ -n "${OS_ID_STRING}" ]; then
if [ "${OS_ID_STRING}" = "debian" ]; then
if echo "${OS_ID_STRING}" | grep -q -i "debian"; then
RESULT="debhelper (>= 9.20160709)${DEB_WITH_SYSTEMD_STRING}, autotools-dev"

elif [ "${OS_ID_STRING}" = "ubuntu" ]; then
elif echo "${OS_ID_STRING}" | grep -q -i "ubuntu"; then
if [ "${DEBHELPER_MAJOR_VER}" -lt 10 ]; then
RESULT="debhelper (>= 9.20160709)${DEB_WITH_SYSTEMD_STRING}, autotools-dev"
else
Expand All @@ -243,7 +243,7 @@ elif [ "${PRGMODE}" = "RPMGROUP" ]; then
# Fedora rpm does not need "Group" key in spec file.
# If not fedora, returns "NEEDRPMGROUP", and you must replace this string in configure.ac
#
if grep -q '^ID[[:space:]]*=[[:space:]]*["]*fedora["]*[[:space:]]*$' /etc/os-release; then
if grep -q -i '^ID[[:space:]]*=[[:space:]]*["]*fedora["]*[[:space:]]*$' /etc/os-release; then
RESULT=""
else
RESULT="NEEDRPMGROUP"
Expand Down
28 changes: 27 additions & 1 deletion tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -628,9 +628,35 @@ if [ "${IS_FAILURE_STOPPING_PROCS}" -ne 0 ]; then
#
# Retry to stop
#
PRNWARN "Failed to stop all processes, retry to force stop."
kill -KILL "${TESTSVRPID}" "${TESTCLIENTPIDS}" "${CHMPXSLVPID}" "${CHMPXSVRPID}" >/dev/null 2>&1

PRNERR "Failed to stop all processes, but contiune..."
#
# Re-check processes
#
sleep 2
IS_FAILURE_STOPPING_PROCS=0

if ps -p "${TESTSVRPID}" >/dev/null 2>&1; then
IS_FAILURE_STOPPING_PROCS=1
fi
if ps -p "${CHMPXSLVPID}" >/dev/null 2>&1; then
IS_FAILURE_STOPPING_PROCS=1
fi
if ps -p "${CHMPXSVRPID}" >/dev/null 2>&1; then
IS_FAILURE_STOPPING_PROCS=1
fi
for _ONE_PID in ${TESTCLIENTPIDS}; do
if ps -p "${_ONE_PID}" >/dev/null 2>&1; then
IS_FAILURE_STOPPING_PROCS=1
fi
done

if [ "${IS_FAILURE_STOPPING_PROCS}" -ne 0 ]; then
PRNERR "Failed to stop all processes, but contiune..."
else
PRNSUCCEED "Stop all processes"
fi
else
PRNSUCCEED "Stop all processes"
fi
Expand Down

0 comments on commit 3103e4e

Please sign in to comment.