update: better version and empty root directory checking for mp-build and mp-check

This commit is contained in:
ngn
2024-08-25 14:56:58 +03:00
parent 4cee462e70
commit ec9781a5b6
4 changed files with 69 additions and 3 deletions

View File

@ -110,7 +110,7 @@ clean_dist() {
rm -f "${distpath}/files.tar.gz"
}
# install a list of packages with matt
# install a list of packages with matt
matt_install(){
if [ "$EUID" -ne 0 ]; then
if type doas > /dev/null; then
@ -122,7 +122,7 @@ matt_install(){
return 1
fi
fi
$DOAS matt install --yes --skip --ignore-none $@
return $?
}
@ -421,6 +421,11 @@ mkdir -p "${distpath}"
clean_dist
# build the files archive
if [ -z "$(ls -A)" ]; then
error "Root directory is empty, did something went wrong during build?"
exit 1
fi
find . -printf "%P\n" | fakeroot tar -czf "${distpath}/files.tar.gz" --no-recursion -T -
check_ret "(1/6) Failed to create the files archive (files.tar.gz)"
success "(1/6) Created the files archive (files.tar.gz)"