Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sweep (map): Get rid of 'x-hack' such as [ “x$var” = “xval” ] from the code #2

Open
6 tasks
Kreyren opened this issue Oct 2, 2023 · 1 comment
Labels

Comments

@Kreyren
Copy link

Kreyren commented Oct 2, 2023

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:

# bash
[[ “x$var== “xval” ]]

# POSIX shell
[ “x$var= “xval” ]

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:

[[ x$var == xval ]]

Or even checking for a directory:

[[ x$var == xval/ ]]

Prefer to use e.g. [ -z "$var" ] over [ "$var" = "" ]

The following files alll have issues with x-hacks, try to address it

Break the following ~30 files into 6 issues editing 5 files each.

./packages/blobs/grub/09_linux_with_dtb.sh
./packages/bsp/nanopim4/nanopim4-pwm-fan.sh
./lib/tools/shellcheck.sh
./lib/functions/artifacts/artifact-armbian-bsp-cli.sh
./lib/functions/artifacts/artifact-firmware.sh
./lib/functions/rootfs/distro-specific.sh
./lib/functions/artifacts/artifacts-obtain.sh
./lib/functions/artifacts/artifacts-reversion.sh
./lib/functions/artifacts/artifact-uboot.sh
./lib/functions/artifacts/artifact-armbian-base-files.sh
./lib/functions/cli/entrypoint.sh
./lib/functions/artifacts/artifact-rootfs.sh
./lib/functions/artifacts/artifact-kernel.sh
./lib/functions/cli/commands.sh
./lib/functions/artifacts/artifact-full_firmware.sh
./lib/functions/cli/utils-cli.sh
./lib/functions/main/config-prepare.sh
./lib/functions/main/start-end.sh
./lib/functions/artifacts/artifact-fake-ubuntu-advantage-tools.sh
./lib/functions/cli/cli-patch.sh
./lib/functions/artifacts/artifact-armbian-zsh.sh
./lib/functions/rootfs/distro-agnostic.sh
./lib/functions/main/build-packages.sh
./lib/functions/artifacts/artifact-armbian-plymouth-theme.sh
./lib/functions/cli/cli-distccd.sh
./lib/functions/artifacts/artifact-armbian-desktop.sh
./lib/functions/cli/cli-configdump.sh
./lib/functions/artifacts/artifact-armbian-config.sh
./lib/functions/artifacts/artifact-armbian-bsp-desktop.sh
./lib/functions/logging/trap-logging.sh
./lib/functions/logging/traps.sh
./lib/functions/rootfs/create-cache.sh
./lib/functions/rootfs/rootfs-create.sh
./lib/functions/image/partitioning.sh
./lib/functions/image/initrd.sh
./lib/functions/image/rootfs-to-image.sh
./lib/functions/logging/runners.sh
./lib/functions/image/loop.sh
./lib/functions/logging/logging.sh
./lib/functions/logging/export-logs.sh
./lib/functions/logging/debug-dump.sh
./lib/functions/image/compress-checksum.sh
./lib/functions/logging/capture.sh
./lib/functions/host/host-utils.sh
./lib/functions/compilation/kernel-debs.sh
./extensions/grub-sbc-media.sh
./lib/functions/compilation/uboot.sh
./extensions/lsmod.sh
./extensions/nomod.sh
./extensions/nvidia.sh
./extensions/v4l2loopback-dkms.sh
./extensions/zfs.sh
./lib/functions/compilation/utils-compilation.sh
./lib/functions/compilation/kernel-make.sh
./lib/functions/compilation/kernel.sh
./extensions/grub.sh
./lib/functions/general/git-ref2info.sh
./lib/functions/general/apt-utils.sh
./extensions/gen-sample-extension-docs.sh
./lib/functions/general/shellcheck.sh
./lib/functions/general/python-tools.sh
./lib/functions/general/memoize-cached.sh
./lib/functions/general/oci-oras.sh
./lib/functions/compilation/patch/drivers-harness.sh
./lib/functions/general/hash-files.sh
./lib/functions/compilation/packages/utils-dpkgdeb.sh
./lib/functions/compilation/patch/patching.sh
./lib/functions/host/wsl2.sh
./lib/functions/compilation/distcc.sh
./lib/functions/host/prepare-host.sh
./lib/functions/compilation/crust.sh
./lib/functions/general/downloads.sh
./lib/functions/bsp/armbian-bsp-cli-deb.sh
./lib/functions/general/git.sh
./lib/functions/configuration/menu.sh
./lib/functions/host/docker.sh
./lib/functions/configuration/main-config.sh
./lib/functions/host/tmpfs-utils.sh
./lib/functions/host/mktemp-utils.sh
./lib/functions/compilation/atf.sh
./lib/functions/configuration/interactive.sh
./lib/functions/configuration/config-desktop.sh
./lib/functions/compilation/armbian-kernel.sh
./lib/functions/general/chroot-helpers.sh
./lib/functions/general/extensions.sh
./lib/functions/configuration/package-lists.sh


