Fixed 'skip check' flag and added .compilation-options files that can alter the metadata of the output binary bpm file

This commit is contained in:
EnumDev 2024-09-09 09:23:46 +00:00
parent 190a670cff
commit 39b56204ae
3 changed files with 29 additions and 8 deletions

View File

@ -1,5 +1,11 @@
#!/bin/bash #!/bin/bash
if [ -f .compilation-options ]; then
source ./.compilation-options
fi
echo "$ARCH"
while getopts "ksa:" o; do while getopts "ksa:" o; do
case "${o}" in case "${o}" in
a) ARCH="$OPTARG";; a) ARCH="$OPTARG";;
@ -118,7 +124,9 @@ cd "$BPM_SOURCE"
RunPkgFunction build RunPkgFunction build
cd "$BPM_SOURCE" cd "$BPM_SOURCE"
RunPkgFunction check if [ -z "$SKIPCHECK" ]; then
RunPkgFunction check
fi
# Packaging all packages # Packaging all packages
for func in $(typeset -F | awk '{print $3}' | grep '^package'); do for func in $(typeset -F | awk '{print $3}' | grep '^package'); do

View File

@ -5,12 +5,16 @@ then
exit 1 exit 1
fi fi
if [ -f .compilation-options ]; then
source ./.compilation-options
fi
while getopts "cska:" flag; do while getopts "cska:" flag; do
case "$flag" in case "$flag" in
c) CONVERT=true;; c) CONVERT=true;;
k) KEEP=true;; k) KEEP=true;;
s) SKIPCHECK=true;; s) SKIPCHECK=true;;
a) ARCHITECTURE="${OPTARG}";; a) ARCH="${OPTARG}";;
*) exit 1;; *) exit 1;;
esac esac
done done
@ -86,10 +90,10 @@ tar -c --owner=0 --group=0 --no-same-owner -zf "$output" "${toCompress[@]}"
if [ ! -z "$CONVERT" ] && "$CONVERT" && [[ "$type" == "source" ]]; then if [ ! -z "$CONVERT" ] && "$CONVERT" && [[ "$type" == "source" ]]; then
args=() args=()
if ! [ -z "$KEEP" ]; then if ! [ -z "$KEEP" ]; then
args+=("-a" "$ARCHITECTURE") args+=("-a" "$ARCH")
fi fi
if ! [ -z "$SKIPCHECK" ]; then if ! [ -z "$SKIPCHECK" ]; then
args+=("-s") args+=("-s")
fi fi
bpm-convert "${args[@]}" -a "$ARCHITECTURE" "$output" bpm-convert "${args[@]}" -a "$ARCH" "$output"
fi fi

View File

@ -1,5 +1,12 @@
#!/bin/bash #!/bin/bash
containsElement () {
local e match="$1"
shift
for e; do [[ "$e" == "$match" ]] && return 0; done
return 1
}
SCRIPT_PATH=$(realpath "$0") SCRIPT_PATH=$(realpath "$0")
SCRIPT_DIR=$(dirname "$SCRIPT_PATH") SCRIPT_DIR=$(dirname "$SCRIPT_PATH")
@ -33,14 +40,16 @@ shopt -s nullglob
if ! $DEEP; then if ! $DEEP; then
for arch in "$REPO"/*/; do for arch in "$REPO"/*/; do
for pkg in "$arch"/*.bpm; do for pkg in "$arch"/*.bpm; do
info=$(tar -xf "$pkg" pkg.info -O) info="info:"$'\n'
package=$(echo "$info" | grep 'name: ' | awk '{print $2}') info+=$(tar -xf "$pkg" pkg.info -O | sed 's/^/ /g')
if [[ ${PKGS[@]} =~ "$package" ]]; then package=$(echo "$info" | grep 'name: ' | xargs | awk '{print $2}')
if containsElement "$package" "${PKGS[@]}"; then
echo "The following package was found in more than 1 package archives: ${package}" echo "The following package was found in more than 1 package archives: ${package}"
exit 1
fi fi
PKGS+=("$package") PKGS+=("$package")
file="$(realpath -s --relative-to="$REPO" "$pkg")" file="$(realpath -s --relative-to="$REPO" "$pkg")"
info+=$'\n'"file: ${file}" info+=$'\n'"download: ${file}"
info+=$'\n---' info+=$'\n---'
echo "$info" echo "$info"
done done