diff options
author | Remi Collet <fedora@famillecollet.com> | 2015-07-02 08:54:29 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2015-07-02 08:54:29 +0200 |
commit | cf0989b01ac6df63062549068842c62033bff644 (patch) | |
tree | 9ad67f0a44f6754a61ab0e26c048fac3ce866a76 /makesrc.sh | |
parent | 760a7e19bd21d173d023d06e26fb88d5b8f1e7f7 (diff) |
php-pdepend-PHP-Depend: 2.1.0
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..05a6054 --- /dev/null +++ b/makesrc.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +NAME=$(sed -n '/^Name:/{s/.* //;p}' *.spec) +OWNER=$(sed -n '/^%global gh_owner/{s/.* //;p}' $NAME.spec) +PROJECT=$(sed -n '/^%global gh_project/{s/.* //;p}' $NAME.spec) +VERSION=$(sed -n '/^Version:/{s/.* //;p}' $NAME.spec) +COMMIT=$(sed -n '/^%global gh_commit/{s/.* //;p}' $NAME.spec) +SHORT=${COMMIT:0:7} + +echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION\n" + +echo "Cloning..." +git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT + +echo "Getting commit..." +pushd $PROJECT-$COMMIT +git checkout $COMMIT +popd + +echo "Archiving..." +tar czf $NAME-$VERSION-$SHORT.tgz --exclude .git $PROJECT-$COMMIT + +echo "Cleaning..." +rm -rf $PROJECT-$COMMIT + +echo "Done." |