Checklist:

**Replace 'x-hack' conditionals in artifact-armbian-bsp-cli.sh and artifact-firmware.sh** * In lib/functions/artifacts/artifact-armbian-bsp-cli.sh, replace all 'x-hack' conditionals with modern conditionals. * In lib/functions/artifacts/artifact-firmware.sh, replace all 'x-hack' conditionals with modern conditionals.
**Replace 'x-hack' conditionals in artifact-armbian-base-files.sh and artifact-uboot.sh** * In lib/functions/artifacts/artifact-armbian-base-files.sh, replace all 'x-hack' conditionals with modern conditionals. * In lib/functions/artifacts/artifact-uboot.sh, replace all 'x-hack' conditionals with modern conditionals.
**Replace 'x-hack' conditionals in artifact-rootfs.sh and artifact-kernel.sh** * In lib/functions/artifacts/artifact-rootfs.sh, replace all 'x-hack' conditionals with modern conditionals. * In lib/functions/artifacts/artifact-kernel.sh, replace all 'x-hack' conditionals with modern conditionals.
**Replace 'x-hack' conditionals in artifact-full_firmware.sh and artifact-fake-ubuntu-advantage-tools.sh** * In lib/functions/artifacts/artifact-full_firmware.sh, replace all 'x-hack' conditionals with modern conditionals. * In lib/functions/artifacts/artifact-fake-ubuntu-advantage-tools.sh, replace all 'x-hack' conditionals with modern conditionals.
**Replace 'x-hack' conditionals in artifact-armbian-zsh.sh and artifact-armbian-plymouth-theme.sh** * In lib/functions/artifacts/artifact-armbian-zsh.sh, replace all 'x-hack' conditionals with modern conditionals. * In lib/functions/artifacts/artifact-armbian-plymouth-theme.sh, replace all 'x-hack' conditionals with modern conditionals.
**Replace 'x-hack' conditionals in artifact-armbian-config.sh and artifact-armbian-bsp-desktop.sh** * In lib/functions/artifacts/artifact-armbian-config.sh, replace all 'x-hack' conditionals with modern conditionals. * In lib/functions/artifacts/artifact-armbian-bsp-desktop.sh, replace all 'x-hack' conditionals with modern conditionals.
@sweep-ai sweep-ai bot added the sweep label Oct 2, 2023
@sweep-ai
Copy link

sweep-ai bot commented Oct 2, 2023

Sweeping

100%

