diff --git a/bldpkg b/bldpkg index c035311..7be0521 100755 --- a/bldpkg +++ b/bldpkg @@ -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')