Address shellcheck lint
parent
1c5d190c83
commit
ff3f139265
24
aptpkg
24
aptpkg
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue