summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Gomes <tiago.gomes@codethink.co.uk>2015-11-23 13:13:23 (GMT)
committerTiago Gomes <tiago.gomes@codethink.co.uk>2015-11-25 17:01:16 (GMT)
commitfcb02bf722b53eb9985f1efe04291894a9e42fcd (patch)
tree6343f054f58f1691cbaadd0d24b6e57e7589ab5f
parent2c2be06c45459a0f1e70647ee32abaf85a931316 (diff)
downloadmorph-fcb02bf722b53eb9985f1efe04291894a9e42fcd.tar.gz
Remove unused functions from morph.shell-lib
Change-Id: Ibf1edd1b0e58c600167eb2f1394e464d1f0041c1
-rw-r--r--yarns/morph.shell-lib85
1 files changed, 0 insertions, 85 deletions
diff --git a/yarns/morph.shell-lib b/yarns/morph.shell-lib
index faf094f..d9d29a0 100644
--- a/yarns/morph.shell-lib
+++ b/yarns/morph.shell-lib
@@ -76,39 +76,6 @@ die()
exit 1
}
-
-# Tests often need to check that specific files or directories exist
-# and have the right ownerships etc. Here's some shell functions to
-# test that kind of thing.
-
-is_dir()
-{
- if [ ! -d "$1" ]
- then
- die "Expected $1 to be a directory"
- fi
-}
-
-is_file()
-{
- if [ ! -f "$1" ]
- then
- die "Expected $1 to be a regular file"
- fi
-}
-
-
-# General assertions.
-
-assert_equal()
-{
- if [ "$1" != "$2" ]
- then
- die "Expected '$1' and '$2' to be equal"
- fi
-}
-
-
# Sometimes it's nice to run a command in a different directory, without
# having to bother changing the directory before and after the command,
# or spawning subshells. This function helps with that.
@@ -118,49 +85,6 @@ run_in()
(cd "$1" && shift && exec "$@")
}
-
-# Extract all refs in all given morphologies. Each ref is reported
-# as filename:ref. The referred-to repository is not listed.
-
-list_refs()
-{
- awk '/ ref: / { printf "%s %s\n", FILENAME, $NF }' "$@"
-}
-
-
-# Is a ref petrified? Or a specific branch?
-
-is_petrified_or_branch()
-{
- if echo "$1" |
- awk -v "branch=$2" '$NF ~ /[0-9a-fA-F]{40}/ || $NF == branch' |
- grep .
- then
- return 0
- else
- return 1
- fi
-}
-
-
-# Are named morphologies petrified? Die if not. First arg is the
-# branch that is allowed in addition to SHA1s.
-
-assert_morphologies_are_petrified()
-{
- local branch="$1"
- shift
- list_refs "$@" |
- while read filename ref
- do
- if ! is_petrified_or_branch "$ref" "$branch"
- then
- die "Found non-SHA1 ref in $filename: $ref"
- fi
- done
-}
-
-
# Added until it's fixed in upstream.
# It's a solution to create an empty home directory each execution
export HOME="$DATADIR/home"
@@ -179,15 +103,6 @@ then
EOF
fi
-
-# Change colons to slashes. This is used when converting an aliases
-# repository URL (e.g., test:morphs) into a directory path.
-
-slashify_colons()
-{
- echo "$1" | sed s,:,/,g
-}
-
start_cache_server(){
mkfifo "$1"
start-stop-daemon --start --pidfile="$2" \