diff options
Diffstat (limited to 'makesrc.sh')
| -rwxr-xr-x | makesrc.sh | 25 |
1 files changed, 10 insertions, 15 deletions
@@ -1,25 +1,20 @@ #!/bin/bash -NAME=$(sed -n '/^Name:/{s/.* //;p}' *.spec) +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 '/^%global upstream_version/{s/.* //;p}' $NAME.spec) -DATE=$(sed -n '/^%global gh_date/{s/.* //;p}' $NAME.spec) -PREVER=$(sed -n '/^%global upstream_prever/{s/.* //;p}' $NAME.spec) -COMMIT=$(sed -n '/^%global gh_commit/{s/.* //;p}' $NAME.spec) -SHORT=${COMMIT:0:7} +TAG=$(sed -n '/^%global gh_tag/{s/.* //;p}' $NAME.spec) -if [ -f $NAME-$VERSION$PREVER-$SHORT.tgz -a "$1" != "-f" ]; then - echo skip $NAME-$VERSION$PREVER-$SHORT.tgz already here +if [ -f $NAME-$TAG.tgz -a "$1" != "-f" ]; then + echo skip $NAME-$TAG.tgz already here else - echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION$PREVER\n" + echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$TAG\n" echo "Cloning..." - git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT + git clone https://github.com/$OWNER/$PROJECT.git --depth 1 --branch $TAG $PROJECT-$TAG - echo "Getting commit..." - pushd $PROJECT-$COMMIT - git checkout $COMMIT || exit 1 + echo "Getting TAG $TAG..." + pushd $PROJECT-$TAG cp composer.json ../ composer config platform.php 8.1.99 rm composer.lock @@ -31,9 +26,9 @@ else popd echo "Archiving..." - tar czf $NAME-$VERSION$PREVER-$SHORT.tgz --exclude .git $PROJECT-$COMMIT + tar czf $NAME-$TAG.tgz --exclude-vcs $PROJECT-$TAG echo "Cleaning..." - rm -rf $PROJECT-$COMMIT + rm -rf $PROJECT-$TAG fi echo "Done." |
