diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-02-12 16:26:56 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-02-12 16:26:56 +0000 |
commit | c7d5db2e3afc4919e51f57fa037d45934fdc6695 (patch) | |
tree | 6e9e821165325c55fa5108835dba22e84babe075 /setup_native/scripts/stclient_wrapper.sh | |
parent | 21e45ba78d82034f6706ebd6e332e4aa55713e57 (diff) |
INTEGRATION: CWS fwk84_SRC680 (1.3.34); FILE MERGED
2008/02/04 11:55:14 obr 1.3.34.2: #153871# support for instance urn(s)
2008/01/25 09:56:19 obr 1.3.34.1: #153306# stclient interface change
Diffstat (limited to 'setup_native/scripts/stclient_wrapper.sh')
-rw-r--r-- | setup_native/scripts/stclient_wrapper.sh | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/setup_native/scripts/stclient_wrapper.sh b/setup_native/scripts/stclient_wrapper.sh index c361237132ee..223b8a35f6d8 100644 --- a/setup_native/scripts/stclient_wrapper.sh +++ b/setup_native/scripts/stclient_wrapper.sh @@ -15,6 +15,7 @@ PRODUCT_NAME= PRODUCT_VERSION= PRODUCT_SOURCE= PARENT_PRODUCT_NAME= +INSTANCE_URN= while [ $# -gt 0 ] do @@ -22,12 +23,13 @@ do -t) TARGET_URN="$2"; shift;; -p) PRODUCT_NAME="$2"; shift;; -e) PRODUCT_VERSION="$2"; shift;; + -i) INSTANCE_URN="$2"; shift;; -P) PARENT_PRODUCT_NAME="$2"; shift;; -S) PRODUCT_SOURCE="$2"; shift;; --) shift; break;; -*) echo >&2 \ - "usage: $0 -p <product name> -e <product version> -t <urn> -S <source> -P <parent product name>" + "usage: $0 -p <product name> -e <product version> -t <urn> -S <source> -P <parent product name> [-i <instance urn>]" exit 1;; *) break;; esac @@ -36,8 +38,16 @@ done [ -x "$STCLIENT" ] || exit 1 -TEST=`${STCLIENT} -f -t ${TARGET_URN}` || exit 1 -[ "${TEST}" = "No records found" ] || exit 0 +# test if already registered +if [ ! -n $INSTANCE_URN ]; then + TEST=`${STCLIENT} -f -t ${TARGET_URN}`; EXITCODE=$? + + # retry on unexpected error codes + [ ${EXITCODE} -eq 0 -o ${EXITCODE} -eq 225 ] || exit 1 + + # early versions did not have a dedicated exitcode, so need to compare text output + [ ${EXITCODE} -eq 225 -o "${TEST}" = "No records found" ] || echo "${TEST}"; exit 0 +fi uname=`uname -p` zone="global" @@ -48,7 +58,9 @@ if [ `uname -s` = "SunOS" ]; then fi fi -output=`"${STCLIENT}" -a -p "${PRODUCT_NAME}" -e "${PRODUCT_VERSION}" -t "${TARGET_URN}" -S "${PRODUCT_SOURCE}" -P "${PARENT_PRODUCT_NAME}" -m "Sun Microsystems, Inc." -A "${uname}" -z "${zone}"` || exit 1 +output=`"${STCLIENT}" -a -p "${PRODUCT_NAME}" -e "${PRODUCT_VERSION}" -t ${TARGET_URN} -S "${PRODUCT_SOURCE}" -P "${PARENT_PRODUCT_NAME}" ${INSTANCE_URN:+"-i"} ${INSTANCE_URN} -m "Sun Microsystems, Inc." -A "${uname}" -z "${zone}"`; EXITCODE=$? + +[ "${INSTANCE_URN}" = "" -a ${EXITCODE} -eq 226 ] && exit 0 -exit 0 +exit ${EXITCODE} |