Added make dependency detection for bpm-convert
This commit is contained in:
parent
c2de62c343
commit
9ef4699c0d
20
bpm-convert
20
bpm-convert
@ -6,11 +6,12 @@ fi
|
|||||||
|
|
||||||
echo "$ARCH"
|
echo "$ARCH"
|
||||||
|
|
||||||
while getopts "ksa:" o; do
|
while getopts "ksfa:" o; do
|
||||||
case "${o}" in
|
case "${o}" in
|
||||||
a) ARCH="$OPTARG";;
|
a) ARCH="$OPTARG";;
|
||||||
k) KEEP=true;;
|
k) KEEP=true;;
|
||||||
s) SKIPCHECK=true;;
|
s) SKIPCHECK=true;;
|
||||||
|
f) FORCE=true;;
|
||||||
*) exit 1;;
|
*) exit 1;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@ -61,6 +62,23 @@ function ReadPkgInfo() {
|
|||||||
}
|
}
|
||||||
ReadPkgInfo
|
ReadPkgInfo
|
||||||
|
|
||||||
|
if [ -z "$FORCE" ] && command -v bpm &> /dev/null && [ -n "$PKGINFO[make_depends]" ]; then
|
||||||
|
MISSING=()
|
||||||
|
for depend in $(echo "${PKGINFO[make_depends]}" | tr -d '[]' | tr ',' '\n' ); do
|
||||||
|
if ! bpm info "$depend" &> /dev/null; then
|
||||||
|
MISSING+=("$depend")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ "${#MISSING[@]}" -ne 0 ]; then
|
||||||
|
echo "The following make dependencies could not be resolved: ${MISSING[@]}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
elif ! command -v bpm &> /dev/null; then
|
||||||
|
echo "BPM not in PATH. Skipping make dependency resolution"
|
||||||
|
elif [ -n "$FORCE" ]; then
|
||||||
|
echo "Force compilation enabled. Skipping make dependency resolution"
|
||||||
|
fi
|
||||||
|
|
||||||
# Creating temporary compilation directory structure
|
# Creating temporary compilation directory structure
|
||||||
TEMPDIR="/var/tmp/bpm_source_${PKGINFO[name]}"
|
TEMPDIR="/var/tmp/bpm_source_${PKGINFO[name]}"
|
||||||
if [ -d "$TEMPDIR" ] && [ -z "$KEEP" ]; then
|
if [ -d "$TEMPDIR" ] && [ -z "$KEEP" ]; then
|
||||||
|
14
bpm-package
14
bpm-package
@ -9,11 +9,12 @@ if [ -f .compilation-options ]; then
|
|||||||
source ./.compilation-options
|
source ./.compilation-options
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while getopts "cska:" flag; do
|
while getopts "cskfa:" 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;;
|
||||||
|
f) FORCE=true;;
|
||||||
a) ARCH="${OPTARG}";;
|
a) ARCH="${OPTARG}";;
|
||||||
*) exit 1;;
|
*) exit 1;;
|
||||||
esac
|
esac
|
||||||
@ -89,11 +90,8 @@ 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
|
[ -n "$KEEP" ] && args+=("-k")
|
||||||
args+=("-a" "$ARCH")
|
[ -n "$SKIPCHECK" ] && args+=("-s")
|
||||||
fi
|
[ -n "$FORCE" ] && args+=("-f")
|
||||||
if ! [ -z "$SKIPCHECK" ]; then
|
bpm-convert "${args[@]}" -a "$ARCH" "$output"
|
||||||
args+=("-s")
|
|
||||||
fi
|
|
||||||
bpm-convert "${args[@]}" -a "$ARCH" "$output"
|
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user