*/*: Use [[ ... ]] instead of POSIX [ ... ]

as per the coding style guide:
https://projects.gentoo.org/qa/policy-guide/ebuild-format.html#pg0101

only these changes were done:

[ -e ... ]    to  [[ -e ... ]]
[ -z ... ]    to  [[ -z ... ]]
[ -n ... ]    to  [[ -n ... ]]
[ ! -f ... ]  to  [[ ! -f ... ]]
[ -f ... ]    to  [[ -f ... ]]
[ -d ... ]    to  [[ -d ... ]]

the changes were generated using this command:

```
find -name '*.ebuild' -exec sed -i -E \
's|([^[])\[+(\s+)([^]]+)(\s+)\]+([^]]\|$)|\1\[\[\2\3\4\]\]\5|g' \
{} \+
```

this is aimed to be a series of commits meant to replace all instance of
POSIX [ ... ] to bash's [[ ... ]], to make guru up to date with the
coding style guide.

this process is divided up into a series of commits in order to make
review and testing more easy

Signed-off-by: ingenarel (NeoJesus) <ingenarel_neojesus@disroot.org>
Part-of: https://codeberg.org/gentoo/guru/pulls/6
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
ingenarel (NeoJesus) authored and Michał Górny committed 2026-09-25 18:48:54 +02:00
1 parent d56f4baa37
commit 6481ca930b
15 files changed
+27 -27

No files matched your search

@@ -38,7 +38,7 @@ python_prepare_all() {
}
python_test() {
pushd CloudFlare/tests
if [ -z "${CLOUDFLARE_API_TOKEN}" ]; then
if [[ -z "${CLOUDFLARE_API_TOKEN}" ]]; then
ewarn "Skipping some tests which require an actual cloudflare api token"
ewarn "To run them, provide the token in the environment variable CLOUDFLARE_API_TOKEN"
ewarn "The permissions needed are zone dns edit and user details read"
+1 -1
View File
@@ -18,7 +18,7 @@ RDEPEND="${DEPEND}"
src_prepare() {
default
if [ -n "${PVR}" ] ; then
if [[ -n "${PVR}" ]] ; then
sed -i Makefile -e "s/^VERSION=${PV}$/VERSION=${PVR}/" \
|| die "can't fix doc location to follow Gentoo/FHS guidelines"
fi
+1 -1
View File
@@ -59,7 +59,7 @@ src_unpack() {
)
use gnome-keyring && list+=( dep_git_git )
for i in "${list[@]}"; do
[ ! -f "${DISTDIR}/${P}-${i}.tar.gz" ] && die "The file ${DISTDIR}/${P}-${i}.tar.gz doesn't exist"
[[ ! -f "${DISTDIR}/${P}-${i}.tar.gz" ]] && die "The file ${DISTDIR}/${P}-${i}.tar.gz doesn't exist"
tar xf "${DISTDIR}/${P}-${i}.tar.gz" --strip-components 1 -C "${i//_//}" || die "Failed to unpack ${P}-${i}.tar.gz"
done
}
+4 -4
View File
@@ -95,17 +95,17 @@ src_install() {
# Install zwcad wrapper
cat >> "${S}/opt/apps/${PKG_NAME}/zwcad" <<- EOF || die
#!/bin/sh
if [ -z "\${QT_IM_MODULE}" ]
if [[ -z "\${QT_IM_MODULE}" ]]
then
if [ -n "\$(pidof fcitx5)" ]
if [[ -n "\$(pidof fcitx5)" ]]
then
export XMODIFIERS="@im=fcitx"
export QT_IM_MODULE=fcitx
elif [ -n "\$(pidof ibus-daemon)" ]
elif [[ -n "\$(pidof ibus-daemon)" ]]
then
export XMODIFIERS="@im=ibus"
export QT_IM_MODULE=ibus
elif [ -n "\$(pidof fcitx)" ]
elif [[ -n "\$(pidof fcitx)" ]]
then
export XMODIFIERS="@im=fcitx"
export QT_IM_MODULE=fcitx
+1 -1
View File
@@ -39,7 +39,7 @@ src_install() {
}
pkg_postinst() {
if [ -z "${REPLACING_VERSIONS}" ]; then
if [[ -z "${REPLACING_VERSIONS}" ]]; then
ewarn ""
ewarn "OpenBGPD portable (not running on OpenBSD) can’t export its RIB"
ewarn "to the FIB. It’s only suitable for route-reflectors or"
+1 -1
View File
@@ -39,7 +39,7 @@ src_install() {
}
pkg_postinst() {
if [ -z "${REPLACING_VERSIONS}" ]; then
if [[ -z "${REPLACING_VERSIONS}" ]]; then
ewarn ""
ewarn "OpenBGPD portable (not running on OpenBSD) can’t export its RIB"
ewarn "to the FIB. It’s only suitable for route-reflectors or"
+1 -1
View File
@@ -39,7 +39,7 @@ src_install() {
}
pkg_postinst() {
if [ -z "${REPLACING_VERSIONS}" ]; then
if [[ -z "${REPLACING_VERSIONS}" ]]; then
ewarn ""
ewarn "OpenBGPD portable (not running on OpenBSD) can’t export its RIB"
ewarn "to the FIB. It’s only suitable for route-reflectors or"
+1 -1
View File
@@ -60,7 +60,7 @@ src_install() {
}
pkg_postinst() {
if [ -z "${REPLACING_VERSIONS}" ]; then
if [[ -z "${REPLACING_VERSIONS}" ]]; then
ewarn ""
ewarn "OpenBGPD portable (not running on OpenBSD) can’t export its RIB"
ewarn "to the FIB. It’s only suitable for route-reflectors or"
@@ -126,22 +126,22 @@ pkg_postrm() {
fi
# Remove auto-cpufreq log file
if [ -f "${EROOT}/var/log/auto-cpufreq.log" ]; then
if [[ -f "${EROOT}/var/log/auto-cpufreq.log" ]]; then
rm "${EROOT}"/var/log/auto-cpufreq.log || die
fi
# Remove auto-cpufreq-install script
if [ -f "${EROOT}/usr/bin/auto-cpufreq-install" ]; then
if [[ -f "${EROOT}/usr/bin/auto-cpufreq-install" ]]; then
rm "${EROOT}"/usr/bin/auto-cpufreq-install || die
fi
# Restore original cpufreqctl binary if backup was made
if [ -f "${EROOT}/usr/bin/cpufreqctl.auto-cpufreq.bak" ]; then
if [[ -f "${EROOT}/usr/bin/cpufreqctl.auto-cpufreq.bak" ]]; then
mv "${EROOT}"/usr/bin/cpufreqctl.auto-cpufreq{.bak,} || die
fi
# Remove auto-cpufreq's cpufreqctl binary
# it overwrites cpufreqctl.sh
if [ -f "${EROOT}/usr/bin/cpufreqctl" ]; then
if [[ -f "${EROOT}/usr/bin/cpufreqctl" ]]; then
rm "${EROOT}"/usr/bin/cpufreqctl || die
fi
}
@@ -124,22 +124,22 @@ pkg_postrm() {
fi
# Remove auto-cpufreq log file
if [ -f "${EROOT}/var/log/auto-cpufreq.log" ]; then
if [[ -f "${EROOT}/var/log/auto-cpufreq.log" ]]; then
rm "${EROOT}"/var/log/auto-cpufreq.log || die
fi
# Remove auto-cpufreq-install script
if [ -f "${EROOT}/usr/bin/auto-cpufreq-install" ]; then
if [[ -f "${EROOT}/usr/bin/auto-cpufreq-install" ]]; then
rm "${EROOT}"/usr/bin/auto-cpufreq-install || die
fi
# Restore original cpufreqctl binary if backup was made
if [ -f "${EROOT}/usr/bin/cpufreqctl.auto-cpufreq.bak" ]; then
if [[ -f "${EROOT}/usr/bin/cpufreqctl.auto-cpufreq.bak" ]]; then
mv "${EROOT}"/usr/bin/cpufreqctl.auto-cpufreq{.bak,} || die
fi
# Remove auto-cpufreq's cpufreqctl binary
# it overwrites cpufreqctl.sh
if [ -f "${EROOT}/usr/bin/cpufreqctl" ]; then
if [[ -f "${EROOT}/usr/bin/cpufreqctl" ]]; then
rm "${EROOT}"/usr/bin/cpufreqctl || die
fi
}
@@ -121,22 +121,22 @@ pkg_postrm() {
fi
# Remove auto-cpufreq log file
if [ -f "${EROOT}/var/log/auto-cpufreq.log" ]; then
if [[ -f "${EROOT}/var/log/auto-cpufreq.log" ]]; then
rm "${EROOT}"/var/log/auto-cpufreq.log || die
fi
# Remove auto-cpufreq-install script
if [ -f "${EROOT}/usr/bin/auto-cpufreq-install" ]; then
if [[ -f "${EROOT}/usr/bin/auto-cpufreq-install" ]]; then
rm "${EROOT}"/usr/bin/auto-cpufreq-install || die
fi
# Restore original cpufreqctl binary if backup was made
if [ -f "${EROOT}/usr/bin/cpufreqctl.auto-cpufreq.bak" ]; then
if [[ -f "${EROOT}/usr/bin/cpufreqctl.auto-cpufreq.bak" ]]; then
mv "${EROOT}"/usr/bin/cpufreqctl.auto-cpufreq{.bak,} || die
fi
# Remove auto-cpufreq's cpufreqctl binary
# it overwrites cpufreqctl.sh
if [ -f "${EROOT}/usr/bin/cpufreqctl" ]; then
if [[ -f "${EROOT}/usr/bin/cpufreqctl" ]]; then
rm "${EROOT}"/usr/bin/cpufreqctl || die
fi
}
@@ -92,7 +92,7 @@ BDEPEND="app-arch/unzip"
src_install() {
insinto "/usr/share/icons"
for folder in * ; do
if [ -d "${folder}" ]; then
if [[ -d "${folder}" ]]; then
doins -r "${folder}"
fi
done
@@ -31,7 +31,7 @@ BDEPEND="app-arch/unzip"
src_install() {
insinto "/usr/share/icons"
for folder in * ; do
if [ -d "${folder}" ]; then
if [[ -d "${folder}" ]]; then
doins -r "${folder}"
fi
done
@@ -94,7 +94,7 @@ BDEPEND="
src_install() {
insinto "/usr/share/themes"
for folder in * ; do
if [ -d "${folder}" ]; then
if [[ -d "${folder}" ]]; then
doins -r "${folder}"
fi
done
@@ -94,7 +94,7 @@ BDEPEND="
src_install() {
insinto "/usr/share/themes"
for folder in * ; do
if [ -d "${folder}" ]; then
if [[ -d "${folder}" ]]; then
doins -r "${folder}"
fi
done