Skip to content

Commit

Permalink
major update of make* scripts, start using underscore prefix for loca…
Browse files Browse the repository at this point in the history
…l functions, more commonality in options
  • Loading branch information
dericed committed Nov 18, 2013
1 parent 590a2af commit 20addb8
Show file tree
Hide file tree
Showing 21 changed files with 515 additions and 510 deletions.
6 changes: 3 additions & 3 deletions barcodeinterpret
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ scriptdir=$(dirname "$0")
. "$scriptdir/mmfunctions" || { echo "Missing '$scriptdir/mmfunctions'. Exiting." ; exit 1 ;};

cleanup(){
log -a "Process aborted"
_log -a "Process aborted"
exit 1
}

trap cleanup SIGHUP SIGINT SIGTERM
log -b
_log -b

if test $# != 1 ; then
echo "You must supply one argument, a scanned interleaved 2/5 barcode value"; exit
Expand Down Expand Up @@ -65,4 +65,4 @@ if [[ $(echo "$materialid" | tail -c +9 | head -c 1) == "H" ]] ; then
materialid="${materialid}D"
fi
echo deviceid,$(echo $ids | cut -d ' ' -f 1),materialid,$materialid,som,$(addcolons $(echo $barcode | cut -c 42-49)),duration,$(addcolons $(echo $barcode | cut -c 50-57))
log -e
_log -e
6 changes: 3 additions & 3 deletions blackatends
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ scriptdir=$(dirname "$0")
version=1.0

cleanup(){
log -a "Process aborted"
_log -a "Process aborted"
exit 1
}

Expand Down Expand Up @@ -38,9 +38,9 @@ done
shift $(( ${OPTIND} - 1 ))

while [ "$*" != "" ] ; do
log -b
_log -b
[ "$#" != 0 ] && sourcefile="$1"
black_at_ends "$sourcefile"
log -e
_log -e
shift
done
6 changes: 3 additions & 3 deletions checksumpackage
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ usage(){
check_dependencies "${dependencies[@]}"

cleanup(){
log -a "Process aborted"
_log -a "Process aborted"
exit 1
}

Expand All @@ -33,7 +33,7 @@ CHECKSUMNAME="checksum.md5"
DFXMLNAME="dfxml.xml"

while [ "${*}" != "" ] ; do
log -b
_log -b
if [ -d "${1}" ] ; then
PWD=$(pwd)
"${scriptdir}/removeDSStore" "$1"
Expand All @@ -59,6 +59,6 @@ while [ "${*}" != "" ] ; do
else
report -dt "ERROR: ${0} requires directories as input and $1 is not a directory."
fi
log -e
_log -e
shift
done
8 changes: 4 additions & 4 deletions fix_left2stereo
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ scriptdir=$(dirname "$0")

usage(){
echo
echo "$(basename $0) ${version}"
echo "$(basename ${0}) ${version}"
echo "This application takes an input video file(s) and produces outputs that are map the left channel of the input to a stereo mix in the output."
echo "Dependencies: ${dependencies[@]}"
echo "Usage: $(basename $0) file1 [ file2 ...]"
Expand All @@ -20,15 +20,15 @@ usage(){
check_dependencies "${dependencies[@]}"

cleanup(){
log -a "Process aborted"
_log -a "Process aborted"
exit 1
}

# local variables
suffix="_left2stereo"

trap cleanup SIGHUP SIGINT SIGTERM
log -b
_log -b

while [ "$*" != "" ] ; do

Expand All @@ -52,4 +52,4 @@ while [ "$*" != "" ] ; do
fi
shift
done
log -e
_log -e
8 changes: 4 additions & 4 deletions fix_rewrap
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ scriptdir=$(dirname "$0")

usage(){
echo
echo "$(basename $0) ${version}"
echo "$(basename ${0}) ${version}"
echo "This application takes an input video file(s) and produces outputs through re-multiplexing all tracks of the input into a new container."
echo "Dependencies: ${dependencies[@]}"
echo "Usage: $(basename $0) file1 [ file2 ...]"
Expand All @@ -20,15 +20,15 @@ usage(){
check_dependencies "${dependencies[@]}"

cleanup(){
log -a "Process aborted"
_log -a "Process aborted"
exit 1
}

# local variables
suffix="_rewrap"

trap cleanup SIGHUP SIGINT SIGTERM
log -b
_log -b

while [ "$*" != "" ] ; do

Expand All @@ -51,4 +51,4 @@ while [ "$*" != "" ] ; do
fi
shift
done
log -e
_log -e
6 changes: 3 additions & 3 deletions fix_volume
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ done
shift $(( ${OPTIND} - 1 ))

cleanup(){
log -a "Process aborted"
_log -a "Process aborted"
exit 1
}

trap cleanup SIGHUP SIGINT SIGTERM
log -b
_log -b

while [ "$*" != "" ] ; do
input_movie="${1}"
Expand Down Expand Up @@ -69,4 +69,4 @@ while [ "$*" != "" ] ; do
fi
shift
done
log -e
_log -e
19 changes: 8 additions & 11 deletions ingestfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ remove_mediaid_from_queue(){
}

cleanup(){
log -a "Process aborted"
_log -a "Process aborted"
remove_mediaid_from_queue
[ -d "${OUTDIR_INGESTFILE}/${mediaid}" ] && mv "${OUTDIR_INGESTFILE}/${mediaid}" "${OUTDIR_INGESTFILE}/${mediaid}_aborted_ingest_$(get_iso8601_c)"
exit 1
Expand Down Expand Up @@ -171,23 +171,20 @@ if [ "${priority}" = "put in queue" ] ; then
done
fi

log -b
_log -b

# set up package directories
mkdir -p "${objectsdir}"
_run_critical mkdir -p "${objectsdir}"
logdir="${OUTDIR_INGESTFILE}/${mediaid}/metadata/submissionDocumentation/logs"
mkdir -p "${logdir}"
_run mkdir -p "${logdir}"
submissiondocdir="${OUTDIR_INGESTFILE}/${mediaid}/metadata/submissionDocumentation"
mkdir -p "${submissiondocdir}"
_run mkdir -p "${submissiondocdir}"

start=$(get_iso8601)

# rsync
report -dt "STATUS Copying the original file to library storage at ${objectsdir}."
rsync -rt --progress --log-file="${logdir}/rsync_$(get_iso8601_c)_$(basename $0)_${version}.txt" "${input}" "${objectsdir}/"

rsync_err="${?}"
[ "${rsync_err}" -gt "0" ] && { report -wt "rsync failed with error ${rsync_err}" ; exit 1 ;};
_run_critical rsync -rt --progress --log-file="${logdir}/rsync_$(get_iso8601_c)_$(basename $0)_${version}.txt" "${input}" "${objectsdir}/"

# make copy for broadcast
unset makebroadcastopts
Expand Down Expand Up @@ -243,11 +240,11 @@ if [ "${cleanup}" == "Y" ] ; then
report -wt "Cancelling requested deletion of source file, not looking safe."
else
report -dt "Removing the source file from ${input} as requested."
rm -f "${input}"
_run rm -f "${input}"
fi
fi

# clean up queue
[ "${priority}" == "put in queue" ] && remove_mediaid_from_queue

log -e
_log -e
Loading

0 comments on commit 20addb8

Please sign in to comment.