diff options
| author | Remi Collet <remi@remirepo.net> | 2026-04-02 07:59:55 +0200 |
|---|---|---|
| committer | Remi Collet <remi@php.net> | 2026-04-02 07:59:55 +0200 |
| commit | c3230c99f46e02ef53592d53305bb3c8256132f3 (patch) | |
| tree | bc52361a99b420971492385bdaac2074b0bd6239 /makesrc.sh | |
| parent | 41b44c310aff8246ab12691ff14c5bc3b84ff1bf (diff) | |
Diffstat (limited to 'makesrc.sh')
| -rwxr-xr-x | makesrc.sh | 34 |
1 files changed, 18 insertions, 16 deletions
@@ -1,37 +1,39 @@ #!/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) +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) -PREVER=$(sed -n '/^%global upstream_prever/{s/.* //;p}' $NAME.spec) -COMMIT=$(sed -n '/^%global gh_commit/{s/.* //;p}' $NAME.spec) -SHORT=${COMMIT:0:7} +PREVER=$(sed -n '/^%global upstream_prever/{s/.* //;p}' $NAME.spec) +if [ -z "$PREVER" ] +then TAG=$VERSION +else TAG=$VERSION-$PREVER +fi -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.json composer config platform.php 7.2.5 rm composer.lock composer install --no-interaction --no-progress --no-dev --optimize-autoloader cp vendor/composer/installed.json ../ - # bash completion + + echo "Bash completion" bin/composer completion bash >../composer-bash-completion 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." |
