Open sweep-nightly[bot] opened 1 year ago
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
[X] extensions/nvidia.sh
❌ Failed
• Replace all instances of 'x-hack' with a modern approach. For example, change `[[ "x${VAR}" == "xVALUE" ]]` to `[[ "${VAR}" == "VALUE" ]]`.
[X] extensions/v4l2loopback-dkms.sh
❌ Failed
• Replace all instances of 'x-hack' with a modern approach. For example, change `[[ "x${VAR}" == "xVALUE" ]]` to `[[ "${VAR}" == "VALUE" ]]`.
[X] extensions/grub.sh
❌ Failed
• Replace all instances of 'x-hack' with a modern approach. For example, change `[[ "x${VAR}" == "xVALUE" ]]` to `[[ "${VAR}" == "VALUE" ]]`.
[X] extensions/nomod.sh
❌ Failed
• Replace all instances of 'x-hack' with a modern approach. For example, change `[[ "x${VAR}" == "xVALUE" ]]` to `[[ "${VAR}" == "VALUE" ]]`.
[X] extensions/zfs.sh
❌ Failed
• Replace all instances of 'x-hack' with a modern approach. For example, change `[[ "x${VAR}" == "xVALUE" ]]` to `[[ "${VAR}" == "VALUE" ]]`.
[X] lib/functions/artifacts/artifact-armbian-bsp-cli.sh
❌ Failed
• Replace all instances of 'x-hack' with a modern approach. For example, change `[[ "x${VAR}" == "xVALUE" ]]` to `[[ "${VAR}" == "VALUE" ]]`.
[X] lib/functions/artifacts/artifact-firmware.sh
❌ Failed
• Replace all instances of 'x-hack' with a modern approach. For example, change `[[ "x${VAR}" == "xVALUE" ]]` to `[[ "${VAR}" == "VALUE" ]]`.
[X] lib/functions/artifacts/artifacts-obtain.sh
✅ Commit 5eeccc2
• Replace all instances of 'x-hack' with a modern approach. For example, change `[[ "x${VAR}" == "xVALUE" ]]` to `[[ "${VAR}" == "VALUE" ]]`.Sandbox Execution Logs
I have finished reviewing the code for completeness. I did not find errors for sweep/replace-x-hack_22
.
.
🎉 Latest improvements to Sweep:
💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord
x-hack is a shell/bash conditional using any letter (often 'x' thus the 'x-hack' name) followed by variable declaration ${var} and checking against the same letter followed by value such as:
This was done to ensure compatibility across different shells and systems many years ago, but today it's obsolete as the shells evolved enough to be more reliable.
That said the armbian codebase is still using them for some reason and it was agreed that these should be replaced so i want you to look through the codebase and fix all x-hacks.
Note that the declaration can also be written without quotes:
Or even checking for a directory:
Parent issue: #91
Checklist
- [X] `extensions/nvidia.sh` ❌ Failed - [X] `extensions/v4l2loopback-dkms.sh` ❌ Failed - [X] `extensions/grub.sh` ❌ Failed - [X] `extensions/nomod.sh` ❌ Failed - [X] `extensions/zfs.sh` ❌ Failed - [X] `lib/functions/artifacts/artifact-armbian-bsp-cli.sh` ❌ Failed - [X] `lib/functions/artifacts/artifact-firmware.sh` ❌ Failed - [X] `lib/functions/artifacts/artifacts-obtain.sh` ✅ Commit [`5eeccc2`](https://github.com/kevinlu1248/armbian-build/commit/5eeccc2cbc425060d39bdc9cfd338abda6bb1ea2)