mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-10-12 17:51:11 -04:00
*/*: 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:
1 parent
d56f4baa37
commit
6481ca930b
15 files changed
+27
-27
No files matched your search
@@ -38,7 +38,7 @@ python_prepare_all() {
|
|||||||
}
|
}
|
||||||
python_test() {
|
python_test() {
|
||||||
pushd CloudFlare/tests
|
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 "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 "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"
|
ewarn "The permissions needed are zone dns edit and user details read"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ RDEPEND="${DEPEND}"
|
|||||||
src_prepare() {
|
src_prepare() {
|
||||||
default
|
default
|
||||||
|
|
||||||
if [ -n "${PVR}" ] ; then
|
if [[ -n "${PVR}" ]] ; then
|
||||||
sed -i Makefile -e "s/^VERSION=${PV}$/VERSION=${PVR}/" \
|
sed -i Makefile -e "s/^VERSION=${PV}$/VERSION=${PVR}/" \
|
||||||
|| die "can't fix doc location to follow Gentoo/FHS guidelines"
|
|| die "can't fix doc location to follow Gentoo/FHS guidelines"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ src_unpack() {
|
|||||||
)
|
)
|
||||||
use gnome-keyring && list+=( dep_git_git )
|
use gnome-keyring && list+=( dep_git_git )
|
||||||
for i in "${list[@]}"; do
|
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"
|
tar xf "${DISTDIR}/${P}-${i}.tar.gz" --strip-components 1 -C "${i//_//}" || die "Failed to unpack ${P}-${i}.tar.gz"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,17 +95,17 @@ src_install() {
|
|||||||
# Install zwcad wrapper
|
# Install zwcad wrapper
|
||||||
cat >> "${S}/opt/apps/${PKG_NAME}/zwcad" <<- EOF || die
|
cat >> "${S}/opt/apps/${PKG_NAME}/zwcad" <<- EOF || die
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
if [ -z "\${QT_IM_MODULE}" ]
|
if [[ -z "\${QT_IM_MODULE}" ]]
|
||||||
then
|
then
|
||||||
if [ -n "\$(pidof fcitx5)" ]
|
if [[ -n "\$(pidof fcitx5)" ]]
|
||||||
then
|
then
|
||||||
export XMODIFIERS="@im=fcitx"
|
export XMODIFIERS="@im=fcitx"
|
||||||
export QT_IM_MODULE=fcitx
|
export QT_IM_MODULE=fcitx
|
||||||
elif [ -n "\$(pidof ibus-daemon)" ]
|
elif [[ -n "\$(pidof ibus-daemon)" ]]
|
||||||
then
|
then
|
||||||
export XMODIFIERS="@im=ibus"
|
export XMODIFIERS="@im=ibus"
|
||||||
export QT_IM_MODULE=ibus
|
export QT_IM_MODULE=ibus
|
||||||
elif [ -n "\$(pidof fcitx)" ]
|
elif [[ -n "\$(pidof fcitx)" ]]
|
||||||
then
|
then
|
||||||
export XMODIFIERS="@im=fcitx"
|
export XMODIFIERS="@im=fcitx"
|
||||||
export QT_IM_MODULE=fcitx
|
export QT_IM_MODULE=fcitx
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ src_install() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pkg_postinst() {
|
pkg_postinst() {
|
||||||
if [ -z "${REPLACING_VERSIONS}" ]; then
|
if [[ -z "${REPLACING_VERSIONS}" ]]; then
|
||||||
ewarn ""
|
ewarn ""
|
||||||
ewarn "OpenBGPD portable (not running on OpenBSD) can’t export its RIB"
|
ewarn "OpenBGPD portable (not running on OpenBSD) can’t export its RIB"
|
||||||
ewarn "to the FIB. It’s only suitable for route-reflectors or"
|
ewarn "to the FIB. It’s only suitable for route-reflectors or"
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ src_install() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pkg_postinst() {
|
pkg_postinst() {
|
||||||
if [ -z "${REPLACING_VERSIONS}" ]; then
|
if [[ -z "${REPLACING_VERSIONS}" ]]; then
|
||||||
ewarn ""
|
ewarn ""
|
||||||
ewarn "OpenBGPD portable (not running on OpenBSD) can’t export its RIB"
|
ewarn "OpenBGPD portable (not running on OpenBSD) can’t export its RIB"
|
||||||
ewarn "to the FIB. It’s only suitable for route-reflectors or"
|
ewarn "to the FIB. It’s only suitable for route-reflectors or"
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ src_install() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pkg_postinst() {
|
pkg_postinst() {
|
||||||
if [ -z "${REPLACING_VERSIONS}" ]; then
|
if [[ -z "${REPLACING_VERSIONS}" ]]; then
|
||||||
ewarn ""
|
ewarn ""
|
||||||
ewarn "OpenBGPD portable (not running on OpenBSD) can’t export its RIB"
|
ewarn "OpenBGPD portable (not running on OpenBSD) can’t export its RIB"
|
||||||
ewarn "to the FIB. It’s only suitable for route-reflectors or"
|
ewarn "to the FIB. It’s only suitable for route-reflectors or"
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ src_install() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pkg_postinst() {
|
pkg_postinst() {
|
||||||
if [ -z "${REPLACING_VERSIONS}" ]; then
|
if [[ -z "${REPLACING_VERSIONS}" ]]; then
|
||||||
ewarn ""
|
ewarn ""
|
||||||
ewarn "OpenBGPD portable (not running on OpenBSD) can’t export its RIB"
|
ewarn "OpenBGPD portable (not running on OpenBSD) can’t export its RIB"
|
||||||
ewarn "to the FIB. It’s only suitable for route-reflectors or"
|
ewarn "to the FIB. It’s only suitable for route-reflectors or"
|
||||||
|
|||||||
@@ -126,22 +126,22 @@ pkg_postrm() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove auto-cpufreq log file
|
# 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
|
rm "${EROOT}"/var/log/auto-cpufreq.log || die
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove auto-cpufreq-install script
|
# 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
|
rm "${EROOT}"/usr/bin/auto-cpufreq-install || die
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Restore original cpufreqctl binary if backup was made
|
# 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
|
mv "${EROOT}"/usr/bin/cpufreqctl.auto-cpufreq{.bak,} || die
|
||||||
fi
|
fi
|
||||||
# Remove auto-cpufreq's cpufreqctl binary
|
# Remove auto-cpufreq's cpufreqctl binary
|
||||||
# it overwrites cpufreqctl.sh
|
# it overwrites cpufreqctl.sh
|
||||||
if [ -f "${EROOT}/usr/bin/cpufreqctl" ]; then
|
if [[ -f "${EROOT}/usr/bin/cpufreqctl" ]]; then
|
||||||
rm "${EROOT}"/usr/bin/cpufreqctl || die
|
rm "${EROOT}"/usr/bin/cpufreqctl || die
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -124,22 +124,22 @@ pkg_postrm() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove auto-cpufreq log file
|
# 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
|
rm "${EROOT}"/var/log/auto-cpufreq.log || die
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove auto-cpufreq-install script
|
# 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
|
rm "${EROOT}"/usr/bin/auto-cpufreq-install || die
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Restore original cpufreqctl binary if backup was made
|
# 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
|
mv "${EROOT}"/usr/bin/cpufreqctl.auto-cpufreq{.bak,} || die
|
||||||
fi
|
fi
|
||||||
# Remove auto-cpufreq's cpufreqctl binary
|
# Remove auto-cpufreq's cpufreqctl binary
|
||||||
# it overwrites cpufreqctl.sh
|
# it overwrites cpufreqctl.sh
|
||||||
if [ -f "${EROOT}/usr/bin/cpufreqctl" ]; then
|
if [[ -f "${EROOT}/usr/bin/cpufreqctl" ]]; then
|
||||||
rm "${EROOT}"/usr/bin/cpufreqctl || die
|
rm "${EROOT}"/usr/bin/cpufreqctl || die
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -121,22 +121,22 @@ pkg_postrm() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove auto-cpufreq log file
|
# 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
|
rm "${EROOT}"/var/log/auto-cpufreq.log || die
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove auto-cpufreq-install script
|
# 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
|
rm "${EROOT}"/usr/bin/auto-cpufreq-install || die
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Restore original cpufreqctl binary if backup was made
|
# 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
|
mv "${EROOT}"/usr/bin/cpufreqctl.auto-cpufreq{.bak,} || die
|
||||||
fi
|
fi
|
||||||
# Remove auto-cpufreq's cpufreqctl binary
|
# Remove auto-cpufreq's cpufreqctl binary
|
||||||
# it overwrites cpufreqctl.sh
|
# it overwrites cpufreqctl.sh
|
||||||
if [ -f "${EROOT}/usr/bin/cpufreqctl" ]; then
|
if [[ -f "${EROOT}/usr/bin/cpufreqctl" ]]; then
|
||||||
rm "${EROOT}"/usr/bin/cpufreqctl || die
|
rm "${EROOT}"/usr/bin/cpufreqctl || die
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -92,7 +92,7 @@ BDEPEND="app-arch/unzip"
|
|||||||
src_install() {
|
src_install() {
|
||||||
insinto "/usr/share/icons"
|
insinto "/usr/share/icons"
|
||||||
for folder in * ; do
|
for folder in * ; do
|
||||||
if [ -d "${folder}" ]; then
|
if [[ -d "${folder}" ]]; then
|
||||||
doins -r "${folder}"
|
doins -r "${folder}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ BDEPEND="app-arch/unzip"
|
|||||||
src_install() {
|
src_install() {
|
||||||
insinto "/usr/share/icons"
|
insinto "/usr/share/icons"
|
||||||
for folder in * ; do
|
for folder in * ; do
|
||||||
if [ -d "${folder}" ]; then
|
if [[ -d "${folder}" ]]; then
|
||||||
doins -r "${folder}"
|
doins -r "${folder}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ BDEPEND="
|
|||||||
src_install() {
|
src_install() {
|
||||||
insinto "/usr/share/themes"
|
insinto "/usr/share/themes"
|
||||||
for folder in * ; do
|
for folder in * ; do
|
||||||
if [ -d "${folder}" ]; then
|
if [[ -d "${folder}" ]]; then
|
||||||
doins -r "${folder}"
|
doins -r "${folder}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ BDEPEND="
|
|||||||
src_install() {
|
src_install() {
|
||||||
insinto "/usr/share/themes"
|
insinto "/usr/share/themes"
|
||||||
for folder in * ; do
|
for folder in * ; do
|
||||||
if [ -d "${folder}" ]; then
|
if [[ -d "${folder}" ]]; then
|
||||||
doins -r "${folder}"
|
doins -r "${folder}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in new issue
Block a user