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