diff options
author | Renato Botelho <renato@netgate.com> | 2015-10-14 07:34:40 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-10-14 07:34:40 -0300 |
commit | 87925fd15d1413bc15a62ad02c4da93b681c8c77 (patch) | |
tree | b729eae754bc52e317acabb2a15eb6e4fb30f602 /tools/builder_common.sh | |
parent | e28305f48fd2c11074cbbdc8a42b8201feded9b3 (diff) | |
download | pfsense-87925fd15d1413bc15a62ad02c4da93b681c8c77.zip pfsense-87925fd15d1413bc15a62ad02c4da93b681c8c77.tar.gz |
Simplify logic and check if file exist before try to copy it
Diffstat (limited to 'tools/builder_common.sh')
-rw-r--r-- | tools/builder_common.sh | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/tools/builder_common.sh b/tools/builder_common.sh index b921254..cbecaf3 100644 --- a/tools/builder_common.sh +++ b/tools/builder_common.sh @@ -2064,35 +2064,25 @@ snapshots_copy_to_staging_nanobsd() { } snapshots_copy_to_staging_iso_updates() { - # Copy ISOs - md5 ${ISOPATH}.gz > ${ISOPATH}.md5 - sha256 ${ISOPATH}.gz > ${ISOPATH}.sha256 - cp ${ISOPATH}* $STAGINGAREA/ 2>/dev/null - snapshots_create_latest_symlink ${STAGINGAREA}/$(basename ${ISOPATH}) - - # Copy memstick items - md5 ${MEMSTICKPATH}.gz > ${MEMSTICKPATH}.md5 - sha256 ${MEMSTICKPATH}.gz > ${MEMSTICKPATH}.sha256 - cp ${MEMSTICKPATH}* $STAGINGAREA/ 2>/dev/null - snapshots_create_latest_symlink ${STAGINGAREA}/$(basename ${MEMSTICKPATH}) - - md5 ${MEMSTICKSERIALPATH}.gz > ${MEMSTICKSERIALPATH}.md5 - sha256 ${MEMSTICKSERIALPATH}.gz > ${MEMSTICKSERIALPATH}.sha256 - cp ${MEMSTICKSERIALPATH}* $STAGINGAREA/ 2>/dev/null - snapshots_create_latest_symlink ${STAGINGAREA}/$(basename ${MEMSTICKSERIALPATH}) + local _img="" - if [ "${TARGET}" = "amd64" ]; then + for _img in ${ISOPATH} ${MEMSTICKPATH} ${MEMSTICKSERIALPATH} ${UPDATES_TARBALL_FILENAME}; do + if [ ! -f "${_img}.gz" ]; then + continue + fi + md5 ${_img}.gz > ${_img}.md5 + sha256 ${_img}.gz > ${_img}.sha256 + cp ${_img}* $STAGINGAREA/ 2>/dev/null + snapshots_create_latest_symlink ${STAGINGAREA}/$(basename ${_img}) + done + + if [ "${TARGET}" = "amd64" -a -f "${MEMSTICKADIPATH}.gz" ]; then md5 ${MEMSTICKADIPATH}.gz > ${MEMSTICKADIPATH}.md5 sha256 ${MEMSTICKADIPATH}.gz > ${MEMSTICKADIPATH}.sha256 cp ${MEMSTICKADIPATH}* $STAGINGAREA/ 2>/dev/null snapshots_create_latest_symlink ${STAGINGAREA}/$(basename ${MEMSTICKADIPATH}) fi - md5 ${UPDATES_TARBALL_FILENAME} > ${UPDATES_TARBALL_FILENAME}.md5 - sha256 ${UPDATES_TARBALL_FILENAME} > ${UPDATES_TARBALL_FILENAME}.sha256 - cp ${UPDATES_TARBALL_FILENAME}* $STAGINGAREA/ 2>/dev/null - snapshots_create_latest_symlink ${STAGINGAREA}/$(basename ${UPDATES_TARBALL_FILENAME}) - # NOTE: Updates need a file with output similar to date output # Use the file generated at start of snapshots_dobuilds() to be consistent on times if [ -z "${_IS_RELEASE}" ]; then |