Sha256: 3587bf752c1e3ffe08c77c7afc1700cd9b57d840cb2decff40ac773af939a0ec

Contents?: true

Size: 675 Bytes

Versions: 4

Compression:

Stored size: 675 Bytes

Contents

#!/bin/bash

set -euo pipefail
cd "$(dirname "$0")/.."

echo "Adding hstore extension"
bin/sql -q -c "CREATE EXTENSION IF NOT EXISTS hstore;"

echo "Dropping tables that we're going to load in"
bin/sql -q -c "DROP TABLE IF EXISTS dependencies, gem_downloads, linksets, rubygems, versions CASCADE;"

latest_url="$1"
curl --progress-bar "${latest_url}" > tmp/public_postgresql.tar

# Extract the single PostgresSQL.sql.gz file from the tar file, pass it through gunzip
# and load it as quietly as possible into the database
tar xOf tmp/public_postgresql.tar public_postgresql/databases/PostgreSQL.sql.gz | \
  gunzip -c | \
  bin/sql

rm tmp/public_postgresql.tar
echo "Done."

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spandx-rubygems-0.1.3 bin/load
spandx-rubygems-0.1.2 bin/load
spandx-rubygems-0.1.1 bin/load
spandx-rubygems-0.1.0 bin/load