aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-08-09 01:01:10 +0800
committerchriseth <c@ethdev.com>2016-08-10 20:46:59 +0800
commit39ced1ba551aa5cbb369ffbab49aad5a2cb7dc58 (patch)
treec1fcfeb2787cbbbe3d37c368ac196727efaf3a55 /scripts
parente404d42f60d56d48e7a9cd9ee3f89e014a26441d (diff)
downloaddexon-solidity-39ced1ba551aa5cbb369ffbab49aad5a2cb7dc58.tar
dexon-solidity-39ced1ba551aa5cbb369ffbab49aad5a2cb7dc58.tar.gz
dexon-solidity-39ced1ba551aa5cbb369ffbab49aad5a2cb7dc58.tar.bz2
dexon-solidity-39ced1ba551aa5cbb369ffbab49aad5a2cb7dc58.tar.lz
dexon-solidity-39ced1ba551aa5cbb369ffbab49aad5a2cb7dc58.tar.xz
dexon-solidity-39ced1ba551aa5cbb369ffbab49aad5a2cb7dc58.tar.zst
dexon-solidity-39ced1ba551aa5cbb369ffbab49aad5a2cb7dc58.zip
Make aware of branches and only create source tarball once.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/release_ppa.sh49
1 files changed, 38 insertions, 11 deletions
diff --git a/scripts/release_ppa.sh b/scripts/release_ppa.sh
index ca33d9f8..68ee7cdc 100755
--- a/scripts/release_ppa.sh
+++ b/scripts/release_ppa.sh
@@ -3,26 +3,41 @@
## This is used to package .deb packages and upload them to the launchpad
## ppa servers for building.
##
-## The gnupg key for "build@ethdev.com" has to be present in order to sign
+## If no argument is given, creates a package for the develop branch
+## and uploads it to the ethereum/ethereum-dev ppa.
+##
+## If an argument is given, it is used as a tag and the resulting package
+## is uploaded to the ethereum/ethereum ppa.
+##
+## The gnupg key for "builds@ethereum.org" has to be present in order to sign
## the package.
##
## It will clone the Solidity git from github, determine the version,
## create a source archive and push it to the ubuntu ppa servers.
##
-## A version, tag or commit hash can be given as argument.
-##
##############################################################################
set -ev
+if [ -z "$1" ]
+then
+ branch=develop
+else
+ branch=$1
+fi
+
+if [ "$branch" = develop ]
+ pparepo=ethereum/ethereum-dev
+ ppafilesurl=https://launchpad.net/~ethereum/+archive/ubuntu/ethereum-dev/+files
+else
+ pparepo=ethereum/ethereum
+ ppafilesurl=https://launchpad.net/~ethereum/+archive/ubuntu/ethereum/+files
+fi
+
keyid=703F83D0
email=builds@ethereum.org
packagename=solc
-# TODO determine whether to use dev or not
-pparepo=ethereum/ethereum-dev
-ppafilesurl=https://launchpad.net/~ethereum/+archive/ubuntu/ethereum-dev/+files
-
for distribution in trusty vivid wily xenial yakkety
do
cd /tmp/
@@ -30,7 +45,7 @@ mkdir $distribution
cd $distribution
# Fetch source
-git clone --recursive https://github.com/ethereum/solidity.git -b $1
+git clone --recursive https://github.com/ethereum/solidity.git -b "$branch"
mv solidity solc
# Determine version
@@ -40,11 +55,23 @@ commithash=`git rev-parse --short HEAD`
committimestamp=`git show --format=%ci HEAD | head -n 1`
commitdate=`git show --format=%ci HEAD | head -n 1 | cut - -b1-10`
-# TODO determine if we are on a "release" (tagged commit?) and push to non-dev in that case
# TODO store the commit hash in a file so that the build info mechanism can pick it up even without git
-debversion="$version-nightly-$commitdate-ffi-$commithash"
-tar --mtime "$committimestamp" --exclude .git -czf ../${packagename}_${debversion}.orig.tar.gz .
+if [ $branch = develop]
+then
+ debversion="$version-nightly-$commitdate-$commithash"
+else
+ debversion="$version"
+fi
+
+# gzip will create different tars all the time and we are not allowed
+# to upload the same file twice with different contents, so we only
+# create it once.
+if [ -n -e /tmp/${packagename}_${debversion}.orig.tar.gz ]
+then
+ tar --exclude .git -czf /tmp/${packagename}_${debversion}.orig.tar.gz .
+fi
+cp /tmp/${packagename}_${debversion}.orig.tar.gz ../
# Create debian package information