aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRadek Szymczyszyn <[email protected]>2015-07-02 16:53:49 +0200
committerRadek Szymczyszyn <[email protected]>2015-07-03 13:24:57 +0200
commit87cd3bb022ff3cb829a07fe4e442c0284360c3e2 (patch)
tree8755af16bd661a0509915535b1bbc9fb447f1f6d
parentbd801b91b5f81a9d2e44fe3a68875100f08180ae (diff)
downloadkerl-87cd3bb022ff3cb829a07fe4e442c0284360c3e2.tar.gz
kerl-87cd3bb022ff3cb829a07fe4e442c0284360c3e2.tar.bz2
kerl-87cd3bb022ff3cb829a07fe4e442c0284360c3e2.zip
Deduplicate some installation steps
-rwxr-xr-xkerl41
1 files changed, 22 insertions, 19 deletions
diff --git a/kerl b/kerl
index 552b2fb..43e3545 100755
--- a/kerl
+++ b/kerl
@@ -497,19 +497,12 @@ ACTIVATE
if [ "$rel" != "git" ]; then
if [ -n "$KERL_INSTALL_MANPAGES" ]; then
echo "Fetching and installing manpages..."
- FILENAME=otp_doc_man_$rel.tar.gz
- download "$FILENAME"
- echo "Extracting manpages"
- cd "$absdir" && tar xfz "$KERL_DOWNLOAD_DIR/$FILENAME"
+ do_install_manpages "$rel"
fi
if [ -n "$KERL_INSTALL_HTMLDOCS" ]; then
echo "Fetching and installing HTML docs..."
- FILENAME="otp_doc_html_$rel.tar.gz"
- download "$FILENAME"
- echo "Extracting HTML docs"
- (cd "$absdir" && mkdir -p html && \
- tar -C "$absdir/html" -xzf "$KERL_DOWNLOAD_DIR/$FILENAME")
+ do_install_htmldocs "$rel"
fi
else
rel=`get_newest_valid_release`
@@ -520,19 +513,12 @@ ACTIVATE
if [ -n "$KERL_INSTALL_MANPAGES" ]; then
echo "CAUTION: Fetching and installing newest ($rel) manpages..."
- FILENAME=otp_doc_man_$rel.tar.gz
- download "$FILENAME"
- echo "Extracting manpages"
- cd "$absdir" && tar xfz "$KERL_DOWNLOAD_DIR/$FILENAME"
+ do_install_manpages "$rel"
fi
if [ -n "$KERL_INSTALL_HTMLDOCS" ]; then
- echo "CATION: Fetching and installing newest ($rel) HTML docs..."
- FILENAME="otp_doc_html_$rel.tar.gz"
- download "$FILENAME"
- echo "Extracting HTML docs"
- (cd "$absdir" && mkdir -p html && \
- tar -C "$absdir/html" -xzf "$KERL_DOWNLOAD_DIR/$FILENAME")
+ echo "CAUTION: Fetching and installing newest ($rel) HTML docs..."
+ do_install_htmldocs "$rel"
fi
fi
@@ -542,6 +528,23 @@ ACTIVATE
echo "kerl_deactivate"
}
+do_install_manpages()
+{
+ FILENAME=otp_doc_man_$1.tar.gz
+ download "$FILENAME"
+ echo "Extracting manpages"
+ cd "$absdir" && tar xfz "$KERL_DOWNLOAD_DIR/$FILENAME"
+}
+
+do_install_htmldocs()
+{
+ FILENAME="otp_doc_html_$1.tar.gz"
+ download "$FILENAME"
+ echo "Extracting HTML docs"
+ (cd "$absdir" && mkdir -p html && \
+ tar -C "$absdir/html" -xzf "$KERL_DOWNLOAD_DIR/$FILENAME")
+}
+
do_deploy()
{
if [ -z "$1" ]; then