Subversion Repositories vnag

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

#!/bin/bash

# Get the directory of this script (also works with symlinks)
# http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
        DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
        SOURCE="$(readlink "$SOURCE")"
        [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

cd "$DIR"
./signtool/sign framework/* plugins/*/*

dirname=$( basename "$( pwd )" )
tmpfile=$( mktemp )

FILENAME="stable.tar.gz"

cd ..
tar cvfz "$tmpfile" \
        --exclude="$dirname"/"$FILENAME" \
        --exclude="$dirname"/signtool/private.pem \
        --exclude "$dirname"/plugins_intern \
        --exclude="$dirname"/_mock \
        -- "$dirname"

# otherwise: "the file has changed while reading"
mv "$tmpfile" "$dirname"/"$FILENAME"