Remove unused scripts.

Which are all of them.
This commit is contained in:
Julian K. Arni 2018-03-13 10:28:20 +01:00
parent e02f29a379
commit aa612de2d0
10 changed files with 0 additions and 317 deletions

View file

@ -1,8 +0,0 @@
The release process works roughly like this:
``` bash
./scripts/bump-versions.sh <type-of-bump>
git commit
./scripts/upload.hs
git tag <version> && git push --tags
```

View file

@ -1,62 +0,0 @@
#!/usr/bin/env bash
#===============================================================================
#
# FILE: bump-versions.sh
#
# USAGE: ./bump-versions.sh
#
# DESCRIPTION: Bump the versions for all servant packages
#
# OPTIONS: See usage
# REQUIREMENTS: bumper, bash >= 4
# CREATED: 11.05.2015 21:36
# REVISION: ---
#===============================================================================
set -o nounset
set -o errexit
DIR=$( dirname $( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ))
. "${DIR}/scripts/lib/common.sh"
usage () {
echo " bump-versions.sh <POSITION> [-d|--dry-run]"
echo " | [-h|--help]"
echo " Bumps the specified positional version of all servant packages."
echo " POSITION is a number between 0 and 3, inclusive."
exit 0
}
if [ $# -eq 0 ] ; then
echo "expecting one or more arguments. Got 0"
usage
elif [ $# -gt 2 ] ; then
echo "expecting one or more arguments"
usage
fi
versions_equal
while [ "${1:-unset}" != "unset" ] ; do
case "$1" in
-h | --help) usage ;;
-d | --dry-run) DRY_RUN=true
shift ;;
0) if POSITION="none" ; then POSITION=0 ; else usage ; fi
shift ;;
1) if POSITION="none" ; then POSITION=1 ; else usage ; fi
shift ;;
2) if POSITION="none" ; then POSITION=2 ; else usage ; fi
shift ;;
3) if POSITION="none" ; then POSITION=3 ; else usage ; fi
shift ;;
*) usage ;;
esac
done
if $DRY_RUN ; then
echo "Would have bumped position ${POSITION} on these packages:"
( cd "$ROOT" && bumper --dry-run -"$POSITION" $(join , $SOURCES tutorial) )
else
( cd "$ROOT" && bumper -"$POSITION" $(join , $SOURCES tutorial) )
fi

View file

@ -1,20 +0,0 @@
#!/usr/bin/env bash
set -o nounset
set -o errexit
set -o verbose
export PATH=$(stack path --bin-path):$PATH
stack install cabal-install
cabal update
for package in $(cat sources.txt) ; do
echo testing $package
pushd $package
tinc
cabal configure --enable-tests --disable-optimization --ghc-options='-Werror'
cabal build
cabal test
popd
done

View file

@ -1,26 +0,0 @@
#!/usr/bin/env bash
#===============================================================================
#
# FILE: clear-sandbox.sh
#
# USAGE: ./clear-sandbox.sh
#
# DESCRIPTION: Clear sandbox at top-level and at all packages
#
# REQUIREMENTS: bash >= 4
#===============================================================================
set -o nounset
set -o errexit
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
. "$DIR"/lib/common.sh
clear_sandbox () {
rm -rf .cabal-sandbox cabal.sandbox.config
for s in ${SOURCES[@]} ; do
(cd "$s" && rm -rf cabal.sandbox.config dist)
done
}
clear_sandbox

View file

@ -1,48 +0,0 @@
#!/usr/bin/env bash
#===============================================================================
#
# FILE: generate-nix-files.sh
#
# USAGE: ./generate-nix-files.sh
#
# DESCRIPTION: Update nix files at top-level and add all packages
#
# REQUIREMENTS: bash >= 4, cabal2nix(nix tool)
#===============================================================================
set -o nounset
set -o errexit
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
. "$DIR"/lib/common.sh
SHELLNIX="shell.nix"
write-package-shell-nix () {
rm -rf $SHELLNIX
echo -e "let" >> $SHELLNIX
echo -e " pkgs = import <nixpkgs> {};" >> $SHELLNIX
echo -e "" >> $SHELLNIX
echo -e " haskellPackages = pkgs.haskellPackages.override {" >> $SHELLNIX
echo -e " overrides = self: super: {" >> $SHELLNIX
for n in ${SOURCES[@]} ; do
if [[ $1 != $n ]]; then
echo -e " $n = pkgs.haskell.lib.dontCheck (pkgs.haskell.lib.appendConfigureFlag (self.callPackage ../$n {}) \"--ghc-options=-Werror\");" >> $SHELLNIX
fi
done
echo -e " $1 = pkgs.haskell.lib.appendConfigureFlag (self.callPackage ./. {}) \"--ghc-options=-Werror\";" >> $SHELLNIX
echo -e " };" >> $SHELLNIX
echo -e " };" >> $SHELLNIX
echo -e "" >> $SHELLNIX
echo -e "in haskellPackages.$s.env" >> $SHELLNIX
}
update-nix-files () {
for s in ${SOURCES[@]} ; do
pushd "$s" > /dev/null
cabal2nix . > default.nix
write-package-shell-nix $s
popd > /dev/null
done
}
update-nix-files

