You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sphere-desktop-selector/mk_tar_xz.sh

42 lines
969 B

#!/bin/bash
RmTmpDir()
{
local DIR="$@" DIRNAME
[ -d "$DIR" ] || return
DIRNAME=`dirname $DIR`
[ "X$DIR" = "X$DIRNAME" ] && return
[ "X$DIRNAME" = "X/tmp" ] || return
rm -rf $DIR
}
PROG_NAME=$(basename $0)
TMP_DIR=$(mktemp -d /tmp/${PROG_NAME}_XXXXXXXXX)
[ -d " ./buildir" ] && rm -rf ./buildir
VERSION=`cat ./version`
if [ -z "$VERSION" ]; then
echo "Version is not set!"
exit 1
fi
rm -f sphere-desktop-selector-${VERSION}.tar.xz
SPEC_FILE=$(ls *.spec | head -n 1)
sed "s/Version.*$/Version: ${VERSION}/1" $SPEC_FILE >${SPEC_FILE}.new
mv -f ${SPEC_FILE}.new $SPEC_FILE
meson rewrite kwargs set project / version $VERSION
mkdir ${TMP_DIR}/sphere-desktop-selector-$VERSION
rsync -a ./ ${TMP_DIR}/sphere-desktop-selector-${VERSION}/ || exit 1
pushd $TMP_DIR &>/dev/null || exit 1
tar -cvaf sphere-desktop-selector-${VERSION}.tar.xz sphere-desktop-selector-$VERSION
popd &>/dev/null
mv ${TMP_DIR}/*.xz ./
# RmTmpDir $TMP_DIR