os400: Add function wrapper for system command

The wrapper will exit if the system command failed instead of blindly
continuing on.

In addition, only copy docs which exist, since now the copy failure will
cause the build to stop.

Closes #8455
This commit is contained in:
Kevin Adler 2022-01-24 16:45:48 -06:00 committed by Daniel Stenberg
parent a70600ca59
commit 86ad624c5a
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 8 additions and 2 deletions

View file

@ -6,7 +6,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
@ -21,6 +21,10 @@
#
###########################################################################
system ()
{
/usr/bin/system "$@" || exit 1
}
setenv()

View file

@ -6,7 +6,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
@ -59,6 +59,8 @@ do MEMBER="`basename \"${TEXT}\" .OS400`"
MEMBER="`basename \"${MEMBER}\" .md`"
MEMBER="${LIBIFSNAME}/DOCS.FILE/`db2_name \"${MEMBER}\"`.MBR"
[ -e "${TEXT}" ] || continue
if action_needed "${MEMBER}" "${TEXT}"
then CMD="CPY OBJ('${TEXT}') TOOBJ('${MEMBER}') TOCCSID(${TGTCCSID})"
CMD="${CMD} DTAFMT(*TEXT) REPLACE(*YES)"