gnuboot/resources
Denis 'GNUtoo' Carikli 34007c4baf
scripts: misc: guix.sh: make it pass shellcheck.
Without this fix, running shellcheck -x on
resources/scripts/misc/guix.sh returns many errors.

For each guix version declaration we have something like that:
    In resources/scripts/misc/guix.sh line 21:
    guix_v0_0="6365068393254e1131ab80eb0d68a759e7fd2256"
    ^-------^ SC2034 (warning): guix_v0_0 appears unused.
    Verify use (or export if used externally).
and here the variables are actually used in this code:
    guix_version_commit()
    {
        version="$1"

        eval echo "$(echo \$guix_"${version}" | sed 's#\.#_#g')"
    }
so we workaround by disabling that test for each version declaration.

Then shellcheck cannot find "$GUIX_PROFILE"/etc/profile:
In resources/scripts/misc/guix.sh line 91:
        . "$GUIX_PROFILE"/etc/profile
          ^-------------------------^ SC1091 (info):
   Not following: ./etc/profile: openBinaryFile:
   does not exist (No such file or directory)
so we disabled that test for this line.

After that we have many issues with quoting like this one:
    In resources/scripts/misc/guix.sh line 104:
        eval echo $(echo \$guix_"${version}" | sed 's#\.#_#g')
                  ^-- SC2046 (warning):
                  Quote this to prevent word splitting.
or this one:
    In resources/scripts/misc/guix.sh line 233:
        major="$(echo ${version} | awk -F . '{print $1}')"
                      ^--------^ SC2086 (info):
                      Double quote to prevent globbing and word splitting.
these were fixed.

We also improved a test by using grep -q:
    In resources/scripts/misc/guix.sh line 272:
        elif [ -n "$(echo ${revision} | grep '\.')" ] ; then
               ^-- SC2143 (style):
        Use grep -q instead of comparing output with [ -n .. ]

And finally in guix_version_commit a sed was avoided by using bash
replacement, and when that was not possible (in guix_next_version),
the shellcheck test for that was disabled.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
2024-05-12 22:56:04 +02:00
..
coreboot coreboot/i945 Thinkpads: replace dd commands with INTEL_ADD_TOP_SWAP_BOOTBLOCK 2023-12-06 17:32:36 +01:00
dependencies dependencies: trisquel: fix python path. 2023-12-11 11:35:21 +01:00
distros/pureos/20230614 build instructions: explain how to run Trisquel/PureOS in other distros. 2023-12-09 15:55:32 +01:00
grub GRUB: config from HDD/SSD: Add support for gnuboot_grub.cfg 2023-08-22 21:17:29 +02:00
memtest86plus/patch memtest86+: fix build error (patch from Félicien Pillot) 2022-02-08 07:45:41 +00:00
packages packages: release: test: fix typo 2023-12-29 18:39:32 +01:00
scripts scripts: misc: guix.sh: make it pass shellcheck. 2024-05-12 22:56:04 +02:00
seabios specifically call python3, in scripts 2022-03-13 18:17:09 +00:00
u-boot/default Add support for releasing deblobbed u-boot 2020.07 source tarballs 2022-02-10 10:55:03 +01:00