From f5fbdbfbd9e1db1cd5549d81488121a45ac4b545 Mon Sep 17 00:00:00 2001 From: Spiros Eliopoulos Date: Sun, 27 Mar 2016 17:19:05 -0400 Subject: [PATCH 1/7] fix-meta: add dev-repo to top-level opam file --- opam/opam | 1 + 1 file changed, 1 insertion(+) diff --git a/opam/opam b/opam/opam index 6bc8f92ae..a9ba20b02 100644 --- a/opam/opam +++ b/opam/opam @@ -4,6 +4,7 @@ authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix From b365b8b3af4aab53029d0cbe10c840af230d8e03 Mon Sep 17 00:00:00 2001 From: Spiros Eliopoulos Date: Sun, 27 Mar 2016 17:19:59 -0400 Subject: [PATCH 2/7] fix-meta: fix authors list in generated opam files --- libraries/autoscaling/opam/opam | 2 +- libraries/cloudformation/opam/opam | 2 +- libraries/cloudtrail/opam/opam | 2 +- libraries/ec2/opam/opam | 2 +- libraries/elasticache/opam/opam | 2 +- libraries/elasticloadbalancing/opam/opam | 2 +- libraries/rds/opam/opam | 2 +- libraries/sdb/opam/opam | 2 +- libraries/ssm/opam/opam | 2 +- libraries/sts/opam/opam | 2 +- src/mk_opam | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libraries/autoscaling/opam/opam b/libraries/autoscaling/opam/opam index 010ed45be..dd8a2f985 100644 --- a/libraries/autoscaling/opam/opam +++ b/libraries/autoscaling/opam/opam @@ -1,6 +1,6 @@ opam-version: "1.2" maintainer: "Spiros Eliopoulos " -authors: [ Spiros Eliopoulos ", "Daniel Patterson ] +authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" diff --git a/libraries/cloudformation/opam/opam b/libraries/cloudformation/opam/opam index 010ed45be..dd8a2f985 100644 --- a/libraries/cloudformation/opam/opam +++ b/libraries/cloudformation/opam/opam @@ -1,6 +1,6 @@ opam-version: "1.2" maintainer: "Spiros Eliopoulos " -authors: [ Spiros Eliopoulos ", "Daniel Patterson ] +authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" diff --git a/libraries/cloudtrail/opam/opam b/libraries/cloudtrail/opam/opam index 010ed45be..dd8a2f985 100644 --- a/libraries/cloudtrail/opam/opam +++ b/libraries/cloudtrail/opam/opam @@ -1,6 +1,6 @@ opam-version: "1.2" maintainer: "Spiros Eliopoulos " -authors: [ Spiros Eliopoulos ", "Daniel Patterson ] +authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" diff --git a/libraries/ec2/opam/opam b/libraries/ec2/opam/opam index 010ed45be..dd8a2f985 100644 --- a/libraries/ec2/opam/opam +++ b/libraries/ec2/opam/opam @@ -1,6 +1,6 @@ opam-version: "1.2" maintainer: "Spiros Eliopoulos " -authors: [ Spiros Eliopoulos ", "Daniel Patterson ] +authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" diff --git a/libraries/elasticache/opam/opam b/libraries/elasticache/opam/opam index 010ed45be..dd8a2f985 100644 --- a/libraries/elasticache/opam/opam +++ b/libraries/elasticache/opam/opam @@ -1,6 +1,6 @@ opam-version: "1.2" maintainer: "Spiros Eliopoulos " -authors: [ Spiros Eliopoulos ", "Daniel Patterson ] +authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" diff --git a/libraries/elasticloadbalancing/opam/opam b/libraries/elasticloadbalancing/opam/opam index 010ed45be..dd8a2f985 100644 --- a/libraries/elasticloadbalancing/opam/opam +++ b/libraries/elasticloadbalancing/opam/opam @@ -1,6 +1,6 @@ opam-version: "1.2" maintainer: "Spiros Eliopoulos " -authors: [ Spiros Eliopoulos ", "Daniel Patterson ] +authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" diff --git a/libraries/rds/opam/opam b/libraries/rds/opam/opam index 010ed45be..dd8a2f985 100644 --- a/libraries/rds/opam/opam +++ b/libraries/rds/opam/opam @@ -1,6 +1,6 @@ opam-version: "1.2" maintainer: "Spiros Eliopoulos " -authors: [ Spiros Eliopoulos ", "Daniel Patterson ] +authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" diff --git a/libraries/sdb/opam/opam b/libraries/sdb/opam/opam index 010ed45be..dd8a2f985 100644 --- a/libraries/sdb/opam/opam +++ b/libraries/sdb/opam/opam @@ -1,6 +1,6 @@ opam-version: "1.2" maintainer: "Spiros Eliopoulos " -authors: [ Spiros Eliopoulos ", "Daniel Patterson ] +authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" diff --git a/libraries/ssm/opam/opam b/libraries/ssm/opam/opam index 010ed45be..dd8a2f985 100644 --- a/libraries/ssm/opam/opam +++ b/libraries/ssm/opam/opam @@ -1,6 +1,6 @@ opam-version: "1.2" maintainer: "Spiros Eliopoulos " -authors: [ Spiros Eliopoulos ", "Daniel Patterson ] +authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" diff --git a/libraries/sts/opam/opam b/libraries/sts/opam/opam index 010ed45be..dd8a2f985 100644 --- a/libraries/sts/opam/opam +++ b/libraries/sts/opam/opam @@ -1,6 +1,6 @@ opam-version: "1.2" maintainer: "Spiros Eliopoulos " -authors: [ Spiros Eliopoulos ", "Daniel Patterson ] +authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" diff --git a/src/mk_opam b/src/mk_opam index d047cb3f3..cf1bb5215 100644 --- a/src/mk_opam +++ b/src/mk_opam @@ -3,7 +3,7 @@ mkdir -p opam cat < opam/opam opam-version: "1.2" maintainer: "$(oasis query maintainers)" -authors: [ $(oasis query authors | sed 's/, /", "/') ] +authors: [ "$(oasis query authors | sed 's/, /" "/')" ] license: "$(oasis query license)" homepage: "$(oasis query homepage)" bug-reports: "$(oasis query homepage)/issues" From 43f9916e5c09beb99a61ec1e5ea700a50c37cb17 Mon Sep 17 00:00:00 2001 From: Spiros Eliopoulos Date: Sun, 27 Mar 2016 17:20:45 -0400 Subject: [PATCH 3/7] fix-meta: add dev-repo to generated opam files --- libraries/autoscaling/opam/opam | 1 + libraries/cloudformation/opam/opam | 1 + libraries/cloudtrail/opam/opam | 1 + libraries/ec2/opam/opam | 1 + libraries/elasticache/opam/opam | 1 + libraries/elasticloadbalancing/opam/opam | 1 + libraries/rds/opam/opam | 1 + libraries/sdb/opam/opam | 1 + libraries/ssm/opam/opam | 1 + libraries/sts/opam/opam | 1 + src/mk_opam | 1 + 11 files changed, 11 insertions(+) diff --git a/libraries/autoscaling/opam/opam b/libraries/autoscaling/opam/opam index dd8a2f985..ae0b11407 100644 --- a/libraries/autoscaling/opam/opam +++ b/libraries/autoscaling/opam/opam @@ -3,6 +3,7 @@ maintainer: "Spiros Eliopoulos " authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] diff --git a/libraries/cloudformation/opam/opam b/libraries/cloudformation/opam/opam index dd8a2f985..ae0b11407 100644 --- a/libraries/cloudformation/opam/opam +++ b/libraries/cloudformation/opam/opam @@ -3,6 +3,7 @@ maintainer: "Spiros Eliopoulos " authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] diff --git a/libraries/cloudtrail/opam/opam b/libraries/cloudtrail/opam/opam index dd8a2f985..ae0b11407 100644 --- a/libraries/cloudtrail/opam/opam +++ b/libraries/cloudtrail/opam/opam @@ -3,6 +3,7 @@ maintainer: "Spiros Eliopoulos " authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] diff --git a/libraries/ec2/opam/opam b/libraries/ec2/opam/opam index dd8a2f985..ae0b11407 100644 --- a/libraries/ec2/opam/opam +++ b/libraries/ec2/opam/opam @@ -3,6 +3,7 @@ maintainer: "Spiros Eliopoulos " authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] diff --git a/libraries/elasticache/opam/opam b/libraries/elasticache/opam/opam index dd8a2f985..ae0b11407 100644 --- a/libraries/elasticache/opam/opam +++ b/libraries/elasticache/opam/opam @@ -3,6 +3,7 @@ maintainer: "Spiros Eliopoulos " authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] diff --git a/libraries/elasticloadbalancing/opam/opam b/libraries/elasticloadbalancing/opam/opam index dd8a2f985..ae0b11407 100644 --- a/libraries/elasticloadbalancing/opam/opam +++ b/libraries/elasticloadbalancing/opam/opam @@ -3,6 +3,7 @@ maintainer: "Spiros Eliopoulos " authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] diff --git a/libraries/rds/opam/opam b/libraries/rds/opam/opam index dd8a2f985..ae0b11407 100644 --- a/libraries/rds/opam/opam +++ b/libraries/rds/opam/opam @@ -3,6 +3,7 @@ maintainer: "Spiros Eliopoulos " authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] diff --git a/libraries/sdb/opam/opam b/libraries/sdb/opam/opam index dd8a2f985..ae0b11407 100644 --- a/libraries/sdb/opam/opam +++ b/libraries/sdb/opam/opam @@ -3,6 +3,7 @@ maintainer: "Spiros Eliopoulos " authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] diff --git a/libraries/ssm/opam/opam b/libraries/ssm/opam/opam index dd8a2f985..ae0b11407 100644 --- a/libraries/ssm/opam/opam +++ b/libraries/ssm/opam/opam @@ -3,6 +3,7 @@ maintainer: "Spiros Eliopoulos " authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] diff --git a/libraries/sts/opam/opam b/libraries/sts/opam/opam index dd8a2f985..ae0b11407 100644 --- a/libraries/sts/opam/opam +++ b/libraries/sts/opam/opam @@ -3,6 +3,7 @@ maintainer: "Spiros Eliopoulos " authors: [ "Spiros Eliopoulos " "Daniel Patterson " ] license: "BSD-3-clause" homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "https://github.com/inhabitedtype/ocaml-aws.git" bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] diff --git a/src/mk_opam b/src/mk_opam index cf1bb5215..ebdff1a56 100644 --- a/src/mk_opam +++ b/src/mk_opam @@ -6,6 +6,7 @@ maintainer: "$(oasis query maintainers)" authors: [ "$(oasis query authors | sed 's/, /" "/')" ] license: "$(oasis query license)" homepage: "$(oasis query homepage)" +dev-repo: "$(oasis query homepage).git" bug-reports: "$(oasis query homepage)/issues" build: [ ["ocaml" "setup.ml" "-configure" "--prefix" prefix] From c913f20c505eac3c751df9c9d54b3c0ad75a6561 Mon Sep 17 00:00:00 2001 From: Spiros Eliopoulos Date: Sun, 27 Mar 2016 17:21:20 -0400 Subject: [PATCH 4/7] fix-meta: don't fail if old archive does not exist --- release | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release b/release index bda1ae76a..7877bfbb4 100755 --- a/release +++ b/release @@ -37,7 +37,7 @@ function release_service() { local aws_release=$1 echo "== $release" make distclean > /dev/null - rm ${release}.tar.gz + rm -f *.tar.gz ln -s . $release tar czf ${release}.tar.gz --exclude=${release}/${release} ${release}/* rm ${release} @@ -51,7 +51,7 @@ function release_top() { local release=aws-${version} echo "== $release" make distclean > /dev/null - rm ${release}.tar.gz + rm -f *.tar.gz ln -s . $release tar czf ${release}.tar.gz --exclude=libraries/** --exclude=input/** --exclude=.git/** --exclude=${release}/${release} ${release}/* rm ${release} From 5e26b7183a85978fb0a63b4a0f86bc8eb29f5be8 Mon Sep 17 00:00:00 2001 From: Spiros Eliopoulos Date: Sun, 27 Mar 2016 17:26:13 -0400 Subject: [PATCH 5/7] fix-meta: move release and mk_opam to the scripts dir --- Makefile | 4 ++-- {src => scripts}/mk_opam | 0 release => scripts/release | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename {src => scripts}/mk_opam (100%) rename release => scripts/release (100%) diff --git a/Makefile b/Makefile index 4aa77c967..48f250250 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ configure: .PHONY: aws-ec2 aws-ec2: ./aws_gen.native --is-ec2 -i input/ec2/latest/service-2.json -r input/ec2/overrides.json -e input/errors.json -o libraries - cd libraries/ec2 && oasis setup && bash ../../src/mk_opam + cd libraries/ec2 && oasis setup && bash ../../scripts/mk_opam # NOTE: This does not include aws-ec2, which is special-cased. LIBRARIES := \ @@ -60,7 +60,7 @@ LIBRARIES := \ .PHONY: $(LIBRARIES) $(LIBRARIES): aws-%: ./aws_gen.native -i input/$*/latest/service-2.json -r input/$*/overrides.json -e input/errors.json -o libraries - cd libraries/$* && oasis setup && bash ../../src/mk_opam + cd libraries/$* && oasis setup && bash ../../scripts/mk_opam gen: all aws-ec2 $(LIBRARIES) diff --git a/src/mk_opam b/scripts/mk_opam similarity index 100% rename from src/mk_opam rename to scripts/mk_opam diff --git a/release b/scripts/release similarity index 100% rename from release rename to scripts/release From 3f4917b287b3ba56a358f2fafe27b00091f40b92 Mon Sep 17 00:00:00 2001 From: Spiros Eliopoulos Date: Sun, 27 Mar 2016 17:37:17 -0400 Subject: [PATCH 6/7] fix-meta: add mode argument to release script --- scripts/release | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/scripts/release b/scripts/release index 7877bfbb4..3cf501ee1 100755 --- a/scripts/release +++ b/scripts/release @@ -30,11 +30,13 @@ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. +AWS_RELEASE=aws-$(oasis query version) + function release_service() { local service=$(oasis query name) local version=$(oasis query version) local release=$service-${version} - local aws_release=$1 + local AWS_RELEASE=$1 echo "== $release" make distclean > /dev/null rm -f *.tar.gz @@ -42,7 +44,7 @@ function release_service() { tar czf ${release}.tar.gz --exclude=${release}/${release} ${release}/* rm ${release} if [[ -n ${COOKIE_JAR+x} ]]; then - git upload-release -c ${COOKIE_JAR} inhabitedtype ocaml-aws ${aws_release} ${release}.tar.gz + git upload-release -c ${COOKIE_JAR} inhabitedtype ocaml-aws ${AWS_RELEASE} ${release}.tar.gz fi } @@ -60,16 +62,19 @@ function release_top() { fi } -function release() { - release_top - local aws_release=aws-$(oasis query version) +function release_libs() { for lib in $(ls libraries); do if [[ -d libraries/$lib ]]; then pushd libraries/$lib > /dev/null - release_service $aws_release + release_service $AWS_RELEASE popd > /dev/null fi done } -release +case $1 in + "top") release_top;; + "libs") release_libs;; + "all") release_top; release_libs;; + *) echo "usage: release [top|libs|all]"; exit 1;; +esac From 57751ad1c22cc8c9fd7436e19cfe36fa3ec8499b Mon Sep 17 00:00:00 2001 From: Spiros Eliopoulos Date: Sun, 27 Mar 2016 17:38:10 -0400 Subject: [PATCH 7/7] fix-meta: add publish script for public opam --- scripts/publish | 65 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 scripts/publish diff --git a/scripts/publish b/scripts/publish new file mode 100755 index 000000000..84f1cf7e5 --- /dev/null +++ b/scripts/publish @@ -0,0 +1,65 @@ +#!/usr/bin/env bash +# Copyright (c) 2016 Inhabited Type LLC. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the author nor the names of his contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +AWS_RELEASE=aws-$(oasis query version) + +function publish() +{ + local service=$(oasis query name) + local version=$(oasis query version) + local release=$service-${version} + local uri="https://github.com/inhabitedtype/ocaml-aws/releases/download/$AWS_RELEASE/$release.tar.gz" + echo "== $release" + local dir=${release/-/.} + mkdir -p $dir + cp -r opam/* $dir + rm $dir/findlib + echo "archive:\"$uri\"" > $dir/url + echo "checksum:\"$(curl -L $uri | md5)\"" >> $dir/url + opam publish submit --name=seliopou $dir +} + +function publish_libs() { + for lib in $(ls libraries); do + if [[ -d libraries/$lib ]]; then + pushd libraries/$lib > /dev/null + publish + popd > /dev/null + fi + done +} + +case $1 in + "top") publish;; + "libs") publish_libs;; + *) echo "usage: publish [top|libs]"; exit 1;; +esac