From 630403252d9b4c4f85459ad8112ebc735655c761 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Sat, 24 Mar 2018 00:53:16 +0200 Subject: [PATCH] added checksum for each package in repository, with the bash script that builds it. --- JCB_componentBuilderPublic.sha | 1 + JCB_demo.sha | 1 + JCB_demoAdvanced.sha | 1 + JCB_documentManager.sha | 1 + JCB_expertDatabase.sha | 1 + JCB_googlePlusProfileFeed.sha | 1 + JCB_helloWorld.sha | 1 + JCB_jobTrackingSystem.sha | 1 + JCB_locationData.sha | 1 + JCB_questionsAndAnswers.sha | 1 + JCB_sermondistributor.sha | 1 + JCB_supportGroups.sha | 1 + checksum.json | 14 +++++++++++++ hash.sh | 36 ++++++++++++++++++++++++++++++++++ 14 files changed, 62 insertions(+) create mode 100644 JCB_componentBuilderPublic.sha create mode 100644 JCB_demo.sha create mode 100644 JCB_demoAdvanced.sha create mode 100644 JCB_documentManager.sha create mode 100644 JCB_expertDatabase.sha create mode 100644 JCB_googlePlusProfileFeed.sha create mode 100644 JCB_helloWorld.sha create mode 100644 JCB_jobTrackingSystem.sha create mode 100644 JCB_locationData.sha create mode 100644 JCB_questionsAndAnswers.sha create mode 100644 JCB_sermondistributor.sha create mode 100644 JCB_supportGroups.sha create mode 100644 checksum.json create mode 100755 hash.sh diff --git a/JCB_componentBuilderPublic.sha b/JCB_componentBuilderPublic.sha new file mode 100644 index 0000000..7b8f095 --- /dev/null +++ b/JCB_componentBuilderPublic.sha @@ -0,0 +1 @@ +0f818dd501ca63845786082271bac60fedc2cabf diff --git a/JCB_demo.sha b/JCB_demo.sha new file mode 100644 index 0000000..eb03d74 --- /dev/null +++ b/JCB_demo.sha @@ -0,0 +1 @@ +2827088e3e54b32a9195dc452da4dc2d297b7e2f diff --git a/JCB_demoAdvanced.sha b/JCB_demoAdvanced.sha new file mode 100644 index 0000000..3e0aa6c --- /dev/null +++ b/JCB_demoAdvanced.sha @@ -0,0 +1 @@ +4ae5ea26b2ef921326dc0d2e47ea0a2796b6113e diff --git a/JCB_documentManager.sha b/JCB_documentManager.sha new file mode 100644 index 0000000..3c8730f --- /dev/null +++ b/JCB_documentManager.sha @@ -0,0 +1 @@ +94dc4051feb5bbd314bb2ff403540a844895d3fd diff --git a/JCB_expertDatabase.sha b/JCB_expertDatabase.sha new file mode 100644 index 0000000..b5ebf22 --- /dev/null +++ b/JCB_expertDatabase.sha @@ -0,0 +1 @@ +4177022b89e513eac425087654d45070c350bd68 diff --git a/JCB_googlePlusProfileFeed.sha b/JCB_googlePlusProfileFeed.sha new file mode 100644 index 0000000..544c44a --- /dev/null +++ b/JCB_googlePlusProfileFeed.sha @@ -0,0 +1 @@ +041ea00eb814f1ac08f12e4602ba8ef0d83e513b diff --git a/JCB_helloWorld.sha b/JCB_helloWorld.sha new file mode 100644 index 0000000..7ca6ab5 --- /dev/null +++ b/JCB_helloWorld.sha @@ -0,0 +1 @@ +f291cd7236544bb837ee710eeb12ae6a4f0ebdc3 diff --git a/JCB_jobTrackingSystem.sha b/JCB_jobTrackingSystem.sha new file mode 100644 index 0000000..be98605 --- /dev/null +++ b/JCB_jobTrackingSystem.sha @@ -0,0 +1 @@ +0c2a308c7dd2c06f19d42e1c05acad1175e19c3b diff --git a/JCB_locationData.sha b/JCB_locationData.sha new file mode 100644 index 0000000..de47af6 --- /dev/null +++ b/JCB_locationData.sha @@ -0,0 +1 @@ +5876af82f90a85da3d8e2e3e6dbe0c1a845fd0a6 diff --git a/JCB_questionsAndAnswers.sha b/JCB_questionsAndAnswers.sha new file mode 100644 index 0000000..5422a96 --- /dev/null +++ b/JCB_questionsAndAnswers.sha @@ -0,0 +1 @@ +b91cf8385f9b728084252c015329a49bd464b5ad diff --git a/JCB_sermondistributor.sha b/JCB_sermondistributor.sha new file mode 100644 index 0000000..346a707 --- /dev/null +++ b/JCB_sermondistributor.sha @@ -0,0 +1 @@ +21b2257c5b6399a118cd7089509c1fb137c0abcd diff --git a/JCB_supportGroups.sha b/JCB_supportGroups.sha new file mode 100644 index 0000000..f36d1d7 --- /dev/null +++ b/JCB_supportGroups.sha @@ -0,0 +1 @@ +294ecf967dc7058e98b7d8517b6733d5b8a1eb0b diff --git a/checksum.json b/checksum.json new file mode 100644 index 0000000..dd7ac4c --- /dev/null +++ b/checksum.json @@ -0,0 +1,14 @@ +{ + "JCB_componentBuilderPublic.zip": "0f818dd501ca63845786082271bac60fedc2cabf", + "JCB_demoAdvanced.zip": "4ae5ea26b2ef921326dc0d2e47ea0a2796b6113e", + "JCB_demo.zip": "2827088e3e54b32a9195dc452da4dc2d297b7e2f", + "JCB_documentManager.zip": "94dc4051feb5bbd314bb2ff403540a844895d3fd", + "JCB_expertDatabase.zip": "4177022b89e513eac425087654d45070c350bd68", + "JCB_googlePlusProfileFeed.zip": "041ea00eb814f1ac08f12e4602ba8ef0d83e513b", + "JCB_helloWorld.zip": "f291cd7236544bb837ee710eeb12ae6a4f0ebdc3", + "JCB_jobTrackingSystem.zip": "0c2a308c7dd2c06f19d42e1c05acad1175e19c3b", + "JCB_locationData.zip": "5876af82f90a85da3d8e2e3e6dbe0c1a845fd0a6", + "JCB_questionsAndAnswers.zip": "b91cf8385f9b728084252c015329a49bd464b5ad", + "JCB_sermondistributor.zip": "21b2257c5b6399a118cd7089509c1fb137c0abcd", + "JCB_supportGroups.zip": "294ecf967dc7058e98b7d8517b6733d5b8a1eb0b" +} diff --git a/hash.sh b/hash.sh new file mode 100755 index 0000000..4c9369d --- /dev/null +++ b/hash.sh @@ -0,0 +1,36 @@ +#! /bin/bash + +# Do some prep work +command -v jq >/dev/null 2>&1 || { echo >&2 "We require jq for this script to run, but it's not installed. Aborting."; exit 1; } +command -v sha1sum >/dev/null 2>&1 || { echo >&2 "We require sha1sum for this script to run, but it's not installed. Aborting."; exit 1; } + +# quick checksum generator for all the Bibles used in getBible.net +echo -n "[vdm.io] -- Building checksum for all JCB (zip) Packages found in this repository......" + +# setup: positional arguments to pass in literal variables, query with code +jq_args=( ) +jq_query='.' +# counter +nr=1 + +for filename in *.zip; do + # get the hash + fileHash=$(sha1sum "$filename" | awk '{print $1}') + # build the hash file name + hashFilenName="${filename/.zip/.sha}" + # create/update the file checksum + echo "$fileHash" > "$hashFilenName" + # load the values for json + jq_args+=( --arg "key$nr" "$filename" ) + jq_args+=( --arg "value$nr" "$fileHash" ) + # build query for jq + jq_query+=" | .[\$key${nr}]=\$value${nr}" + #next + nr=$((nr+1)) +done + +# run the generated command with jq +jq "${jq_args[@]}" "$jq_query" <<<'{}' > checksum.json + +# done with hash +echo "done"