Fixed bash script warnings

This commit is contained in:
B.J. Dweck 2020-10-20 00:07:57 +02:00
parent a78cddfdb1
commit 609ccfbf27

View File

@ -1,33 +1,34 @@
#!/bin/bash #!/bin/bash
TORCH_VERSION=$(git describe --tags --abbrev=0) if [[ -z "${DEB_EMAIL}" ]]; then
PROJECT=torch-agent-$TORCH_VERSION DEB_EMAIL="$1"
if [[ -z "${DEBEMAIL}" ]]; then
DEBEMAIL="$1"
fi fi
if [[ -z "${DEBEMAIL}" ]]; then if [[ -z "${DEB_EMAIL}" ]]; then
echo "E-mail address required for packaging signing with gpg key!" echo "E-mail address required for packaging signing with gpg key!"
echo "Usage: ./build-deb.sh EMAIL" echo "Usage: ./build-deb.sh EMAIL"
exit 1 exit 1
fi fi
TORCH_VERSION=$(git describe --tags --abbrev=0)
PROJECT=torch-agent-$TORCH_VERSION
BUILD_DIR=dist BUILD_DIR=dist
DEB_DIR=$BUILD_DIR/$PROJECT DEB_DIR=$BUILD_DIR/$PROJECT
rm -rf $BUILD_DIR/* rm -rf "${BUILD_DIR:?}/"*
python3 setup.py sdist python3 setup.py sdist
mkdir -p $DEB_DIR/src/etc/torch mkdir -p "$DEB_DIR/src/etc/torch"
cp -r debian $DEB_DIR/ cp -r debian "$DEB_DIR/"
cp torch.conf $DEB_DIR/src/etc/torch/ cp torch.conf "$DEB_DIR/src/etc/torch/"
cd $BUILD_DIR cd $BUILD_DIR || exit
tar -xzmf $PROJECT.tar.gz tar -xzmf "$PROJECT.tar.gz"
cd $PROJECT cd "$PROJECT" || exit
export USER=`whoami` export USER
dh_make --createorig -e $DEBEMAIL -s -y USER=$(whoami)
dpkg-buildpackage -k$DEBEMAIL dh_make --createorig -e "$DEB_EMAIL" -s -y
dpkg-buildpackage -k"$DEB_EMAIL"