summaryrefslogtreecommitdiff
path: root/type
diff options
context:
space:
mode:
authorDennis Camera <cdist@dtnr.ch>2021-03-13 13:08:05 +0100
committerDennis Camera <cdist@dtnr.ch>2021-03-19 11:06:07 +0100
commit78b6e867aa62f73d9f967d25d08bee8ba25c1403 (patch)
tree4263db4e266de6a29ab3b9a2c0a8aa6f854f3764 /type
parent635d83480864eb474fd64a1451d15c6e60562a57 (diff)
download__dtnrch_egov-78b6e867aa62f73d9f967d25d08bee8ba25c1403.tar.gz
__dtnrch_egov-78b6e867aa62f73d9f967d25d08bee8ba25c1403.zip
[type/__dtnrch_etax_sgnp] Add --install-dir parameter
Diffstat (limited to 'type')
-rwxr-xr-xtype/__dtnrch_etax_sgnp/gencode-remote14
-rw-r--r--type/__dtnrch_etax_sgnp/man.rst8
-rwxr-xr-xtype/__dtnrch_etax_sgnp/manifest24
-rw-r--r--type/__dtnrch_etax_sgnp/parameter/optional1
4 files changed, 37 insertions, 10 deletions
diff --git a/type/__dtnrch_etax_sgnp/gencode-remote b/type/__dtnrch_etax_sgnp/gencode-remote
index 5c921c0..9e1adee 100755
--- a/type/__dtnrch_etax_sgnp/gencode-remote
+++ b/type/__dtnrch_etax_sgnp/gencode-remote
@@ -33,7 +33,19 @@ else
exit 1
fi
-install_dir=${prefix:-${DEFAULT_INSTALL_DIR}}
+
+if test -s "${__object:?}/parameter/install-dir"
+then
+ install_dir=$(cat "${__object:?}/parameter/install-dir")
+else
+ install_dir=${DEFAULT_INSTALL_DIR:?}
+ install_dir=${install_dir%/} # no trailing slash
+fi
+if test -s "${__object:?}/parameter/prefix"
+then
+ prefix=$(cat "${__object:?}/parameter/prefix")
+ install_dir="${prefix}/${install_dir##*/}"
+fi
if grep -q '^__dtnrch_install4j/.*:installed' "${__messages_in:?}"
then
diff --git a/type/__dtnrch_etax_sgnp/man.rst b/type/__dtnrch_etax_sgnp/man.rst
index bee8e5d..656b78c 100644
--- a/type/__dtnrch_etax_sgnp/man.rst
+++ b/type/__dtnrch_etax_sgnp/man.rst
@@ -19,9 +19,13 @@ version
OPTIONAL PARAMETERS
-------------------
-prefix
+install-dir
The directory into which the application should be installed.
- Defaults to ``__object_id``.
+prefix
+ The prefix into which the application should be installed.
+ It will be prepended to the last component of ``--install-dir``, if set.
+
+ It will default to a "sane" value otherwise.
state
One of:
diff --git a/type/__dtnrch_etax_sgnp/manifest b/type/__dtnrch_etax_sgnp/manifest
index 46a4e19..be625bc 100755
--- a/type/__dtnrch_etax_sgnp/manifest
+++ b/type/__dtnrch_etax_sgnp/manifest
@@ -21,11 +21,6 @@
os=$(cat "${__global:?}/explorer/os")
-if test -s "${__object:?}/parameter/prefix"
-then
- prefix=$(cat "${__object:?}/parameter/prefix")
-fi
-
state_should=$(cat "${__object:?}/parameter/state")
if meta=$(sh -e "${__type:?}/files/find_release.sh")
@@ -79,7 +74,7 @@ test -n "${CKSUM}" || {
################################################################################
-# Download and install tax application
+# Download tax application
remote_file="${download_dir}/${FILENAME:?}"
@@ -109,7 +104,22 @@ then
install_dir="${prefix}/${install_dir##*/}"
fi
-install_dir=${prefix:-${DEFAULT_INSTALL_DIR}}
+################################################################################
+# Install tax application
+
+if test -s "${__object:?}/parameter/install-dir"
+then
+ install_dir=$(cat "${__object:?}/parameter/install-dir")
+else
+ install_dir=${DEFAULT_INSTALL_DIR:?}
+ install_dir=${install_dir%/} # no trailing slash
+fi
+if test -s "${__object:?}/parameter/prefix"
+then
+ prefix=$(cat "${__object:?}/parameter/prefix")
+ install_dir="${prefix}/${install_dir##*/}"
+fi
+
require=${require-} \
__dtnrch_install4j "${install_dir}" \
--state "${state_should}" \
diff --git a/type/__dtnrch_etax_sgnp/parameter/optional b/type/__dtnrch_etax_sgnp/parameter/optional
index e1a358e..dc2601b 100644
--- a/type/__dtnrch_etax_sgnp/parameter/optional
+++ b/type/__dtnrch_etax_sgnp/parameter/optional
@@ -1,2 +1,3 @@
+install-dir
prefix
state