summaryrefslogtreecommitdiffstats
path: root/makesrc.sh
diff options
context:
space:
mode:
Diffstat (limited to 'makesrc.sh')
-rwxr-xr-xmakesrc.sh60
1 files changed, 41 insertions, 19 deletions
diff --git a/makesrc.sh b/makesrc.sh
index 87d223d..2382ade 100755
--- a/makesrc.sh
+++ b/makesrc.sh
@@ -1,28 +1,50 @@
#!/bin/bash
-NAME=$(basename $PWD)
-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}
+function archive() {
+ SHORT=${COMMIT:0:7}
+
+ if [ -f $NAME-$VERSION-$SHORT.tgz ]
+ then
+ echo Skip $NAME
+ else
+ echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION ($COMMIT)\n"
+ echo "Cloning..."
+ rm -rf $PROJECT-$COMMIT
+ git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT
-echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION\n"
+ echo "Getting commit..."
+ pushd $PROJECT-$COMMIT
+ if git checkout $COMMIT; then
+ cp composer.json ../${1:-composer.json}
+ else
+ exit 1
+ fi
+ popd
-echo "Cloning..."
-rm -rf $PROJECT-$COMMIT
-git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT
+ echo "Archiving..."
+ tar czf $NAME-$VERSION-$SHORT.tgz --exclude .git $PROJECT-$COMMIT
-echo "Getting commit..."
-pushd $PROJECT-$COMMIT
-git checkout $COMMIT
-cp composer.json ../composer.json
-popd
+ echo "Cleaning..."
+ rm -rf $PROJECT-$COMMIT
+ fi
+}
-echo "Archiving..."
-tar czf $NAME-$VERSION-$SHORT.tgz --exclude .git $PROJECT-$COMMIT
+NAME=$(basename $PWD)
+SPEC=$NAME.spec
+OWNER=$(sed -n '/^%global gh_owner/{s/.* //;p}' $SPEC)
+PROJECT=$(sed -n '/^%global gh_project/{s/.* //;p}' $SPEC)
+VERSION=$(sed -n '/^Version:/{s/.* //;p}' $SPEC)
+COMMIT=$(sed -n '/^%global gh_commit/{s/.* //;p}' $SPEC)
+archive
-echo "Cleaning..."
-rm -rf $PROJECT-$COMMIT
+for i in test apc apcu blackhole dba ext-mongodb filesystem memcache memcached memory mongodb redis session wincache xcache zend-server
+do
+ j=${i/-/_}
+ NAME=php-laminas-cache-storage-adapter-$i
+ COMMIT=$(sed -n "/^%global gh_${j}_commit/{s/.* //;p}" $SPEC)
+ VERSION=$(sed -n "/^%global gh_${j}_version/{s/.* //;p}" $SPEC)
+ PROJECT=laminas-cache-storage-adapter-$i
+ archive composer-$i.json
+done
echo "Done."