Skip to content

Commit

Permalink
Merge pull request #326 from alerque/avoid-bashishm-in-configure
Browse files Browse the repository at this point in the history
Remove bashism from configure script
  • Loading branch information
alerque committed Nov 8, 2022
2 parents 9f30385 + 53855f1 commit 810e7f8
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 20 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch tags
Expand All @@ -21,7 +21,7 @@ jobs:
make DESTDIR=. install-exec
echo VERSION=$(cat .version) >> $GITHUB_ENV
- name: Post standalone script artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: standalone-deployment-${{ env.VERSION }}
path: vcsh-standalone.sh
Expand All @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch tags
Expand All @@ -40,7 +40,7 @@ jobs:
run: |
sudo apt install -y ronn
- name: Install perl test dependencies
uses: perl-actions/install-with-cpanm@v1.1
uses: perl-actions/install-with-cpanm@v1.4
with:
install: |
Shell::Command
Expand All @@ -57,7 +57,7 @@ jobs:
make dist
echo VERSION=$(cat .version) >> $GITHUB_ENV
- name: Post build artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: vcsh-${{ env.VERSION }}
path: vcsh-${{ env.VERSION }}.zip
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Lint code style
uses: editorconfig-checker/action-editorconfig-checker@v1.0.0

shellcheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Configure
run: |
./bootstrap.sh
./configure --without-man-page --disable-tests
- name: Run shellcheck
uses: reviewdog/action-shellcheck@v1.0.0
uses: reviewdog/action-shellcheck@v1.15.0
with:
pattern: vcsh
reporter: github-pr-review
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install build dependencies
run: |
sudo apt install -y ronn
Expand Down Expand Up @@ -49,15 +49,15 @@ jobs:
needs: [ ghrelease ]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Configure standalone script
run: |
echo "${GITHUB_REF#refs/*/v}" > .tarball-version
./bootstrap.sh
./configure --with-standalone --bindir=/
make DESTDIR=. install-exec
- name: Add standalone deployment to release
uses: svenstaro/upload-release-action@v2
uses: svenstaro/upload-release-action@v3
with:
repo_token: ${{ github.token }}
file: vcsh-standalone.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch tags
Expand All @@ -18,7 +18,7 @@ jobs:
run: |
sudo apt install -y ronn
- name: Install perl test dependencies
uses: perl-actions/install-with-cpanm@v1.1
uses: perl-actions/install-with-cpanm@v1.4
with:
install: |
Shell::Command
Expand Down
5 changes: 5 additions & 0 deletions build-aux/ax_progvar.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
AC_DEFUN([AX_PROGVAR], [
test -n "$m4_toupper($1)" || { AC_PATH_PROG(m4_toupper($1), m4_default($2,$1)) }
test -n "$m4_toupper($1)" || AC_MSG_ERROR([m4_default($2,$1) is required])
])

5 changes: 5 additions & 0 deletions build-aux/ax_subst_transformed_package_name.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
AC_DEFUN([AX_SUBST_TRANSFORMED_PACKAGE_NAME], [
AC_PROG_SED
TRANSFORMED_PACKAGE_NAME="$(printf "$PACKAGE_NAME" | $SED -e "$(printf "$program_transform_name" | $SED -e 's/\$\$/\$/')")"
AC_SUBST([TRANSFORMED_PACKAGE_NAME])
])
8 changes: 1 addition & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ AC_CONFIG_MACRO_DIR([build-aux])
AM_CONDITIONAL([IS_SDIST],
[test ! -e .gitignore])

AC_DEFUN([AX_PROGVAR], [
test -n "$m4_toupper($1)" || { AC_PATH_PROG(m4_toupper($1), m4_default($2,$1)) }
test -n "$m4_toupper($1)" || AC_MSG_ERROR([m4_default($2,$1) is required])
])

AC_ARG_WITH([standalone],
AS_HELP_STRING([--with-standalone],
[Use configuration presets for a standalone script deployment @<:@default=no@:>@]),
Expand Down Expand Up @@ -105,8 +100,7 @@ AM_COND_IF([ENABLE_ZSH_COMPLETION],
[ZSH_COMPLETION_DIR="$with_zsh_completion_dir"])
AC_SUBST([ZSH_COMPLETION_DIR])

TRANSFORMED_PACKAGE_NAME="$(printf "$PACKAGE_NAME" | $SED -e "${program_transform_name//\$\$/\$}")"
AC_SUBST([TRANSFORMED_PACKAGE_NAME])
AX_SUBST_TRANSFORMED_PACKAGE_NAME

AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([vcsh], [chmod +x vcsh])
Expand Down

0 comments on commit 810e7f8

Please sign in to comment.