Address shellcheck lint

main
earnest ma 2021-09-06 21:20:51 -04:00
parent 1c5d190c83
commit ff3f139265
Signed by: earnest ma
GPG Key ID: A343F43342EB6E2A
1 changed files with 12 additions and 12 deletions

24
aptpkg
View File

@ -28,7 +28,7 @@ error_usage_die(){
# Verify sha512sums # Verify sha512sums
verify(){ verify(){
echo "$sha512sums" | sha512sum -c echo "${sha512sums:?}" | sha512sum -c
} }
# Copy/ install wrapper for files # Copy/ install wrapper for files
@ -50,31 +50,31 @@ check(){
# Generate the debian control file # Generate the debian control file
gen_control_file(){ gen_control_file(){
mkdir -p "$builddir"/DEBIAN mkdir -p "$builddir"/DEBIAN
echo "Package: $name echo "Package: ${name:?}
Version: $version-$rev Version: ${version:?}-${rev:?}
Architecture: amd64 Architecture: amd64
Maintainer: $(grep -am 1 -hr "Maintainer: " build | sed 's/# Maintainer: //') Maintainer: $(grep -am 1 -hr "Maintainer: " build | sed 's/# Maintainer: //')
Section: Section:
Priority: Priority:
Homepage: $url Homepage: ${url:?}
Description: $description Description: ${description:?}
$customcontrol ${customcontrol:?}
" > "$builddir"/DEBIAN/control " > "$builddir"/DEBIAN/control
} }
# Download a debian package # Download a debian package
build_deb(){ build_deb(){
echo "Getting $source" echo "Getting ${source:?}"
wget "$source" -qP dist/ wget "$source" -qP dist/
( cd dist ; verify ) ( cd dist || error_usage_die "Problem with the dist/ directory" && verify )
} }
# Download and build using files # Download and build using files
build_file(){ build_file(){
builddir=${name}_${version}-${rev}_amd64 builddir=${name}_${version}-${rev}_amd64
cd "$1" cd "$1" || error_usage_die "Problem with changing directory"
mkdir -p "$builddir" mkdir -p "$builddir"
for url in $source; do for url in $source; do
@ -93,7 +93,7 @@ build_file(){
[ -f $maintfile ] && cin-bin $maintfile "$builddir"/DEBIAN/$maintfile [ -f $maintfile ] && cin-bin $maintfile "$builddir"/DEBIAN/$maintfile
done done
cd - cd - || error_usage_die "Problem with changing directory"
dpkg-deb --build --root-owner-group "$1"/"$builddir" dist/ dpkg-deb --build --root-owner-group "$1"/"$builddir" dist/
} }
@ -103,9 +103,9 @@ load_build(){
mkdir -p dist mkdir -p dist
# shellcheck disable=SC1090 # shellcheck disable=SC1090
source "$1/build" source "${1/build:?}"
case "$type" in case "${type:?}" in
deb) deb)
build_deb ;; build_deb ;;
file) file)