gmic/new-snapshot.sh
Daniel P. Berrangé bf9d74f015 Update to 2.4.0 release
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-10-16 11:45:24 +01:00

50 lines
885 B
Bash
Executable File

#!/bin/sh
function archive_it() {
name=$1
uri=$2
path=$3
if test -d $name
then
cd $name
git checkout master
git reset --hard
git pull
cd ..
else
git clone $uri
fi
DATE=`date +"%Y%m%d"`
cd $name
HASH=`git rev-parse --short HEAD`
FILE=${name}-${DATE}git${HASH}.tar.gz
git archive --format tar.gz --prefix ${name}/ -o ../$FILE HEAD $path
cd ..
}
function print_hash() {
name=$1
cd $name
HASH=`git rev-parse --short HEAD`
today=`date +"%Y%m%d"`
macro=`echo $name | sed -e 's/-/_/g'`
echo "%global ${macro}_version ${today}git${HASH}"
cd ..
}
archive_it zart https://github.com/c-koi/zart .
archive_it gmic-qt https://github.com/c-koi/gmic-qt .
archive_it gmic-community https://github.com/dtschump/gmic-community libcgmic
print_hash zart
print_hash gmic-qt
print_hash gmic-community