⚡ Sweep Free Trial: I'm creating this ticket using GPT-4. You have 4 GPT-4 tickets left for the month and 2 for the day. For more GPT-4 tickets, visit our payment portal.
* Install Sweep Configs: [Pull Request](https://github.com//pull/1)

Actions (click)

  • ↻ Restart Sweep

Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description.

https://github.com/AerithForge/the-ai-experiments/blob/6f5112cdc8e23b172f8940601d9b1471b4bfd87d/lib/functions/artifacts/artifact-armbian-bsp-cli.sh#L205-L174

#!/usr/bin/env bash
#
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (c) 2013-2023 Igor Pecovnik, igor@armbian.com
#
# This file is a part of the Armbian Build Framework
# https://github.com/armbian/build/
function artifact_armbian-desktop_config_dump() {
artifact_input_variables[RELEASE]="${RELEASE}"
artifact_input_variables[DESKTOP_ENVIRONMENT]="${DESKTOP_ENVIRONMENT}"
# Include a hash of the results of aggregation.
declare aggregation_hash="undetermined"
aggregation_hash="$(echo "${AGGREGATED_DESKTOP_POSTINST} ${AGGREGATED_DESKTOP_CREATE_DESKTOP_PACKAGE} ${AGGREGATED_PACKAGES_DESKTOP_COMMA}" | sha256sum | cut -d' ' -f1)"
artifact_input_variables[DESKTOP_AGGREGATION_RESULTS]="${aggregation_hash}"
}
function artifact_armbian-desktop_prepare_version() {
: "${RELEASE:?RELEASE is not set}"
: "${DESKTOP_ENVIRONMENT:?DESKTOP_ENVIRONMENT is not set}"
: "${DESKTOP_ENVIRONMENT_CONFIG_NAME:?DESKTOP_ENVIRONMENT_CONFIG_NAME is not set}" # Not keyed, but required.
artifact_version="undetermined" # outer scope
artifact_version_reason="undetermined" # outer scope
declare short_hash_size=4
declare fake_unchanging_base_version="1"
# Hash variables that affect the contents of desktop package
declare -a vars_to_hash=(
"${AGGREGATED_DESKTOP_POSTINST}"
"${AGGREGATED_DESKTOP_CREATE_DESKTOP_PACKAGE}"
"${AGGREGATED_PACKAGES_DESKTOP_COMMA}"
)
declare hash_variables="undetermined" # will be set by calculate_hash_for_variables()...
do_normalize_src_path="no" calculate_hash_for_variables "${vars_to_hash[@]}" # ... where do_normalize_src_path="yes" is the default
declare var_config_hash_short="${hash_variables:0:${short_hash_size}}"
# get the hashes of the lib/ bash sources involved...
declare hash_files="undetermined"
calculate_hash_for_bash_deb_artifact "compilation/packages/armbian-desktop-deb.sh"
declare bash_hash="${hash_files}"
declare bash_hash_short="${bash_hash:0:${short_hash_size}}"
# outer scope
artifact_version="${fake_unchanging_base_version}-V${var_config_hash_short}-B${bash_hash_short}"
declare -a reasons=(
"Armbian armbian-desktop"
"vars hash \"${vars_config_hash}\""
"framework bash hash \"${bash_hash}\""
)
artifact_version_reason="${reasons[*]}" # outer scope
artifact_name="armbian-${RELEASE}-desktop-${DESKTOP_ENVIRONMENT}"
artifact_type="deb"
artifact_deb_repo="${RELEASE}"
artifact_deb_arch="all"
artifact_map_packages=(["armbian-desktop"]="${artifact_name}")
return 0
}
function artifact_armbian-desktop_build_from_sources() {
LOG_SECTION="compile_armbian-desktop" do_with_logging compile_armbian-desktop
}
function artifact_armbian-desktop_cli_adapter_pre_run() {
declare -g ARMBIAN_COMMAND_REQUIRE_BASIC_DEPS="yes" # Require prepare_host_basic to run before the command.
# "gimme root on a Linux machine"
cli_standard_relaunch_docker_or_sudo
}
function artifact_armbian-desktop_cli_adapter_config_prep() {
: "${RELEASE:?RELEASE is not set}"
: "${DESKTOP_ENVIRONMENT:?DESKTOP_ENVIRONMENT is not set}"
: "${DESKTOP_ENVIRONMENT_CONFIG_NAME:?DESKTOP_ENVIRONMENT_CONFIG_NAME is not set}"
# this requires aggregation, and thus RELEASE, but also everything else.
declare -g artifact_version_requires_aggregation="yes"
use_board="yes" allow_no_family="no" skip_kernel="no" prep_conf_main_only_rootfs_ni < /dev/null # no stdin for this, so it bombs if tries to be interactive.
}
function artifact_armbian-desktop_get_default_oci_target() {
artifact_oci_target_base="${GHCR_SOURCE}/armbian/os/"
}
function artifact_armbian-desktop_is_available_in_local_cache() {
is_artifact_available_in_local_cache
}
function artifact_armbian-desktop_is_available_in_remote_cache() {
is_artifact_available_in_remote_cache
}
function artifact_armbian-desktop_obtain_from_remote_cache() {
obtain_artifact_from_remote_cache
}
function artifact_armbian-desktop_deploy_to_remote_cache() {
upload_artifact_to_oci

#!/usr/bin/env bash
#
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (c) 2013-2023 Igor Pecovnik, igor@armbian.com
#
# This file is a part of the Armbian Build Framework
# https://github.com/armbian/build/
function artifact_armbian-bsp-desktop_config_dump() {
artifact_input_variables[RELEASE]="${RELEASE}"
artifact_input_variables[BOARD]="${BOARD}"
artifact_input_variables[BRANCH]="${BRANCH}"
# @TODO: this should not be true... but is.
artifact_input_variables[DESKTOP_ENVIRONMENT]="${DESKTOP_ENVIRONMENT}"
artifact_input_variables[DESKTOP_ENVIRONMENT_CONFIG_NAME]="${DESKTOP_ENVIRONMENT_CONFIG_NAME}"
}
function artifact_armbian-bsp-desktop_prepare_version() {
: "${BRANCH:?BRANCH is not set}"
: "${BOARD:?BOARD is not set}"
: "${RELEASE:?RELEASE is not set}"
# @TODO: this should not be true... but is.
: "${DESKTOP_ENVIRONMENT:?DESKTOP_ENVIRONMENT is not set}"
: "${DESKTOP_ENVIRONMENT_CONFIG_NAME:?DESKTOP_ENVIRONMENT_CONFIG_NAME is not set}"
artifact_version="undetermined" # outer scope
artifact_version_reason="undetermined" # outer scope
declare short_hash_size=4
declare fake_unchanging_base_version="1"
# @TODO: hash copy_all_packages_files_for "bsp-desktop"
# get the hashes of the lib/ bash sources involved...
declare hash_files="undetermined"
calculate_hash_for_bash_deb_artifact "bsp/armbian-bsp-desktop-deb.sh"
declare bash_hash="${hash_files}"
declare bash_hash_short="${bash_hash:0:${short_hash_size}}"
# outer scope
artifact_version="${fake_unchanging_base_version}-B${bash_hash_short}"
declare -a reasons=(
"Armbian armbian-bsp-desktop"
"framework bash hash \"${bash_hash}\""
)
artifact_version_reason="${reasons[*]}" # outer scope
artifact_name="armbian-bsp-desktop-${BOARD}-${BRANCH}"
artifact_type="deb"
artifact_deb_repo="${RELEASE}"
artifact_deb_arch="${ARCH}"
artifact_map_packages=(["armbian-bsp-desktop"]="${artifact_name}")
return 0
}
function artifact_armbian-bsp-desktop_build_from_sources() {
LOG_SECTION="compile_armbian-bsp-desktop" do_with_logging compile_armbian-bsp-desktop
}
function artifact_armbian-bsp-desktop_cli_adapter_pre_run() {
declare -g ARMBIAN_COMMAND_REQUIRE_BASIC_DEPS="yes" # Require prepare_host_basic to run before the command.
# "gimme root on a Linux machine"
cli_standard_relaunch_docker_or_sudo
}
function artifact_armbian-bsp-desktop_cli_adapter_config_prep() {
: "${RELEASE:?RELEASE is not set}"
: "${BOARD:?BOARD is not set}"
# @TODO: this should not be true... but is.
: "${DESKTOP_ENVIRONMENT:?DESKTOP_ENVIRONMENT is not set}"
: "${DESKTOP_ENVIRONMENT_CONFIG_NAME:?DESKTOP_ENVIRONMENT_CONFIG_NAME is not set}"
# this requires aggregation, and thus RELEASE, but also everything else.
declare -g artifact_version_requires_aggregation="yes"
use_board="yes" allow_no_family="no" skip_kernel="no" prep_conf_main_only_rootfs_ni < /dev/null # no stdin for this, so it bombs if tries to be interactive.
}
function artifact_armbian-bsp-desktop_get_default_oci_target() {
artifact_oci_target_base="${GHCR_SOURCE}/armbian/os/"
}
function artifact_armbian-bsp-desktop_is_available_in_local_cache() {
is_artifact_available_in_local_cache
}
function artifact_armbian-bsp-desktop_is_available_in_remote_cache() {
is_artifact_available_in_remote_cache
}
function artifact_armbian-bsp-desktop_obtain_from_remote_cache() {
obtain_artifact_from_remote_cache
}
function artifact_armbian-bsp-desktop_deploy_to_remote_cache() {
upload_artifact_to_oci

#!/usr/bin/env bash
#
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (c) 2013-2023 Igor Pecovnik, igor@armbian.com
#
# This file is a part of the Armbian Build Framework
# https://github.com/armbian/build/
function artifact_firmware_config_dump() {
# artifact_input_variables: None, for firmware.
:
}
function artifact_firmware_prepare_version() {
artifact_version="undetermined" # outer scope
artifact_version_reason="undetermined" # outer scope
local ARMBIAN_FIRMWARE_SOURCE="${ARMBIAN_FIRMWARE_GIT_SOURCE:-"https://github.com/armbian/firmware"}"
local ARMBIAN_FIRMWARE_BRANCH="branch:${ARMBIAN_FIRMWARE_GIT_BRANCH:-"master"}"
debug_var ARMBIAN_FIRMWARE_SOURCE
debug_var ARMBIAN_FIRMWARE_BRANCH
declare short_hash_size=4
declare -A GIT_INFO_ARMBIAN_FIRMWARE=([GIT_SOURCE]="${ARMBIAN_FIRMWARE_SOURCE}" [GIT_REF]="${ARMBIAN_FIRMWARE_BRANCH}")
run_memoized GIT_INFO_ARMBIAN_FIRMWARE "git2info" memoized_git_ref_to_info
debug_dict GIT_INFO_ARMBIAN_FIRMWARE
# Sanity check, the SHA1 gotta be sane.
[[ "${GIT_INFO_ARMBIAN_FIRMWARE[SHA1]}" =~ ^[0-9a-f]{40}$ ]] || exit_with_error "SHA1 is not sane: '${GIT_INFO_ARMBIAN_FIRMWARE[SHA1]}'"
declare fake_unchanging_base_version="1"
declare short_sha1="${GIT_INFO_ARMBIAN_FIRMWARE[SHA1]:0:${short_hash_size}}"
# get the hashes of the lib/ bash sources involved...
declare hash_files="undetermined"
calculate_hash_for_bash_deb_artifact "compilation/packages/firmware-deb.sh"
declare bash_hash="${hash_files}"
declare bash_hash_short="${bash_hash:0:${short_hash_size}}"
# outer scope
artifact_version="${fake_unchanging_base_version}-SA${short_sha1}-B${bash_hash_short}"
declare -a reasons=(
"Armbian firmware git revision \"${GIT_INFO_ARMBIAN_FIRMWARE[SHA1]}\""
"framework bash hash \"${bash_hash}\""
)
artifact_version_reason="${reasons[*]}" # outer scope
artifact_map_packages=(["armbian-firmware"]="armbian-firmware")
artifact_name="armbian-firmware"
artifact_type="deb"
artifact_deb_repo="global"
artifact_deb_arch="all"
return 0
}
function artifact_firmware_build_from_sources() {
FULL="" REPLACE="-full" LOG_SECTION="compile_firmware" do_with_logging compile_firmware
}
function artifact_firmware_cli_adapter_pre_run() {
declare -g ARMBIAN_COMMAND_REQUIRE_BASIC_DEPS="yes" # Require prepare_host_basic to run before the command.
# "gimme root on a Linux machine"
cli_standard_relaunch_docker_or_sudo
}
function artifact_firmware_cli_adapter_config_prep() {
use_board="no" prep_conf_main_minimal_ni < /dev/null # no stdin for this, so it bombs if tries to be interactive.
}
function artifact_firmware_get_default_oci_target() {
artifact_oci_target_base="${GHCR_SOURCE}/armbian/os/"
}
function artifact_firmware_is_available_in_local_cache() {
is_artifact_available_in_local_cache
}
function artifact_firmware_is_available_in_remote_cache() {
is_artifact_available_in_remote_cache
}
function artifact_firmware_obtain_from_remote_cache() {
obtain_artifact_from_remote_cache
}
function artifact_firmware_deploy_to_remote_cache() {
upload_artifact_to_oci

#!/usr/bin/env bash
#
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (c) 2013-2023 Igor Pecovnik, igor@armbian.com
#
# This file is a part of the Armbian Build Framework
# https://github.com/armbian/build/
function artifact_full_firmware_config_dump() {
# artifact_input_variables: None, for firmware.
:
}
function artifact_full_firmware_prepare_version() {
artifact_version="undetermined" # outer scope
artifact_version_reason="undetermined" # outer scope
local ARMBIAN_FIRMWARE_SOURCE="${ARMBIAN_FIRMWARE_GIT_SOURCE:-"https://github.com/armbian/firmware"}"
local ARMBIAN_FIRMWARE_BRANCH="branch:${ARMBIAN_FIRMWARE_GIT_BRANCH:-"master"}"
debug_var ARMBIAN_FIRMWARE_SOURCE
debug_var ARMBIAN_FIRMWARE_BRANCH
debug_var MAINLINE_FIRMWARE_SOURCE
declare short_hash_size=4
declare -A GIT_INFO_ARMBIAN_FIRMWARE=([GIT_SOURCE]="${ARMBIAN_FIRMWARE_SOURCE}" [GIT_REF]="${ARMBIAN_FIRMWARE_BRANCH}")
run_memoized GIT_INFO_ARMBIAN_FIRMWARE "git2info" memoized_git_ref_to_info
debug_dict GIT_INFO_ARMBIAN_FIRMWARE
# Sanity check, the SHA1 gotta be sane.
[[ "${GIT_INFO_ARMBIAN_FIRMWARE[SHA1]}" =~ ^[0-9a-f]{40}$ ]] || exit_with_error "SHA1 is not sane: '${GIT_INFO_ARMBIAN_FIRMWARE[SHA1]}'"
declare -A GIT_INFO_MAINLINE_FIRMWARE=([GIT_SOURCE]="${MAINLINE_FIRMWARE_SOURCE}" [GIT_REF]="branch:main")
run_memoized GIT_INFO_MAINLINE_FIRMWARE "git2info" memoized_git_ref_to_info
debug_dict GIT_INFO_MAINLINE_FIRMWARE
# Sanity check, the SHA1 gotta be sane.
[[ "${GIT_INFO_MAINLINE_FIRMWARE[SHA1]}" =~ ^[0-9a-f]{40}$ ]] || exit_with_error "SHA1 is not sane: '${GIT_INFO_MAINLINE_FIRMWARE[SHA1]}'"
declare fake_unchanging_base_version="1"
declare short_sha1="${GIT_INFO_ARMBIAN_FIRMWARE[SHA1]:0:${short_hash_size}}"
declare short_sha1_mainline="${GIT_INFO_MAINLINE_FIRMWARE[SHA1]:0:${short_hash_size}}"
# get the hashes of the lib/ bash sources involved...
declare hash_files="undetermined"
calculate_hash_for_bash_deb_artifact "compilation/packages/firmware-deb.sh"
declare bash_hash="${hash_files}"
declare bash_hash_short="${bash_hash:0:${short_hash_size}}"
# outer scope
artifact_version="${fake_unchanging_base_version}-SA${short_sha1}-SM${short_sha1_mainline}-B${bash_hash_short}"
declare -a reasons=(
"Armbian firmware git revision \"${GIT_INFO_ARMBIAN_FIRMWARE[SHA1]}\""
"Mainline firmware git revision \"${GIT_INFO_MAINLINE_FIRMWARE[SHA1]}\""
"framework bash hash \"${bash_hash}\""
)
artifact_version_reason="${reasons[*]}" # outer scope
artifact_map_packages=(["armbian-firmware-full"]="armbian-firmware-full")
artifact_name="armbian-firmware-full"
artifact_type="deb"
artifact_deb_repo="global"
artifact_deb_arch="all"
return 0
}
function artifact_full_firmware_build_from_sources() {
FULL="-full" REPLACE="" LOG_SECTION="compile_firmware_full" do_with_logging compile_firmware
}
function artifact_full_firmware_cli_adapter_pre_run() {
declare -g ARMBIAN_COMMAND_REQUIRE_BASIC_DEPS="yes" # Require prepare_host_basic to run before the command.
# "gimme root on a Linux machine"
cli_standard_relaunch_docker_or_sudo
}
function artifact_full_firmware_cli_adapter_config_prep() {
use_board="no" prep_conf_main_minimal_ni < /dev/null # no stdin for this, so it bombs if tries to be interactive.
}
function artifact_full_firmware_get_default_oci_target() {
artifact_oci_target_base="${GHCR_SOURCE}/armbian/os/"
}
function artifact_full_firmware_is_available_in_local_cache() {
is_artifact_available_in_local_cache
}
function artifact_full_firmware_is_available_in_remote_cache() {
is_artifact_available_in_remote_cache
}
function artifact_full_firmware_obtain_from_remote_cache() {
obtain_artifact_from_remote_cache
}
function artifact_full_firmware_deploy_to_remote_cache() {
upload_artifact_to_oci


Step 2: ⌨️ Coding

I'm creating the following subissues:

#Replace 'x-hack' conditionals in artifact-armbian-bsp-cli.sh and artifact-firmware.sh:

* In lib/functions/artifacts/artifact-armbian-bsp-cli.sh, replace all 'x-hack' conditionals with modern conditionals. * In lib/functions/artifacts/artifact-firmware.sh, replace all 'x-hack' conditionals with modern conditionals.

#Replace 'x-hack' conditionals in artifact-armbian-base-files.sh and artifact-uboot.sh:

* In lib/functions/artifacts/artifact-armbian-base-files.sh, replace all 'x-hack' conditionals with modern conditionals. * In lib/functions/artifacts/artifact-uboot.sh, replace all 'x-hack' conditionals with modern conditionals.

#Replace 'x-hack' conditionals in artifact-rootfs.sh and artifact-kernel.sh:

* In lib/functions/artifacts/artifact-rootfs.sh, replace all 'x-hack' conditionals with modern conditionals. * In lib/functions/artifacts/artifact-kernel.sh, replace all 'x-hack' conditionals with modern conditionals.

#Replace 'x-hack' conditionals in artifact-full_firmware.sh and artifact-fake-ubuntu-advantage-tools.sh:

* In lib/functions/artifacts/artifact-full_firmware.sh, replace all 'x-hack' conditionals with modern conditionals. * In lib/functions/artifacts/artifact-fake-ubuntu-advantage-tools.sh, replace all 'x-hack' conditionals with modern conditionals.

#Replace 'x-hack' conditionals in artifact-armbian-zsh.sh and artifact-armbian-plymouth-theme.sh:

* In lib/functions/artifacts/artifact-armbian-zsh.sh, replace all 'x-hack' conditionals with modern conditionals. * In lib/functions/artifacts/artifact-armbian-plymouth-theme.sh, replace all 'x-hack' conditionals with modern conditionals.

#Replace 'x-hack' conditionals in artifact-armbian-config.sh and artifact-armbian-bsp-desktop.sh:

* In lib/functions/artifacts/artifact-armbian-config.sh, replace all 'x-hack' conditionals with modern conditionals. * In lib/functions/artifacts/artifact-armbian-bsp-desktop.sh, replace all 'x-hack' conditionals with modern conditionals.

Step 3: 🔁 Code Review

I finished creating the subissues! Track them at:


🎉 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant