Changes to bldpkg:

-> Fixed grep code when validating a build file
-> Added if/else to pkgstatus and autobuildtemp to fix build failures when packages are built via autobuild
-> Statically-linked archives are now only scanned if variable staticelfflag is set by preservestaticlibs check
This commit is contained in:
PktSurf 2023-04-21 20:38:36 +05:30
parent 426f0544e3
commit c05034b154

17
bldpkg
View file

@ -133,11 +133,11 @@ validatebldfile() {
err "Please provide a Maintainer name and email as a comment at the top of the build file"
# Validate $app
elif ! echo "$app" | grep -E -q '\w[a-z0-9-]+\w'; then
elif ! echo "$app" | grep -E -q '[a-z0-9-]+'; then
err "Only lower case, numeric characters and dash allowed in the 'app' variable in the build file."
# Validate $version
elif ! echo "$version" | grep -E -q '\w[a-z0-9.]+\w'; then
elif ! echo "$version" | grep -E -q '[a-z0-9.]+'; then
err "Only lower case, numeric characters and a period allowed in the 'version' variable in the build file."
# Validate $homepage
@ -457,7 +457,9 @@ promptuser() {
esac
fi
[[ $pkgstatus = 0 ]] && exit 0
if [[ $pkgstatus = 0 ]] ; then
exit 0
fi
}
# This function will set the interrupt variable so prepbuildoutput can output the right build status
@ -682,7 +684,9 @@ findlibtoolfiles() {
}
findelffiles() {
scanelf --archives --nobanner --recursive --symlink --format "%F" --etype "ET_EXEC,ET_DYN,ET_REL" .
# Only scan for static archives if preservestaticlibs is set to 1
[[ $preservestaticlibs = "1" ]] && staticelfflag=",ET_REL"
scanelf --archives --nobanner --recursive --symlink --format "%F" --etype "ET_EXEC,ET_DYN$staticelfflag" .
}
buildfilecleanup() {
@ -690,10 +694,11 @@ buildfilecleanup() {
rm "$parenttmp/BUILDING"
# Autobuild discards $tempfile automatically, so only discard $tempfile if $autobuildtemp is unset
[[ -z $autobuildtemp ]] && rm "$tempfile"
if [[ -z $autobuildtemp ]] ; then
rm "$tempfile"
fi
}
prepbuildoutput() {
# Get the build completion time and store it in a variable
finishdate=$(date '+%a, %d %b %Y, %T')