diff options
Diffstat (limited to 'makesrc.sh')
-rwxr-xr-x | makesrc.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/makesrc.sh b/makesrc.sh new file mode 100755 index 0000000..5c1f453 --- /dev/null +++ b/makesrc.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +NAME=$(basename $PWD) +VERSION=$(sed -n '/^Version:/{s/.* //;p}' $NAME.spec) +COMMIT=$(sed -n '/^%global git_commit/{s/.* //;p}' $NAME.spec) +SHORT=${COMMIT:0:7} + +echo -e "\nCreate git snapshot\nName=$NAME, Version=$VERSION\n" + +echo "Cloning..." +rm -rf $NAME-$COMMIT +git clone https://git.kolab.org/diffusion/PNL/php-net_ldap.git $NAME-$COMMIT + +echo "Getting commit..." +pushd $NAME-$COMMIT +git checkout $COMMIT +cp composer.json ../composer.json +popd + +echo "Archiving..." +tar czf $NAME-$VERSION-$SHORT.tgz --exclude-vcs $NAME-$COMMIT + +echo "Cleaning..." +rm -rf $NAME-$COMMIT + +echo "Done." |