parent
4472e41952
commit
b5b7983ade
1 changed files with 11 additions and 7 deletions
18
.ci/grep.sh
18
.ci/grep.sh
|
@ -2,6 +2,8 @@
|
||||||
# Description: check various bad patterns with grep
|
# Description: check various bad patterns with grep
|
||||||
# https://postmarketos.org/pmb-ci
|
# https://postmarketos.org/pmb-ci
|
||||||
|
|
||||||
|
exit_code=0
|
||||||
|
|
||||||
if [ "$(id -u)" = 0 ]; then
|
if [ "$(id -u)" = 0 ]; then
|
||||||
set -x
|
set -x
|
||||||
apk -q add grep
|
apk -q add grep
|
||||||
|
@ -12,7 +14,7 @@ fi
|
||||||
if grep -qr '(CHANGEME!)' -- *; then
|
if grep -qr '(CHANGEME!)' -- *; then
|
||||||
echo "ERROR: Please replace '(CHANGEME!)' in the following files:"
|
echo "ERROR: Please replace '(CHANGEME!)' in the following files:"
|
||||||
grep --color=always -r '(CHANGEME!)' -- *
|
grep --color=always -r '(CHANGEME!)' -- *
|
||||||
exit 1
|
exit_code=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# DTBs installed to /usr/share/db
|
# DTBs installed to /usr/share/db
|
||||||
|
@ -23,7 +25,7 @@ if grep -qr 'INSTALL_DTBS_PATH="$pkgdir"/usr/share/dtb' device/; then
|
||||||
echo 'ERROR: Files that need fixing:'
|
echo 'ERROR: Files that need fixing:'
|
||||||
# shellcheck disable=SC2016
|
# shellcheck disable=SC2016
|
||||||
grep --color=always -r 'INSTALL_DTBS_PATH="$pkgdir"/usr/share/dtb' device/
|
grep --color=always -r 'INSTALL_DTBS_PATH="$pkgdir"/usr/share/dtb' device/
|
||||||
exit 1
|
exit_code=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,26 +33,26 @@ fi
|
||||||
if grep -qr '/etc/postmarketos-mkinitfs' -- *; then
|
if grep -qr '/etc/postmarketos-mkinitfs' -- *; then
|
||||||
echo "ERROR: Please replace '/etc/postmarketos-mkinitfs' with '/usr/share/mkinitfs' in the following files:"
|
echo "ERROR: Please replace '/etc/postmarketos-mkinitfs' with '/usr/share/mkinitfs' in the following files:"
|
||||||
grep --color=always -r '/etc/postmarketos-mkinitfs' -- *
|
grep --color=always -r '/etc/postmarketos-mkinitfs' -- *
|
||||||
exit 1
|
exit_code=1
|
||||||
fi
|
fi
|
||||||
if grep -qr '/usr/share/postmarketos-mkinitfs' -- *; then
|
if grep -qr '/usr/share/postmarketos-mkinitfs' -- *; then
|
||||||
echo "ERROR: Please replace '/usr/share/postmarketos-mkinitfs' with '/usr/share/mkinitfs' in the following files:"
|
echo "ERROR: Please replace '/usr/share/postmarketos-mkinitfs' with '/usr/share/mkinitfs' in the following files:"
|
||||||
grep --color=always -r '/usr/share/postmarketos-mkinitfs' -- *
|
grep --color=always -r '/usr/share/postmarketos-mkinitfs' -- *
|
||||||
exit 1
|
exit_code=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Direct sourcing of deviceinfo
|
# Direct sourcing of deviceinfo
|
||||||
if grep --exclude='source_deviceinfo' -qEr 'source /etc/deviceinfo|\. /etc/deviceinfo' -- *; then
|
if grep --exclude='source_deviceinfo' -qEr 'source /etc/deviceinfo|\. /etc/deviceinfo' -- *; then
|
||||||
echo 'ERROR: Please source the source_deviceinfo script instead of sourcing deviceinfo directly!'
|
echo 'ERROR: Please source the source_deviceinfo script instead of sourcing deviceinfo directly!'
|
||||||
grep --color=always --exclude='rootfs-usr-share-misc-source_deviceinfo' -Er 'source /etc/deviceinfo|\. /etc/deviceinfo' -- *
|
grep --color=always --exclude='rootfs-usr-share-misc-source_deviceinfo' -Er 'source /etc/deviceinfo|\. /etc/deviceinfo' -- *
|
||||||
exit 1
|
exit_code=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Removed deviceinfo variable
|
# Removed deviceinfo variable
|
||||||
if grep -qr 'deviceinfo_modules_initfs' -- *; then
|
if grep -qr 'deviceinfo_modules_initfs' -- *; then
|
||||||
echo 'ERROR: deviceinfo_modules_initfs variable has been removed. Use "modules-initfs" file instead.'
|
echo 'ERROR: deviceinfo_modules_initfs variable has been removed. Use "modules-initfs" file instead.'
|
||||||
grep --color=always -r 'deviceinfo_modules_initfs' -- *
|
grep --color=always -r 'deviceinfo_modules_initfs' -- *
|
||||||
exit 1
|
exit_code=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
POSTMARKETOS_WALLPAPER_PATH='/usr/share/wallpapers/postmarketos.jpg'
|
POSTMARKETOS_WALLPAPER_PATH='/usr/share/wallpapers/postmarketos.jpg'
|
||||||
|
@ -69,5 +71,7 @@ if grep -qr $POSTMARKETOS_WALLPAPER_PATH \
|
||||||
--exclude-dir='device-xiaomi-willow' \
|
--exclude-dir='device-xiaomi-willow' \
|
||||||
--exclude-dir='device-nokia-n900' \
|
--exclude-dir='device-nokia-n900' \
|
||||||
-- device
|
-- device
|
||||||
exit 1
|
exit_code=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
exit "$exit_code"
|
||||||
|
|
Loading…
Reference in a new issue