Added '-a <architecture>' flag to to bpm-package
This commit is contained in:
parent
a3a97efd59
commit
3ea431b98d
@ -1,6 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DIR="$PWD"
|
DIR="$PWD"
|
||||||
|
ARCH="$2"
|
||||||
|
if [ -z "$ARCH" ]; then
|
||||||
|
ARCH=$(uname -m)
|
||||||
|
fi
|
||||||
|
|
||||||
if ! [ -f "$1" ]; then
|
if ! [ -f "$1" ]; then
|
||||||
echo "$1 is not a path to a file"
|
echo "$1 is not a path to a file"
|
||||||
@ -92,10 +96,10 @@ cd "$BPM_WORKDIR"
|
|||||||
mv output/ files/
|
mv output/ files/
|
||||||
touch pkg.info
|
touch pkg.info
|
||||||
echo "${PKGINFO_FILE}" > pkg.info
|
echo "${PKGINFO_FILE}" > pkg.info
|
||||||
sed -i "s/architecture:.*/architecture: $(uname -m)/g" pkg.info
|
sed -i "s/architecture:.*/architecture: ${ARCH}/g" pkg.info
|
||||||
sed -i 's/type:.*/type: binary/g' pkg.info
|
sed -i 's/type:.*/type: binary/g' pkg.info
|
||||||
tar -czpf "$BPM_PKG_NAME".tar.gz files pkg.info
|
tar -czpf "$BPM_PKG_NAME".tar.gz files pkg.info
|
||||||
mv "$BPM_PKG_NAME".tar.gz "$DIR"/"$BPM_PKG_NAME"-"$(uname -m)".bpm
|
mv "$BPM_PKG_NAME".tar.gz "$DIR"/"$BPM_PKG_NAME"-"$ARCH".bpm
|
||||||
echo "Package conversion complete!"
|
echo "Package conversion complete!"
|
||||||
|
|
||||||
rm -rf "$TEMPDIR" root
|
rm -rf "$TEMPDIR" root
|
||||||
|
@ -5,9 +5,10 @@ then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while getopts "c" flag; do
|
while getopts "ca:" flag; do
|
||||||
case "$flag" in
|
case "$flag" in
|
||||||
c) CONVERT=true;;
|
c) CONVERT=true;;
|
||||||
|
a) ARCHITECTURE="${OPTARG}";;
|
||||||
*) exit 1;;
|
*) exit 1;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@ -75,6 +76,6 @@ echo "Creating $type package as $output"
|
|||||||
|
|
||||||
tar -czf "$output" "${toCompress[@]}"
|
tar -czf "$output" "${toCompress[@]}"
|
||||||
|
|
||||||
if "$CONVERT" && [[ "$type" == "source" ]]; then
|
if [ ! -z "$CONVERT" ] && "$CONVERT" && [[ "$type" == "source" ]]; then
|
||||||
bpm-convert "$output"
|
bpm-convert "$output" "$ARCHITECTURE"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user