Skip to content

Commit

Permalink
more comments in code for clarity and explanation of scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
dinahhandel committed May 3, 2016
1 parent 6f25ccd commit 90e07c5
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion blackatends
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ _usage(){
}
[ "${#}" = 0 ] && _usage

# command-line options to set mediaid and original variables
# command-line options for help and invalid options
OPTIND=1
while getopts ":h" OPT; do
case "${OPT}" in
Expand Down
3 changes: 3 additions & 0 deletions checksumpackage
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ while [ "${*}" != "" ] ; do
INDIR="."
OUTDIR="."
fi
#perform checking and verification
if [ "${CHECK}" = "Y" ] ; then
if [ -s "${PACKAGE}/${OUTDIR}/${DFXMLNAME}" ] ; then
_check_dfxml "${PACKAGE}"
Expand Down Expand Up @@ -152,6 +153,7 @@ while [ "${*}" != "" ] ; do
continue
fi
fi
#create digital forensics xml and checksum.md5 file
_report -dt "making Digital Forensics XML (${DFXMLNAME}) and (${CHECKSUMNAME}) for ${PACKAGE}"
cd "${PACKAGE}/${INDIR}"
DFXMLTMP=$(_maketemp)
Expand All @@ -167,6 +169,7 @@ while [ "${*}" != "" ] ; do
xml sel -T -t -m "/dfxml/fileobject" -v "hashdigest" -o " " -v "filename" -n "${PACKAGE}/${OUTDIR}/${DFXMLNAME}" > "${PACKAGE}/${OUTDIR}/${CHECKSUMNAME}"
fi
echo "$(_get_iso8601): $(basename "${0}"):${VERSION}: ${CHECKSUMNAME} is generated" >> "${PACKAGE}/${OUTDIR}/${CHECKSUMPROCESSLOG}"
#verify checksums by creating tmp checksum file and comparing with previously created checksums
if [ "${VERIFY}" = "Y" ] ; then
CHECKSUMCMP1=$(_maketemp)
sort -k2 "${PACKAGE}/${OUTDIR}/${CHECKSUMNAME}" > "${CHECKSUMCMP1}"
Expand Down
1 change: 1 addition & 0 deletions finishpackage
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
#finish package takes a directory input created by restructureforCompliance and creates derivative access copies, metadata documents, and a checksum file.
while [ "${*}" != "" ] ; do
INPUT="${1}"
makelossless "${INPUT}" && makebroadcast "${INPUT}" && makeyoutube "${INPUT}" && makemetadata "${INPUT}" && checksumpackage "${INPUT}"
Expand Down
4 changes: 2 additions & 2 deletions makebroadcast
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ _usage(){
}
[ "${#}" = 0 ] && _usage

# command-line options to set mediaid and original variables
# command-line options to adjust volume, delivery location, and slate creation
OPTIND=1
while getopts ":F:slrcv:o:d:e:E:nh" OPT ; do
case "${OPT}" in
Expand Down Expand Up @@ -180,7 +180,7 @@ while [ "${*}" != "" ] ; do
else
MIDDLEOPTIONS+=(-metadata:s:v:0 timecode=00:00:00.00)
fi
# determine filter choice if set in capture.log and set in and out times if used
# determine filter choice if set in capture.log and set in and out times if used, ignore out time if a slate is being created.
if [[ -f "${INGESTLOG}" && "${ISOBJECT}" = "Y" ]] ; then
if [ "${FORMULA}" = "none" ] ; then
FILTERCHOICE=$(_readingestlog "filter choice")
Expand Down
8 changes: 4 additions & 4 deletions makemetadata
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# make metadata
# make metadata creates a set of metadata reports for an archival information package on all files in the objects subdirectory.
VERSION="0.2"
SCRIPTDIR=$(dirname "${0}")
. "${SCRIPTDIR}/mmfunctions" || { echo "Missing '${SCRIPTDIR}/mmfunctions'. Exiting." ; exit 1 ;};
Expand All @@ -11,12 +11,13 @@ _usage(){
echo "$(basename "${0}") ${VERSION}"
echo "Produces a set of metadata reports for an archival information package on all files in the objects subdirectory."
echo "Usage: $(basename "${0}") [ -h ] package1 [ package2 ... ]"
echo " -h (show _usage)"
echo " -h (show usage)"
echo " -r deletes existing metadata files"
exit
}
[ "${#}" = 0 ] && _usage

# command-line options to set mediaid and original variables
# command-line option to remove existing metadata files
OPTIND=1
while getopts ":rh" OPT ; do
case "${OPT}" in
Expand All @@ -29,7 +30,6 @@ done
shift $(( ${OPTIND} - 1 ))

_set_up_filemeta(){
# set up output
_log -b
if [[ -d "${PACKAGE_PATH}/${OUTPUTDIR}" && "${DELETEFILEMETA}" != "Y" ]] ; then
_report -wt "WARNING ${PACKAGE_PATH}/${OUTPUTDIR} already exists, not making metadata."
Expand Down
6 changes: 4 additions & 2 deletions makemets
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ echo "<?xml version=\"1.0\"?>
" > /tmp/makemets.xsl

PWD=$(pwd)
cd "$1"
cd "${1}"
#create directory structure of AIP using tree, excluding tree file itself
tree -DaNXs --du --timefmt "%Y-%m-%dT%H:%M:%SZ" -I "tree.xml" -I "mets.xml" . > /tmp/tree.xml
#use xslt to create mets document from tree.xml
xsltproc --stringparam root "$(pwd)" /tmp/makemets.xsl /tmp/tree.xml | xml fo > "${1}/metadata/mets.xml"
cd "$PWD"
cd "${PWD}"

0 comments on commit 90e07c5

Please sign in to comment.