View file

@ -1,56 +0,0 @@
#!/bin/bash -
#===============================================================================
#
# FILE: lib/common.sh
#
# DESCRIPTION: Common functions for servant's shell scripts
# Meant to be sourced rather than run.
#
# REQUIREMENTS: bash >= 4
#===============================================================================
DIR=$( dirname $( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ))
ROOT=$( dirname $DIR )
DRY_RUN=false
POSITION="none"
SOURCES_TXT="$( dirname $DIR)/sources.txt"
CABAL=${CABAL:-cabal}
TRAVIS=${TRAVIS:-false}
declare -a SOURCES
SOURCES=$(awk -F= '{print $1}' "$SOURCES_TXT")
join () { local IFS="$1"; shift; echo "$*"; }
versions_equal () {
local NUM=$(cd "$ROOT" && find . -name 'servant*.cabal' | xargs grep "^version:" | awk '{ print $2 }' | uniq -c | wc -l)
if [ 1 -eq $NUM ] ; then
return 0
else
echo "versions of packages are not all the same!" && exit 1
fi
}
travis_retry() {
# From
# https://github.com/travis-ci/travis-build/blob/18bd04e965b9bfaa49cd6bdcd8dcb1513b8d2fcd/lib/travis/build/templates/header.sh
local result=0
local count=1
while [ $count -le 3 ]; do
[ $result -ne 0 ] && {
echo -e "\n${ANSI_RED}The command \"$@\" failed. Retrying, $count of 3.${ANSI_RESET}\n" >&2
}
"$@"
result=$?
[ $result -eq 0 ] && break
count=$(($count + 1))
sleep 1
done
[ $count -gt 3 ] && {
echo -e "\n${ANSI_RED}The command \"$@\" failed 3 times.${ANSI_RESET}\n" >&2
}
return $result
}

View file

@ -1,26 +0,0 @@
#!/usr/bin/env bash
#===============================================================================
#
# FILE: start-sandbox.sh
#
# USAGE: ./start-sandbox.sh
#
# DESCRIPTION: Create sandbox at top-level and add all packages as add-source
#
# REQUIREMENTS: bash >= 4
#===============================================================================
set -o nounset
set -o errexit
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
. "$DIR"/lib/common.sh
prepare_sandbox () {
$CABAL sandbox init
for s in ${SOURCES[@]} ; do
(cd "$s" && $CABAL sandbox init --sandbox=../.cabal-sandbox && $CABAL sandbox add-source .)
done
}
prepare_sandbox

View file

@ -1,46 +0,0 @@
#!/usr/bin/env bash
#===============================================================================
#
# FILE: test-all.sh
#
# USAGE: ./test-all.sh
#
# DESCRIPTION: Run tests for all source directories listed in $SOURCES.
# Uses local versions of those sources.
#
# REQUIREMENTS: bash >= 4
#===============================================================================
set -o nounset
set -o errexit
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
. "$DIR"/lib/common.sh
GHC_FLAGS="-Werror"
prepare_sandbox () {
$CABAL sandbox init
for s in ${SOURCES[@]} ; do
(cd "$s" && $CABAL sandbox init --sandbox=../.cabal-sandbox/ && $CABAL sandbox add-source .)
done
if $TRAVIS ; then
travis_retry $CABAL install --enable-tests ${SOURCES[@]}
else
$CABAL install --max-backjumps -1 --reorder-goals --enable-tests ${SOURCES[@]}
fi
}
test_each () {
for s in ${SOURCES[@]} ; do
echo "Testing $s..."
pushd "$s"
$CABAL configure --enable-tests --ghc-options="$GHC_FLAGS"
$CABAL build
$CABAL test
popd
done
}
prepare_sandbox
test_each

View file

@ -1,11 +0,0 @@
#!/usr/bin/env bash
set -o nounset
set -o errexit
for stack_file in stack*.yaml ; do
echo testing $stack_file...
export STACK_YAML=$stack_file
stack setup
stack test --fast --ghc-options="-Werror"
done

View file

@ -1,14 +0,0 @@
#!/usr/bin/env stack
{- stack
--resolver lts-3.10
--install-ghc runghc
-}
import Data.Foldable
import System.Process
main :: IO ()
main = do
sources <- words <$> readFile "sources.txt"
forM_ sources $ \ source -> do
callCommand ("stack upload --no-signature " ++ source)