diff options
-rwxr-xr-x | makesrc.sh | 37 | ||||
-rw-r--r-- | php-phpunit-php-code-coverage10.spec | 5 |
2 files changed, 25 insertions, 17 deletions
@@ -1,28 +1,35 @@ #!/bin/bash NAME=$(basename $PWD) -OWNER=$(sed -n '/^%global gh_vendor/{s/.* //;p}' $NAME.spec) +DATE=$(sed -n '/^%global gh_date/{s/.* //;p}' $NAME.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" +DATE=$(date -d "$DATE -4 days" +%Y-%m-%d) -echo "Cloning..." -rm -rf $PROJECT-$COMMIT -git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT +if [ -f $NAME-$VERSION-$SHORT.tgz ]; then + echo "$NAME-$VERSION-$SHORT.tgz already there" +else + echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION, Date=$DATE\n" -echo "Getting commit..." -pushd $PROJECT-$COMMIT -git checkout $COMMIT -cp composer.json ../composer.json -popd + echo "Cloning..." + rm -rf $PROJECT-$COMMIT + git clone --shallow-since=$DATE https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT || exit 1 -echo "Archiving..." -tar czf $NAME-$VERSION-$SHORT.tgz --exclude-vcs --exclude tools $PROJECT-$COMMIT + echo "Getting commit..." + pushd $PROJECT-$COMMIT + git checkout $COMMIT || exit1 + cp composer.json ../composer.json + popd -echo "Cleaning..." -rm -rf $PROJECT-$COMMIT + echo "Archiving..." + tar czf $NAME-$VERSION-$SHORT.tgz --exclude-vcs --exclude tools $PROJECT-$COMMIT -echo "Done." + echo "Cleaning..." + rm -rf $PROJECT-$COMMIT + + echo "Done." +fi diff --git a/php-phpunit-php-code-coverage10.spec b/php-phpunit-php-code-coverage10.spec index 7e83ede..9e17744 100644 --- a/php-phpunit-php-code-coverage10.spec +++ b/php-phpunit-php-code-coverage10.spec @@ -12,8 +12,9 @@ # Github %global gh_commit 78c3b7625965c2513ee96569a4dbb62601784145 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) -%global gh_vendor sebastianbergmann +%global gh_owner sebastianbergmann %global gh_project php-code-coverage +%global gh_date 2023-12-21 # Packagist %global pk_vendor phpunit %global pk_project php-code-coverage @@ -33,7 +34,7 @@ Summary: PHP code coverage information, version %{ver_major} # MIT: boostrap, d3, holder, html5shiv, jquery, respond # Apache-2.0: nvd3 License: BSD-3-Clause AND MIT AND Apache-2.0 -URL: https://github.com/%{gh_vendor}/%{gh_project} +URL: https://github.com/%{gh_owner}/%{gh_project} Source0: %{name}-%{version}-%{gh_short}.tgz Source1: makesrc.sh |