]> gitweb.hhaalo.de Git - scantopdf.git/commitdiff
fix builder with shellcheck
authorBastian Dehn <hhaalo@arcor.de>
Sat, 27 Jun 2026 10:55:21 +0000 (12:55 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 27 Jun 2026 10:55:21 +0000 (12:55 +0200)
builder/builder
builder/run

index 2a6a48966bc7fe0c52b69e40a7008de95b1d671d..aa0df876e851a1d08e24ca167af5445c167f25c2 100755 (executable)
@@ -6,8 +6,8 @@ create_containerfile()
        local distro_postfix="$2"
 
        cat builder/Containerfile.template \
-               | sed "s/\$distro/$distro/" \
-               > build/Containerfile-$distro_postfix \
+               | sed "s/\$distro/\"$distro\"/" \
+               > build/Containerfile-"$distro_postfix" \
                || return $?
 }
 
@@ -16,8 +16,8 @@ build_container_image()
        local distro_postfix="$1"
 
        podman build \
-               --tag scantopdf-builder:$distro_postfix \
-               --file build/Containerfile-$distro_postfix \
+               --tag scantopdf-builder:"$distro_postfix" \
+               --file build/Containerfile-"$distro_postfix" \
                || return $?
 }
 
@@ -29,7 +29,7 @@ run_builder_container()
                --tty \
                --rm \
                --volume .:/src \
-               scantopdf-builder:$distro_postfix \
+               scantopdf-builder:"$distro_postfix" \
                || return $?
 }
 
index 357b76dc41e1fbd9da11652c1daf0f81c6097717..b4b61ebdb184e192a360eb8342a5512967dd8279 100644 (file)
@@ -2,28 +2,31 @@
 
 get_source_date()
 {
+       export SOURCE_DATE_EPOCH=
        umask 0022 || return $?
        cd /src || return $?
-       export SOURCE_DATE_EPOCH=$(git log --max-count=1 --pretty="%ct")
+       SOURCE_DATE_EPOCH=$(git log --max-count=1 --pretty="%ct")
        export EXTRA_VERSION="-$ID-$VERSION_CODENAME"
 }
 
 create_package_checksum()
 {
+       local package=
        cd /app/build/build || return $?
-       local package=$(find . -maxdepth 1 -name '*.deb')
-       lintian --fail-on error,warning,pedantic $package || return $?
-       sha256sum *.deb > $package.sha256 || return $?
-       cat $package.sha256 || return $?
+       package=$(find . -maxdepth 1 -name '*.deb')
+       lintian --fail-on error,warning,pedantic "$package" || return $?
+       sha256sum ./*.deb > "$package.sha256" || return $?
+       cat "$package.sha256" || return $?
 }
 
 reproducible_package_checksum_check()
 {
+       local package=
        cd /app/reproducible-build/build || return $?
-       local package=$(find . -maxdepth 1 -name '*.deb')
-       cp /src/build/$package.sha256 . || return $?
-       cat $package.sha256 || return $?
-       sha256sum -c $package.sha256 || return $?
+       package=$(find . -maxdepth 1 -name '*.deb')
+       cp "/src/build/$package.sha256" . || return $?
+       cat "$package.sha256" || return $?
+       sha256sum -c "$package.sha256" || return $?
 }
 
 run_tests()
@@ -31,7 +34,7 @@ run_tests()
        cd /app || return $?
        rsync --recursive --exclude=build* /src/ /app/tests/ || return $?
        cd /app/tests || return $?
-       make --jobs=$(nproc) test || return $?
+       make --jobs="$(nproc)" test || return $?
 }
 
 build_package()
@@ -39,7 +42,7 @@ build_package()
        cd /app || return $?
        rsync --recursive --exclude=build* /src/ /app/build || return $?
        cd /app/build || return $?
-       make --jobs=$(nproc) package || return $?
+       make --jobs="$(nproc)" package || return $?
 }
 
 copy_package()
@@ -55,7 +58,7 @@ build_reproducible_package()
        rsync --recursive --exclude=build* /src/ /app/reproducible-build \
                || return $?
        cd /app/reproducible-build || return $?
-       make --jobs=$(nproc) package || return $?
+       make --jobs="$(nproc)" package || return $?
 }
 
 main()