[VOL-5194] - Add missing copyright notice for license check

bin/setup.sh
------------
  o This script is only used interactively, no potential job fallout.
  o Added helper function banner and error.
  o Added source comments.
  o Added banner() calls to hilight script progression.
  o polish: git add created content for pending commit.

Change-Id: I637d58f3e983b6cb1b7f08d19f16da925a579668
diff --git a/bin/setup.sh b/bin/setup.sh
index 0359907..0d3f577 100755
--- a/bin/setup.sh
+++ b/bin/setup.sh
@@ -1,36 +1,109 @@
 #!/bin/bash
-## -----------------------------------------------------------------------
-## Intent: This script ca
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -----------------------------------------------------------------------
+# SPDX-FileCopyrightText: 2023 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+## Intent: This script will update a repository makefiles/ directory
+##   by creating a hierarchy that will allow using library makefiles
+##   and per-repository makefiles.
 ## -----------------------------------------------------------------------
 
+##-------------------##
+##---]  GLOBALS  [---##
+##-------------------##
 set -euo pipefail
 
-[[ -d makefiles ]] || { echo "ERROR: makefiles/ not found"; exit 1; }
+## -----------------------------------------------------------------------
+## Intent: Display a message with formatting
+## -----------------------------------------------------------------------
+function banner()
+{
+    cat <<EOM
 
-# git rm -fr makefiles
+** -----------------------------------------------------------------------
+** $*
+** -----------------------------------------------------------------------
+EOM
+    return
+}
+
+## -----------------------------------------------------------------------
+## Intent: Display an error mesage then exit with status
+## -----------------------------------------------------------------------
+function error()
+{
+    echo "ERROR: $*"
+    exit 1
+}
+
+##----------------##
+##---]  MAIN  [---##
+##----------------##
+
+## Avoid trashing a work-in-progress
+path='makefiles/local/include.mk'
+[[ -e "$path" ]] && { error "Detected upgrade path: $path"; }
+
+banner "Archive current directory"
+tar czvf ../backup-setup.tgz .
+
+## Migration patches should be simple and plentiful.
+if [[ ! -d makefiles-orig ]]; then
+    cat <<EOM
+
+* -----------------------------------------------------------------------
+* Replacing a repository makefile directory is deployed
+* by creating a few independent patches.
+* -----------------------------------------------------------------------
+  1) Rename the repository-specific makefiles directory.
+  1a) git mv makefiles makefiles-orig
+  1b) Update Makefile to "include makefiles-orig"
+
+  2) Create makefiles/
+  2a) add repo:onf-make as a submodule.
+  2b) create makefiles/local/
+  2c) relocate config files
+
+  3) Update Makefile to include makefiles/include.mk
+
+EOM
+    exit 1
+fi
 
 mkdir -p makefiles
-pushd makefiles || { echo "ERROR: pushd makefiles failed"; exit 1; }
+pushd makefiles || { error 'pushd makefiles failed'; }
 
-echo '** Adding repo:onf-make (library makefiles) as a submodule'
+banner 'Adding repo:onf-make (library makefiles) as a submodule'
 git submodule add 'https://github.com/opencord/onf-make.git' onf-lib
 
-echo '** Ignore local onf-make edits'
-echo 'onf-lib' >> .gitignore
+banner 'Install library/local loader include.mk'
+rsync -v --checksum onf-lib/makefiles_include_mk.ex include.mk
 
-cp ../makefiles_include_mk.ex include.mk
-
-echo '** Create project specific directory makefiles/local'
+banner 'Create project specific directory makefiles/local'
 mkdir -p local
 touch local/include.mk
 
-popd || { echo "ERROR: popd makefiles failed"; exit 1; }
+popd || { error 'popd makefiles failed'; }
 
-if false; then
-    git add makefiles/.gitignore
-    git add makefiles/include.mk
-    git add makefiles/local/include.mk
-
-# git add makefiles
+banner 'Prep work for pending checkin'
+git add makefiles/include.mk
+git add makefiles/local/include.mk
+git mv config.mk makefiles/config.mk
+git add makefiles
 
 # [EOF]